From 1de50ea5dc8622dbae3d08926d10c6a0188b6411 Mon Sep 17 00:00:00 2001 From: surrim Date: Thu, 27 Jan 2022 21:36:01 +0100 Subject: [PATCH] updated openlayers to v6.12.0 --- serendipity_event_osm/ressources/ol.css | 2 +- serendipity_event_osm/ressources/ol.css.map | 2 +- serendipity_event_osm/ressources/ol.js | 2 +- serendipity_event_osm/ressources/ol.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/serendipity_event_osm/ressources/ol.css b/serendipity_event_osm/ressources/ol.css index 82f7788b..3a33f5a9 100644 --- a/serendipity_event_osm/ressources/ol.css +++ b/serendipity_event_osm/ressources/ol.css @@ -1,2 +1,2 @@ -.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-Index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:flex-end}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move} +.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid #b3c5db;background-color:rgba(255,255,255,.4)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-Index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:rgba(0,60,136,.7);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff;font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move} /*# sourceMappingURL=ol.css.map */ \ No newline at end of file diff --git a/serendipity_event_osm/ressources/ol.css.map b/serendipity_event_osm/ressources/ol.css.map index 1e1125f7..e8623cae 100644 --- a/serendipity_event_osm/ressources/ol.css.map +++ b/serendipity_event_osm/ressources/ol.css.map @@ -1 +1 @@ -{"version":3,"sources":["src/ol/ol.css"],"names":[],"mappings":"AAAA,QACE,WAAY,WACZ,cAAe,IACf,OAAQ,IAAI,MAAM,KAGpB,mBACE,IAAK,IACL,MAAO,IACP,SAAU,SAGZ,eACE,WAAY,kBACZ,cAAe,IACf,OAAQ,IACR,KAAM,IACN,QAAS,IACT,SAAU,SAEZ,qBACE,OAAQ,IAAI,MAAM,KAClB,WAAY,KACZ,MAAO,KACP,UAAW,KACX,WAAY,OACZ,OAAQ,IACR,YAAa,QAAQ,CAAE,MACvB,WAAY,IAAI,KAElB,cACE,SAAU,SACV,OAAQ,IACR,KAAM,IAER,sBACE,MAAO,IACP,OAAQ,KACR,iBAAkB,KAClB,MAAO,MACP,QAAS,GAEX,oBACE,SAAU,SACV,OAAQ,KACR,UAAW,KACX,QAAS,GACT,MAAO,KACP,YAAa,KAAK,EAAE,IAAO,CAAE,EAAE,IAAI,IAAO,CAAE,IAAI,EAAE,IAAO,CAAE,EAAE,KAAK,KAEpE,eACE,SAAU,SACV,UAAW,KACX,WAAY,OACZ,OAAQ,KACR,MAAO,KACP,YAAa,KAAK,EAAE,IAAO,CAAE,EAAE,IAAI,IAAO,CAAE,IAAI,EAAE,IAAO,CAAE,EAAE,KAAK,KAEpE,oBACE,SAAU,SACV,OAAQ,KACR,QAAS,EACT,WAAY,WACZ,OAAQ,IAAI,MAAM,KAGpB,gBACE,QAAS,KAEG,iBAAd,aACE,sBAAuB,KACvB,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KACb,4BAA6B,YAE/B,eACE,sBAAuB,QACvB,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,aACE,OAAQ,iBACR,OAAQ,cACR,OAAQ,SAEV,SACE,OAAQ,KACR,OAAQ,aACR,OAAQ,UACR,OAAQ,KAEV,YACE,SAAU,SACV,iBAAkB,qBAClB,cAAe,IACf,QAAS,IAEX,kBACE,iBAAkB,qBAEpB,SACE,IAAK,KACL,KAAM,KAER,WACE,IAAK,KACL,MAAO,KACP,WAAY,QAAQ,KAAK,MAAM,CAAE,WAAW,GAAG,OAEjD,qBACE,QAAS,EACT,WAAY,OACZ,WAAY,QAAQ,KAAK,MAAM,CAAE,WAAW,GAAG,OAAO,KAExD,gBACE,IAAK,QACL,KAAM,KAER,gBACE,MAAO,KACP,IAAK,KAGP,mBACE,QAAS,MACT,OAAQ,IACR,QAAS,EACT,MAAO,KACP,UAAW,OACX,YAAa,IACb,gBAAiB,KACjB,WAAY,OACZ,OAAQ,QACR,MAAO,QACP,YAAa,KACb,iBAAkB,kBAClB,OAAQ,KACR,cAAe,IAEjB,qCACE,OAAQ,KACR,QAAS,EAEX,uBACE,YAAa,MAEf,YACE,QAAS,MACT,YAAa,IACb,UAAW,MACX,YAAa,UAEf,6BACE,UAAW,MAEb,0BACE,IAAK,MAGP,yBADA,yBAEE,gBAAiB,KACjB,iBAAkB,kBAEpB,qBACE,cAAe,IAAI,IAAI,EAAE,EAE3B,sBACE,cAAe,EAAE,EAAE,IAAI,IAIzB,gBACE,WAAY,MACZ,OAAQ,KACR,MAAO,KACP,UAAW,mBACX,QAAS,KACT,UAAW,YACX,YAAa,SAEf,mBACE,OAAQ,EACR,QAAS,IAAI,KACb,MAAO,KACP,YAAa,EAAE,EAAE,IAAI,KAEvB,mBACE,QAAS,OACT,WAAY,KAEd,0CACE,QAAS,IAEX,oBACE,WAAY,IACZ,UAAW,QACX,eAAgB,OAElB,uBACE,YAAa,EAEf,gCACE,QAAS,KAEX,mCACE,WAAY,qBAEd,iCACE,OAAQ,EACR,MAAO,EACP,cAAe,IAAI,EAAE,EAEvB,qCACE,WAAY,MACZ,WAAY,MAEd,wCACE,QAAS,KAGX,eACE,IAAK,MACL,KAAM,KACN,OAAQ,MAEV,sBACE,SAAU,SACV,OAAQ,KAGV,yBACE,IAAK,MAGP,gBACE,KAAM,KACN,OAAQ,KAEV,iCACE,OAAQ,EACR,KAAM,EACN,cAAe,EAAE,IAAI,EAAE,EAEzB,oCACA,uBACE,QAAS,MAEX,oCACE,OAAQ,IAAI,MAAM,QAClB,OAAQ,MACR,OAAQ,IACR,MAAO,MAET,0CACE,OAAQ,IACR,KAAM,IACN,SAAU,SAEZ,iDACA,wCACE,QAAS,KAEX,mCACE,WAAY,qBAEd,oBACE,OAAQ,IAAI,OAAO,kBAGrB,0CACE,OAAQ"} \ No newline at end of file +{"version":3,"sources":["src/ol/ol.css"],"names":[],"mappings":"AAAA,QACE,WAAY,WACZ,cAAe,IACf,OAAQ,MAAM,MAAM,QACpB,iBAAkB,qBAGpB,mBACE,IAAK,IACL,MAAO,IACP,SAAU,SAGZ,eACE,WAAY,kBACZ,cAAe,IACf,OAAQ,IACR,KAAM,IACN,QAAS,IACT,SAAU,SAEZ,qBACE,OAAQ,IAAI,MAAM,KAClB,WAAY,KACZ,MAAO,KACP,UAAW,KACX,WAAY,OACZ,OAAQ,IACR,YAAa,QAAQ,CAAE,MACvB,WAAY,IAAI,KAElB,cACE,SAAU,SACV,OAAQ,IACR,KAAM,IAER,sBACE,MAAO,IACP,OAAQ,KACR,iBAAkB,KAClB,MAAO,MACP,QAAS,GAEX,oBACE,SAAU,SACV,OAAQ,KACR,UAAW,KACX,QAAS,GACT,MAAO,KACP,YAAa,KAAK,EAAE,IAAO,CAAE,EAAE,IAAI,IAAO,CAAE,IAAI,EAAE,IAAO,CAAE,EAAE,KAAK,KAEpE,eACE,SAAU,SACV,UAAW,KACX,WAAY,OACZ,OAAQ,KACR,MAAO,KACP,YAAa,KAAK,EAAE,IAAO,CAAE,EAAE,IAAI,IAAO,CAAE,IAAI,EAAE,IAAO,CAAE,EAAE,KAAK,KAEpE,oBACE,SAAU,SACV,OAAQ,KACR,QAAS,EACT,WAAY,WACZ,OAAQ,IAAI,MAAM,KAGpB,gBACE,QAAS,KAEG,iBAAd,aACE,sBAAuB,KACvB,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KACb,4BAA6B,YAE/B,oBACE,IAAK,MAEP,eACE,sBAAuB,QACvB,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,aACE,OAAQ,iBACR,OAAQ,cACR,OAAQ,SAEV,SACE,OAAQ,KACR,OAAQ,aACR,OAAQ,UACR,OAAQ,KAEV,YACE,SAAU,SACV,iBAAkB,qBAClB,cAAe,IACf,QAAS,IAEX,kBACE,iBAAkB,qBAEpB,SACE,IAAK,KACL,KAAM,KAER,WACE,IAAK,KACL,MAAO,KACP,WAAY,QAAQ,KAAK,MAAM,CAAE,WAAW,GAAG,OAEjD,qBACE,QAAS,EACT,WAAY,OACZ,WAAY,QAAQ,KAAK,MAAM,CAAE,WAAW,GAAG,OAAO,KAExD,gBACE,IAAK,QACL,KAAM,KAER,gBACE,MAAO,KACP,IAAK,KAGP,mBACE,QAAS,MACT,OAAQ,IACR,QAAS,EACT,MAAO,KACP,YAAa,IACb,gBAAiB,KACjB,UAAW,QACX,WAAY,OACZ,OAAQ,QACR,MAAO,QACP,YAAa,KACb,iBAAkB,kBAClB,OAAQ,KACR,cAAe,IAEjB,qCACE,OAAQ,KACR,QAAS,EAEX,uBACE,YAAa,MAEf,YACE,QAAS,MACT,YAAa,IACb,UAAW,MACX,YAAa,UAEf,6BACE,UAAW,MAEb,0BACE,IAAK,MAGP,yBADA,yBAEE,gBAAiB,KACjB,iBAAkB,kBAEpB,qBACE,cAAe,IAAI,IAAI,EAAE,EAE3B,sBACE,cAAe,EAAE,EAAE,IAAI,IAIzB,gBACE,WAAY,MACZ,OAAQ,KACR,MAAO,KACP,UAAW,mBACX,QAAS,KACT,UAAW,YACX,YAAa,OAEf,kBACE,MAAO,kBACP,gBAAiB,KAEnB,mBACE,OAAQ,EACR,QAAS,IAAI,KACb,MAAO,KACP,YAAa,EAAE,EAAE,IAAI,KACrB,UAAW,KAEb,mBACE,QAAS,OACT,WAAY,KAEd,0CACE,QAAS,IAEX,oBACE,WAAY,IACZ,UAAW,QACX,eAAgB,OAElB,uBACE,YAAa,EAEf,gCACE,QAAS,KAEX,mCACE,WAAY,qBAEd,iCACE,OAAQ,EACR,MAAO,EACP,cAAe,IAAI,EAAE,EAEvB,qCACE,WAAY,MACZ,WAAY,MAEd,wCACE,QAAS,KAGX,eACE,IAAK,MACL,KAAM,KACN,OAAQ,MAEV,sBACE,SAAU,SACV,OAAQ,KAGV,yBACE,IAAK,MAGP,gBACE,KAAM,KACN,OAAQ,KAEV,iCACE,OAAQ,EACR,KAAM,EACN,cAAe,EAAE,IAAI,EAAE,EAEzB,oCACA,uBACE,QAAS,MAEX,oCACE,OAAQ,IAAI,MAAM,QAClB,OAAQ,MACR,OAAQ,IACR,MAAO,MAET,0CACE,OAAQ,IACR,KAAM,IACN,SAAU,SAEZ,iDACA,wCACE,QAAS,KAEX,mCACE,WAAY,qBAEd,oBACE,OAAQ,IAAI,OAAO,kBAGrB,0CACE,OAAQ"} \ No newline at end of file diff --git a/serendipity_event_osm/ressources/ol.js b/serendipity_event_osm/ressources/ol.js index 4e05a74f..d78005f0 100644 --- a/serendipity_event_osm/ressources/ol.js +++ b/serendipity_event_osm/ressources/ol.js @@ -1,3 +1,3 @@ /*! For license information please see ol.js.LICENSE.txt */ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ol=n():t.ol=n()}(self,(function(){return function(){var t={645:function(t,n){n.read=function(t,n,i,r,e){var o,s,a=8*e-r-1,u=(1<>1,c=-7,f=i?e-1:0,l=i?-1:1,v=t[n+f];for(f+=l,o=v&(1<<-c)-1,v>>=-c,c+=a;c>0;o=256*o+t[n+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[n+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=h}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,a,u,h=8*o-e-1,c=(1<>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,s=c):(s=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-s))<1&&(s--,u*=2),(n+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(n*u-1)*Math.pow(2,e),s+=f):(a=n*Math.pow(2,f-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&a,v+=d,a/=256,e-=8);for(s=s<0;t[i+v]=255&s,v+=d,s/=256,h-=8);t[i+v-d]|=128*p}},138:function(t){var n={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},i=" ",r=/(italic|oblique)$/i,e={};t.exports=function(t,o,s){var a=e[t];if(!a){Array.isArray(t)||(t=[t]);for(var u=400,h="normal",c=[],f=0,l=t.length;f>>0):4294967296*(n>>>0)+(t>>>0)}function c(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function f(t,n){for(var i=0;i>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function j(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=j(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+j(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return h(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&a?function(t,n,i){return a.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e239?4:u>223?3:u>191?2:1;if(e+c>i)break;1===c?u<128&&(h=u):2===c?128==(192&(o=t[e+1]))&&(h=(31&u)<<6|63&o)<=127&&(h=null):3===c?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((h=(15&u)<<12|(63&o)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(o=t[e+1],s=t[e+2],a=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),e+=c}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=u(this);for(t=t||[];this.pos127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&c(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i=128&&c(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,g,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},582:function(t){t.exports=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var a=o-e+1,u=r-e+1,h=Math.log(a),c=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*c*(a-c)/a)*(u-a/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-u*c/a+f)),Math.min(o,Math.floor(r+(a-u)*c/a+f)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return tn?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var a=i+Math.ceil((r-i)/e/2)*e;t(n,a,i,r,o),s.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,a,u,h,f,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),m=s(t,d,i,this.toBBox),y=(e=p,o=m,a=void 0,u=void 0,h=void 0,f=void 0,a=Math.max(e.minX,o.minX),u=Math.max(e.minY,o.minY),h=Math.min(e.maxX,o.maxX),f=Math.min(e.maxY,o.maxY),Math.max(0,h-a)*Math.max(0,f-u)),g=c(p)+c(m);y=n;v--){var d=t.children[v];a(u,t.leaf?e(d):d),h+=f(u)}return h},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)a(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r}()},975:function(t){(function(){var n;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)}},n={};function i(r){var e=n[r];if(void 0!==e)return e.exports;var o=n[r]={exports:{}};return t[r].call(o.exports,o,o.exports,i),o.exports}i.d=function(t,n){for(var r in n)i.o(n,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},i.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var r={};return function(){"use strict";function t(){return function(){throw new Error("Unimplemented abstract method.")}()}i.d(r,{default:function(){return pP}});var n=0;function e(t){return t.ol_uid||(t.ol_uid=String(++n))}var o,s="6.6.0",a=(o=function(t,n){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),u=function(t){function n(n){var i=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+s.split("-")[0])+"/doc/errors/#"+n+" for details.";return(i=t.call(this,r)||this).code=n,i.name="AssertionError",i.message=r,i}return a(n,t),n}(Error);function h(t){t.stopPropagation()}var c=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),f="propertychange",l=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function v(t,n,i){for(var r,e,o=i||d,s=0,a=t.length,u=!1;s>1)],n))<0?s=r+1:(a=r,u=!e);return u?s:~s}function d(t,n){return t>n?1:t=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e0?e-1:e:t[e-1]-n>>0,e=0;e0||i&&0===o)}))}function M(){return!0}function S(){return!1}function _(){}function O(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&b(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}var k="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r0)},n.prototype.removeEventListener=function(t,n){var i=this.v&&this.v[t];if(i){var r=i.indexOf(n);-1!==r&&(this.i&&t in this.i?(i[r]=_,++this.i[t]):(i.splice(r,1),0===i.length&&delete this.v[t]))}},n}(l),N="change",z="error",I="clear",R="contextmenu",L="click",F="dblclick",G="dragenter",q="dragover",D="drop",B="keydown",U="keypress",W="load",V="resize",J="touchmove",X="wheel";function H(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function Y(t,n,i,r){return H(t,n,i,r,!0)}function Z(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),T(t))}var $=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),K=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.p=0,n}return $(n,t),n.prototype.changed=function(){++this.p,this.dispatchEvent(N)},n.prototype.getRevision=function(){return this.p},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;ne&&(u|=tn),ao&&(u|=Qt),u===$t&&(u=Kt),u}function ln(){return[1/0,1/0,-1/0,-1/0]}function vn(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function dn(t){return vn(1/0,1/0,-1/0,-1/0,t)}function pn(t,n){var i=t[0],r=t[1];return vn(i,r,i,r,n)}function mn(t,n,i,r,e){return jn(dn(e),t,n,i,r)}function yn(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function gn(t,n,i){return Math.abs(t[0]-n[0])t[2]&&(t[2]=n[2]),n[1]t[3]&&(t[3]=n[3]),t}function bn(t,n){n[0]t[2]&&(t[2]=n[0]),n[1]t[3]&&(t[3]=n[1])}function xn(t,n){for(var i=0,r=n.length;in[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function Fn(t){return t[2]=s&&p<=u),r||!(o&tn)||e&tn||(r=(m=v-(l-u)*d)>=a&&m<=h),r||!(o&nn)||e&nn||(r=(p=l-(v-a)/d)>=s&&p<=u),r||!(o&rn)||e&rn||(r=(m=v-(l-s)*d)>=a&&m<=h)}return r}function Bn(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=i[2])){var e=Rn(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}var Wn=function(){function t(t){this.q=t.code,this.D=t.units,this.B=void 0!==t.extent?t.extent:null,this.U=void 0!==t.worldExtent?t.worldExtent:null,this.W=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.V=void 0!==t.global&&t.global,this.H=!(!this.V||!this.B),this.K=t.getPointResolution,this.tt=null,this.nt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.H},t.prototype.getCode=function(){return this.q},t.prototype.getExtent=function(){return this.B},t.prototype.getUnits=function(){return this.D},t.prototype.getMetersPerUnit=function(){return this.nt||bt[this.D]},t.prototype.getWorldExtent=function(){return this.U},t.prototype.getAxisOrientation=function(){return this.W},t.prototype.isGlobal=function(){return this.V},t.prototype.setGlobal=function(t){this.V=t,this.H=!(!t||!this.B)},t.prototype.getDefaultTileGrid=function(){return this.tt},t.prototype.setDefaultTileGrid=function(t){this.tt=t},t.prototype.setExtent=function(t){this.B=t,this.H=!(!this.V||!t)},t.prototype.setWorldExtent=function(t){this.U=t},t.prototype.setGetPointResolution=function(t){this.K=t},t.prototype.getPointResolutionFunc=function(){return this.K},t}();function Vn(t,n,i){return Math.min(Math.max(t,n),i)}var Jn="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},Xn="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Hn(t,n,i,r,e,o){var s=e-i,a=o-r;if(0!==s||0!==a){var u=((t-i)*s+(n-r)*a)/(s*s+a*a);u>1?(i=e,r=o):u>0&&(i+=s*u,r+=a*u)}return Yn(t,n,i,r)}function Yn(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function Zn(t){for(var n=t.length,i=0;ie&&(e=s,r=o)}if(0===e)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var u=i+1;u=0;l--){f[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*f[l]}return f}function $n(t){return 180*t/Math.PI}function Kn(t){return t*Math.PI/180}function Qn(t,n){var i=t%n;return i*n<0?i+n:i}function ti(t,n,i){return t+i*(n-t)}var ni=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ii=6378137,ri=Math.PI*ii,ei=[-ri,-ri,ri,ri],oi=[-180,-85,180,85],si=ii*Math.log(Math.tan(Math.PI/2)),ai=function(t){function n(n){return t.call(this,{code:n,units:jt.METERS,extent:ei,global:!0,worldExtent:oi,getPointResolution:function(t,n){return t/Jn(n[1]/ii)}})||this}return ni(n,t),n}(Wn),ui=[new ai("EPSG:3857"),new ai("EPSG:102100"),new ai("EPSG:102113"),new ai("EPSG:900913"),new ai("http://www.opengis.net/gml/srs/epsg.xml#3857")];function hi(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;ssi?a=si:a<-si&&(a=-si),o[s+1]=a}return o}function ci(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sn?r:new Array(1+n-e).join("0")+r}function Ci(t,n){for(var i=(""+t).split("."),r=(""+n).split("."),e=0;es)return 1;if(s>o)return-1}return 0}function Pi(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function Ni(t,n){var i=n.getRadius(),r=n.getCenter(),e=r[0],o=r[1],s=t[0]-e,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[e+i*s/u,o+i*a/u]}function zi(t,n){var i,r,e=t[0],o=t[1],s=n[0],a=n[1],u=s[0],h=s[1],c=a[0],f=a[1],l=c-u,v=f-h,d=0===l&&0===v?0:(l*(e-u)+v*(o-h))/(l*l+v*v||0);return d<=0?(i=u,r=h):d>=1?(i=c,r=f):(i=u+d*l,r=h+d*v),[i,r]}function Ii(t,n,i){var r=Qn(n+180,360)-180,e=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(e/3600),u=Math.floor((e-3600*a)/60),h=e-3600*a-60*u;return(h=Math.ceil(h*s)/s)>=60&&(h=0,u+=1),u>=60&&(u=0,a+=1),a+"° "+Ei(u,2)+"′ "+Ei(h,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function Ri(t,n,i){return t?n.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Li(t,n){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){i=!1;break}return i}function Fi(t,n){var i=Math.cos(n),r=Math.sin(n),e=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=e,t[1]=o,t}function Gi(t,n){return t[0]*=n,t[1]*=n,t}function qi(t,n){var i=t[0]-n[0],r=t[1]-n[1];return i*i+r*r}function Di(t,n){return Math.sqrt(qi(t,n))}function Bi(t,n){return qi(t,zi(t,n))}function Ui(t,n){return Ri(t,"{x}, {y}",n)}function Wi(t,n){if(n.canWrapX()){var i=Rn(n.getExtent()),r=Vi(t,n,i);r&&(t[0]-=r*i)}return t}function Vi(t,n,i){var r=n.getExtent(),e=0;if(n.canWrapX()&&(t[0]r[2])){var o=i||Rn(r);e=Math.floor((t[0]-r[0])/o)}return e}function Ji(t,n,i){var r;if(void 0!==n){for(var e=0,o=t.length;e=2;--h)s[a+h]=n[a+h]}return s}}function ir(t,n,i,r){var e=Zi(t),o=Zi(n);Mi(e,o,nr(i)),Mi(o,e,nr(r))}function rr(t,n){if(t===n)return!0;var i=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||er(t,n)===Ji)&&i}function er(t,n){var i=Si(t.getCode(),n.getCode());return i||(i=Xi),i}function or(t,n){return er(Zi(t),Zi(n))}function sr(t,n,i){return or(n,i)(t,void 0,t.length)}function ar(t,n,i,r){return Bn(t,or(n,i),void 0,r)}var ur=null;function hr(t){ur=Zi(t)}function cr(){return ur}function fr(t,n){return ur?sr(t,n,ur):t}function lr(t,n){return ur?sr(t,ur,n):t}function vr(t,n){return ur?ar(t,n,ur):t}function dr(t,n){return ur?ar(t,ur,n):t}function pr(t,n,i){return function(r){var e,o,s=r[0],a=r[1];if(t.canWrapX()){var u=t.getExtent(),h=Rn(u);(o=Vi(r,t,h))&&(s-=o*h),s=Vn(s,u[0],u[2]),a=Vn(a,u[1],u[3]),e=i([s,a])}else e=i(r);return o&&n.canWrapX()&&(e[0]+=o*Rn(n.getExtent())),e}}function mr(){Ki(ui),Ki(mi),Qi(mi,ui,hi,ci)}function yr(t,n,i,r,e,o){for(var s=o||[],a=0,u=n;u1)a=i;else{if(l>0){for(var v=0;ve&&(e=h),o=a,s=u}return e}function Er(t,n,i,r,e){for(var o=0,s=i.length;o0;){for(var f=h.pop(),l=h.pop(),v=0,d=t[l],p=t[l+1],m=t[f],y=t[f+1],g=l+r;gv&&(c=g,v=w)}v>e&&(u[(c-n)/r]=1,l+re&&(o[s++]=h,o[s++]=c,a=h,u=c);return h==a&&c==u||(o[s++]=h,o[s++]=c),s}function Br(t,n){return n*Math.round(t/n)}function Ur(t,n,i,r,e,o,s){if(n==i)return s;var a,u,h=Br(t[n],e),c=Br(t[n+1],e);n+=r,o[s++]=h,o[s++]=c;do{if(a=Br(t[n],e),u=Br(t[n+1],e),(n+=r)==i)return o[s++]=a,o[s++]=u,s}while(a==h&&u==c);for(;n0&&p>v)&&(d<0&&m0&&m>d)?(a=f,u=l):(o[s++]=a,o[s++]=u,h=a,c=u,a=f,u=l)}}return o[s++]=a,o[s++]=u,s}function Wr(t,n,i,r,e,o,s,a){for(var u=0,h=i.length;uo&&(h-a)*(o-u)-(e-a)*(c-u)>0&&s++:c<=o&&(h-a)*(o-u)-(e-a)*(c-u)<0&&s--,a=h,u=c}return 0!==s}function ee(t,n,i,r,e,o){if(0===i.length)return!1;if(!re(t,n,i[0],r,e,o))return!1;for(var s=1,a=i.length;sx&&ee(t,n,i,r,h=(c+f)/2,p)&&(b=h,x=j),c=f}return isNaN(b)&&(b=e[o]),s?(s.push(b,p,x),s):[b,p,x]}function ae(t,n,i,r,e){for(var o=[],s=0,a=i.length;s=e[0]&&o[2]<=e[2]||(o[1]>=e[1]&&o[3]<=e[3]||ue(t,n,i,r,(function(t,n){return Dn(e,t,n)})))))}function ce(t,n,i,r,e){for(var o=0,s=i.length;o0}function me(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,a=i.length;st)throw new Error("Tile load sequence violation");this.state=t,this.changed()},i.prototype.load=function(){t()},i.prototype.getAlpha=function(t,n){if(!this.Pt)return 1;var i=this.Nt[t];if(i){if(-1===i)return 1}else i=n,this.Nt[t]=i;var r=n-i+1e3/60;return r>=this.Pt?1:ro(r/this.Pt)},i.prototype.inTransition=function(t){return!!this.Pt&&-1!==this.Nt[t]},i.prototype.endTransition=function(t){this.Pt&&(this.Nt[t]=-1)},i}(P);function ho(t,n,i,r){var e=i&&i.length?i.shift():At?new OffscreenCanvas(t||300,n||300):document.createElement("canvas");return t&&(e.width=t),n&&(e.height=n),e.getContext("2d",r)}function co(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}function fo(t){var n=t.offsetHeight,i=getComputedStyle(t);return n+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)}function lo(t,n){var i=n.parentNode;i&&i.replaceChild(t,n)}function vo(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function po(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function mo(t,n){for(var i=t.childNodes,r=0;;++r){var e=i[r],o=n[r];if(!e&&!o)break;e!==o&&(e?o?t.insertBefore(o,e):(t.removeChild(e),--r):t.appendChild(o))}}var yo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var go=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,s)||this;return a.zt=e,a.xt=r,a.key=r,a.jt=new Image,null!==e&&(a.jt.crossOrigin=e),a.Mt=null,a.It=o,a}return yo(n,t),n.prototype.getImage=function(){return this.jt},n.prototype.setImage=function(t){this.jt=t,this.state=to,this.Ot(),this.changed()},n.prototype._t=function(){var t;this.state=no,this.Ot(),this.jt=((t=ho(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},n.prototype.kt=function(){var t=this.jt;t.naturalWidth&&t.naturalHeight?this.state=to:this.state=io,this.Ot(),this.changed()},n.prototype.load=function(){this.state==no&&(this.state=Ke,this.jt=new Image,null!==this.zt&&(this.jt.crossOrigin=this.zt)),this.state==Ke&&(this.state=Qe,this.changed(),this.It(this,this.xt),this.Mt=He(this.jt,this.kt.bind(this),this._t.bind(this)))},n.prototype.Ot=function(){this.Mt&&(this.Mt(),this.Mt=null)},n}(uo),wo=function(){function t(t,n,i){this.Rt=t,this.Lt=n,this.Ft=i,this.Gt=[],this.qt=0,this.Dt=0}return t.prototype.begin=function(){this.Gt.length=0,this.qt=0,this.Dt=0},t.prototype.update=function(t,n){this.Gt.push(t,n,Date.now())},t.prototype.end=function(){if(this.Gt.length<6)return!1;var t=Date.now()-this.Ft,n=this.Gt.length-3;if(this.Gt[n+2]0&&this.Gt[i+2]>t;)i-=3;var r=this.Gt[n+2]-this.Gt[i+2];if(r<1e3/60)return!1;var e=this.Gt[n]-this.Gt[i],o=this.Gt[n+1]-this.Gt[i+1];return this.qt=Math.atan2(o,e),this.Dt=Math.sqrt(e*e+o*o)/r,this.Dt>this.Lt},t.prototype.getDistance=function(){return(this.Lt-this.Dt)/this.Rt},t.prototype.getAngle=function(){return this.qt},t}(),bo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,xo=/^([a-z]*)$|^hsla?\(.*\)$/i;function jo(t){return"string"==typeof t?t:ko(t)}function Mo(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var i=getComputedStyle(n).color;return document.body.removeChild(n),i}return""}var So=function(){var t={},n=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(n>=1024){var e=0;for(var o in t)0==(3&e++)&&(delete t[o],--n)}r=function(t){var n,i,r,e,o;xo.exec(t)&&(t=Mo(t));if(bo.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;n=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),e=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(n=(n<<4)+n,i=(i<<4)+i,r=(r<<4)+r,u&&(e=(e<<4)+e)),o=[n,i,r,e/255]}else 0==t.indexOf("rgba(")?Oo(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Oo(o)):ct(!1,14);return o}(i),t[i]=r,++n}return r}}();function _o(t){return Array.isArray(t)?t:So(t)}function Oo(t){return t[0]=Vn(t[0]+.5|0,0,255),t[1]=Vn(t[1]+.5|0,0,255),t[2]=Vn(t[2]+.5|0,0,255),t[3]=Vn(t[3],0,1),t}function ko(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+i+","+r+","+(void 0===t[3]?1:t[3])+")"}function To(t){return xo.test(t)&&(t=Mo(t)),bo.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Ao=function(){function t(){this.Bt={},this.Ut=0,this.Wt=32}return t.prototype.clear=function(){this.Bt={},this.Ut=0},t.prototype.canExpireCache=function(){return this.Ut>this.Wt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Bt){var i=this.Bt[n];0!=(3&t++)||i.hasListener()||(delete this.Bt[n],--this.Ut)}}},t.prototype.get=function(t,n,i){var r=Eo(t,n,i);return r in this.Bt?this.Bt[r]:null},t.prototype.set=function(t,n,i,r){var e=Eo(t,n,i);this.Bt[e]=r,++this.Ut},t.prototype.setSize=function(t){this.Wt=t,this.expire()},t}();function Eo(t,n,i){return n+":"+t+":"+(i?jo(i):"null")}var Co=Ao,Po=new Ao,No="opacity",zo="visible",Io="extent",Ro="zIndex",Lo="maxResolution",Fo="minResolution",Go="maxZoom",qo="minZoom",Do="source",Bo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uo=function(n){function i(t){var i=n.call(this)||this;i.on,i.once,i.un;var r=k({},t);return"object"==typeof t.properties&&(delete r.properties,k(r,t.properties)),r[No]=void 0!==t.opacity?t.opacity:1,ct("number"==typeof r[No],64),r[zo]=void 0===t.visible||t.visible,r[Ro]=t.zIndex,r[Lo]=void 0!==t.maxResolution?t.maxResolution:1/0,r[Fo]=void 0!==t.minResolution?t.minResolution:0,r[qo]=void 0!==t.minZoom?t.minZoom:-1/0,r[Go]=void 0!==t.maxZoom?t.maxZoom:1/0,i.Vt=void 0!==r.className?t.className:"ol-layer",delete r.className,i.setProperties(r),i.Jt=null,i}return Bo(i,n),i.prototype.getClassName=function(){return this.Vt},i.prototype.getLayerState=function(t){var n=this.Jt||{layer:this,managed:void 0===t||t},i=this.getZIndex();return n.opacity=Vn(Math.round(100*this.getOpacity())/100,0,1),n.sourceState=this.getSourceState(),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==i||n.managed?i:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.Jt=n,n},i.prototype.getLayersArray=function(n){return t()},i.prototype.getLayerStatesArray=function(n){return t()},i.prototype.getExtent=function(){return this.get(Io)},i.prototype.getMaxResolution=function(){return this.get(Lo)},i.prototype.getMinResolution=function(){return this.get(Fo)},i.prototype.getMinZoom=function(){return this.get(qo)},i.prototype.getMaxZoom=function(){return this.get(Go)},i.prototype.getOpacity=function(){return this.get(No)},i.prototype.getSourceState=function(){return t()},i.prototype.getVisible=function(){return this.get(zo)},i.prototype.getZIndex=function(){return this.get(Ro)},i.prototype.setExtent=function(t){this.set(Io,t)},i.prototype.setMaxResolution=function(t){this.set(Lo,t)},i.prototype.setMinResolution=function(t){this.set(Fo,t)},i.prototype.setMaxZoom=function(t){this.set(Go,t)},i.prototype.setMinZoom=function(t){this.set(qo,t)},i.prototype.setOpacity=function(t){ct("number"==typeof t,64),this.set(No,t)},i.prototype.setVisible=function(t){this.set(zo,t)},i.prototype.setZIndex=function(t){this.set(Ro,t)},i.prototype.disposeInternal=function(){this.Jt&&(this.Jt.layer=null,this.Jt=null),n.prototype.disposeInternal.call(this)},i}(rt),Wo="prerender",Vo="postrender",Jo="precompose",Xo="postcompose",Ho="rendercomplete",Yo="undefined",Zo="loading",$o="ready",Ko="error",Qo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function ts(t,n){if(!t.visible)return!1;var i=n.resolution;if(i=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var ns=function(t){function n(n){var i=this,r=k({},n);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.Xt=null,i.Ht=null,i.Yt=null,i.Zt=null,n.render&&(i.render=n.render),n.map&&i.setMap(n.map),i.addChangeListener(Do,i.$t);var e=n.source?n.source:null;return i.setSource(e),i}return Qo(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(Do)||null},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Yo},n.prototype.Kt=function(){this.changed()},n.prototype.$t=function(){this.Yt&&(Z(this.Yt),this.Yt=null);var t=this.getSource();t&&(this.Yt=H(t,N,this.Kt,this)),this.changed()},n.prototype.getFeatures=function(t){return this.Zt?this.Zt.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.render=function(t,n){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,n)},n.prototype.setMap=function(t){this.Xt&&(Z(this.Xt),this.Xt=null),t||this.changed(),this.Ht&&(Z(this.Ht),this.Ht=null),t&&(this.Xt=H(t,Jo,(function(t){var n=t.frameState.layerStatesArray,i=this.getLayerState(!1);ct(!n.some((function(t){return t.layer===i.layer})),67),n.push(i)}),this),this.Ht=H(this,N,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(Do,t)},n.prototype.getRenderer=function(){return this.Zt||(this.Zt=this.createRenderer()),this.Zt},n.prototype.hasRenderer=function(){return!!this.Zt},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},n}(Uo),is=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function rs(t,n){Po.expire()}var es=function(n){function i(t){var i=n.call(this)||this;return i.Qt=t,i}return is(i,n),i.prototype.dispatchRenderEvent=function(n,i){t()},i.prototype.calculateMatrices2D=function(t){var n=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),Wt(r,i)},i.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o,s,a){var u,h=n.viewState;function c(t,n,i,r){return e.call(o,n,t?i:null,r)}var f=h.projection,l=Wi(t.slice(),f),v=[[0,0]];if(f.canWrapX()&&r){var d=Rn(f.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,m=p.length,y=[],g=[],w=0;w=0;--b){var x=p[b],j=x.layer;if(j.hasRenderer()&&ts(x,h)&&s.call(a,j)){var M=j.getRenderer(),S=j.getSource();if(M&&S){var _=S.getWrapX()?l:t,O=c.bind(null,x.managed);g[0]=_[0]+v[w][0],g[1]=_[1]+v[w][1],u=M.forEachFeatureAtCoordinate(g,n,i,O,y)}if(u)return u}}if(0!==y.length){var k=1/y.length;return y.forEach((function(t,n){return t.distanceSq+=n*k})),y.sort((function(t,n){return t.distanceSq-n.distanceSq})),y.some((function(t){return u=t.callback(t.feature,t.layer,t.geometry)})),u}},i.prototype.forEachLayerAtPixel=function(n,i,r,e,o){return t()},i.prototype.hasFeatureAtCoordinate=function(t,n,i,r,e,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,i,r,M,this,e,o)},i.prototype.getMap=function(){return this.Qt},i.prototype.renderFrame=function(n){t()},i.prototype.scheduleExpireIconCache=function(t){Po.canExpireCache()&&t.postRenderFunctions.push(rs)},i}(l),os=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ss=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=e,o}return os(n,t),n}(c),as="ol-hidden",us="ol-selectable",hs="ol-unselectable",cs="ol-unsupported",fs="ol-control",ls="ol-collapsed",vs=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),ds=["style","variant","weight","size","lineHeight","family"],ps=function(t){var n=t.match(vs);if(!n)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,e=ds.length;r=0;--o)r[o].renderDeclutter(t);mo(this.nn,this.rn),this.dispatchRenderEvent(Xo,t),this.en||(this.nn.style.display="",this.en=!0),this.scheduleExpireIconCache(t)}else this.en&&(this.nn.style.display="none",this.en=!1)},n.prototype.forEachLayerAtPixel=function(t,n,i,r,e){for(var o=n.viewState,s=n.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],h=u.layer;if(h.hasRenderer()&&ts(u,o)&&e(h)){var c=h.getRenderer().getDataAtPixel(t,n,i);if(c){var f=r(h,c);if(f)return f}}}},n}(es),Ds=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bs="layers",Us=function(t){function n(n){var i=this,r=n||{},e=k({},r);delete e.layers;var o=r.layers;return(i=t.call(this,e)||this).sn=[],i.an={},i.addChangeListener(Bs,i.hn),o?Array.isArray(o)?o=new ht(o.slice(),{unique:!0}):ct("function"==typeof o.getArray,43):o=new ht(void 0,{unique:!0}),i.setLayers(o),i}return Ds(n,t),n.prototype.cn=function(){this.changed()},n.prototype.hn=function(){this.sn.forEach(Z),this.sn.length=0;var t=this.getLayers();for(var n in this.sn.push(H(t,et,this.fn,this),H(t,ot,this.vn,this)),this.an)this.an[n].forEach(Z);T(this.an);for(var i=t.getArray(),r=0,o=i.length;rthis.bn||Math.abs(t.clientY-this.xn.clientY)>this.bn},n.prototype.disposeInternal=function(){this.kn&&(Z(this.kn),this.kn=null),this.nn.removeEventListener(J,this.An),this.Sn&&(Z(this.Sn),this.Sn=null),this.wn.forEach(Z),this.wn.length=0,this.nn=null,t.prototype.disposeInternal.call(this)},n}(P),na="postrender",ia="movestart",ra="moveend",ea="layergroup",oa="size",sa="target",aa="view",ua=1/0,ha=function(){function t(t,n){this.Ln=t,this.Fn=n,this.Gn=[],this.qn=[],this.Dn={}}return t.prototype.clear=function(){this.Gn.length=0,this.qn.length=0,T(this.Dn)},t.prototype.dequeue=function(){var t=this.Gn,n=this.qn,i=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.Bn(0));var r=this.Fn(i);return delete this.Dn[r],i},t.prototype.enqueue=function(t){ct(!(this.Fn(t)in this.Dn),31);var n=this.Ln(t);return n!=ua&&(this.Gn.push(t),this.qn.push(n),this.Dn[this.Fn(t)]=!0,this.Un(0,this.Gn.length-1),!0)},t.prototype.getCount=function(){return this.Gn.length},t.prototype.Wn=function(t){return 2*t+1},t.prototype.Vn=function(t){return 2*t+2},t.prototype.Jn=function(t){return t-1>>1},t.prototype.Xn=function(){var t;for(t=(this.Gn.length>>1)-1;t>=0;t--)this.Bn(t)},t.prototype.isEmpty=function(){return 0===this.Gn.length},t.prototype.isKeyQueued=function(t){return t in this.Dn},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Fn(t))},t.prototype.Bn=function(t){for(var n=this.Gn,i=this.qn,r=n.length,e=n[t],o=i[t],s=t;t>1;){var a=this.Wn(t),u=this.Vn(t),h=ut;){var s=this.Jn(n);if(!(r[s]>o))break;i[n]=i[s],r[n]=r[s],n=s}i[n]=e,r[n]=o},t.prototype.reprioritize=function(){var t,n,i,r=this.Ln,e=this.Gn,o=this.qn,s=0,a=e.length;for(n=0;n0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==Ke||r in this.$n||(this.$n[r]=!0,++this.Zn,++e,i.load())},n}(ha);function la(t,n,i,r,e){if(!t||!(i in t.wantedTiles))return ua;if(!t.wantedTiles[i][n.getKey()])return ua;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(e)+Math.sqrt(s*s+a*a)/e}var va=0,da=1,pa="center",ma="resolution",ya="rotation",ga=256;function wa(t,n,i){return function(r,e,o,s,a){if(r){var u=n?0:o[0]*e,h=n?0:o[1]*e,c=a?a[0]:0,f=a?a[1]:0,l=t[0]+u/2+c,v=t[2]-u/2+c,d=t[1]+h/2+f,p=t[3]-h/2+f;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var m=Vn(r[0],l,v),y=Vn(r[1],d,p),g=30*e;return s&&i&&(m+=-g*Math.log(1+Math.max(0,l-r[0])/g)+g*Math.log(1+Math.max(0,r[0]-v)/g),y+=-g*Math.log(1+Math.max(0,d-r[1])/g)+g*Math.log(1+Math.max(0,r[1]-p)/g)),[m,y]}}}function ba(t){return t}function xa(t,n,i,r){var e=Rn(n)/i[0],o=Pn(n)/i[1];return r?Math.min(t,Math.max(e,o)):Math.min(t,Math.min(e,o))}function ja(t,n,i){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Vn(r,i/2,2*n)}function Ma(t,n,i,r){return function(e,o,s,a){if(void 0!==e){var u=t[0],h=t[t.length-1],c=i?xa(u,i,s,r):u;if(a)return void 0===n||n?ja(e,c,h):Vn(e,h,c);var f=Math.min(c,e),l=Math.floor(m(t,f,o));return t[l]>c&&l1&&"function"==typeof arguments[i-1]&&(n=arguments[i-1],--i),!this.isDef()){var r=arguments[i-1];return r.center&&this.setCenterInternal(r.center),void 0!==r.zoom&&this.setZoom(r.zoom),void 0!==r.rotation&&this.setRotation(r.rotation),void(n&&Ca(n,!0))}for(var e=Date.now(),o=this.ri.slice(),s=this.ei,a=this.oi,u=[],h=0;h0},n.prototype.getInteracting=function(){return this.Kn[da]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(va,-this.Kn[va]);for(var n=0,i=this.Qn.length;n=0;--i){for(var r=this.Qn[i],e=!0,o=0,s=r.length;o0?u/a.duration:1;h>=1?(a.complete=!0,h=1):e=!1;var c=a.easing(h);if(a.sourceCenter){var f=a.sourceCenter[0],l=a.sourceCenter[1],v=f+c*(a.targetCenter[0]-f),d=l+c*(a.targetCenter[1]-l);this.ri=[v,d]}if(a.sourceResolution&&a.targetResolution){var p=1===c?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){var m=this.wi(this.getRotation()),y=this.di.resolution(p,0,m,!0);this.ri=this.calculateCenterZoom(y,a.anchor)}this.ei=p,this.bi(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===c?Qn(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){var w=this.di.rotation(g,!0);this.ri=this.calculateCenterRotate(w,a.anchor)}this.oi=g}if(this.bi(!0),n=!0,!a.complete)break}}if(e){this.Qn[i]=null,this.setHint(va,-1);var b=r[0].callback;b&&Ca(b,!0)}}this.Qn=this.Qn.filter(Boolean),n&&void 0===this.ti&&(this.ti=requestAnimationFrame(this.gi.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var i,r=this.getCenterInternal();return void 0!==r&&(Fi(i=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Pi(i,n)),i},n.prototype.calculateCenterZoom=function(t,n){var i,r=this.getCenterInternal(),e=this.getResolution();void 0!==r&&void 0!==e&&(i=[n[0]-t*(n[0]-r[0])/e,n[1]-t*(n[1]-r[1])/e]);return i},n.prototype.wi=function(t){var n=this.ii;if(t){var i=n[0],r=n[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.ii=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?fr(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(pa)},n.prototype.getConstraints=function(){return this.di},n.prototype.getConstrainResolution=function(){return this.mi.constrainResolution},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.Kn[0],t[1]=this.Kn[1],t):this.Kn.slice()},n.prototype.calculateExtent=function(t){return vr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.xi(),i=this.getCenterInternal();ct(i,1);var r=this.getResolution();ct(void 0!==r,2);var e=this.getRotation();return ct(void 0!==e,3),Cn(i,r,e,n)},n.prototype.getMaxResolution=function(){return this.ui},n.prototype.getMinResolution=function(){return this.hi},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.hi)},n.prototype.setMaxZoom=function(t){this.ai(this.yi({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.ui)},n.prototype.setMinZoom=function(t){this.ai(this.yi({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.ai(this.yi({constrainResolution:t}))},n.prototype.getProjection=function(){return this.ni},n.prototype.getResolution=function(){return this.get(ma)},n.prototype.getResolutions=function(){return this.fi},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(dr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var i=n||this.xi(),r=Rn(t)/i[0],e=Pn(t)/i[1];return Math.max(r,e)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,i=this.getConstrainedResolution(this.ui),r=this.hi,e=Math.log(i/r)/Math.log(n);return function(t){return i/Math.pow(n,t*e)}},n.prototype.getRotation=function(){return this.get(ya)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),i=this.getConstrainedResolution(this.ui),r=this.hi,e=Math.log(i/r)/n;return function(t){return Math.log(i/t)/n/e}},n.prototype.xi=function(t){var n=this.wi(t),i=this.li;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),e=this.li;if(e){var o=this.xi();r=Ra(r,this.wi(),[o[0]/2+e[3],o[1]/2+e[0]],n,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,rotation:i,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,i,r=this.vi||0;if(this.fi){var e=m(this.fi,t,1);r=e,n=this.fi[e],i=e==this.fi.length-1?2:n/this.fi[e+1]}else n=this.ui,i=this.ci;return r+Math.log(n/t)/Math.log(i)},n.prototype.getResolutionForZoom=function(t){if(this.fi){if(this.fi.length<=1)return 0;var n=Vn(Math.floor(t),0,this.fi.length-2),i=this.fi[n]/this.fi[n+1];return this.fi[n]/Math.pow(i,Vn(t-n,0,1))}return this.ui/Math.pow(this.ci,t-this.vi)},n.prototype.fit=function(t,n){var i;if(ct(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))ct(!Fn(t),25),i=Se(r=dr(t,this.getProjection()));else if(t.getType()===gt.CIRCLE){var r;(i=Se(r=dr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),An(r))}else{var e=cr();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),e=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,h=-1/0,c=0,f=e.length;c0&&t[1]>0}function qa(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*n+.5|0,i[1]=t[1]*n+.5|0,i}function Da(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var Ba=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Ua=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=function(t){var n=null;void 0!==t.keyboardEventTarget&&(n="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,e,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Us({layers:t.layers});o[ea]=s,o[sa]=t.target,o[aa]=void 0!==t.view?t.view:new La,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ht(t.controls.slice()):(ct("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new ht(t.interactions.slice()):(ct("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?e=new ht(t.overlays.slice()):(ct("function"==typeof t.overlays.getArray,49),e=t.overlays):e=new ht;return{controls:i,interactions:r,keyboardEventTarget:n,overlays:e,values:o}}(n);return i.ji=i.handleBrowserEvent.bind(i),i.Mi=void 0!==n.maxTilesLoading?n.maxTilesLoading:16,i.bt=void 0!==n.pixelRatio?n.pixelRatio:Tt,i.Si,i._i,i.Oi=function(){this._i=void 0,this.ki(Date.now())}.bind(i),i.Ti=[1,0,0,1,0,0],i.Ai=[1,0,0,1,0,0],i.Ei=0,i.Ci=null,i.Pi=null,i.Ni=null,i.zi=null,i.Ii=null,i.Ri=document.createElement("div"),i.Ri.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.Ri.style.position="relative",i.Ri.style.overflow="hidden",i.Ri.style.width="100%",i.Ri.style.height="100%",i.Li=document.createElement("div"),i.Li.style.position="absolute",i.Li.style.zIndex="0",i.Li.style.width="100%",i.Li.style.height="100%",i.Li.style.pointerEvents="none",i.Li.className="ol-overlaycontainer",i.Ri.appendChild(i.Li),i.Fi=document.createElement("div"),i.Fi.style.position="absolute",i.Fi.style.zIndex="0",i.Fi.style.width="100%",i.Fi.style.height="100%",i.Fi.style.pointerEvents="none",i.Fi.className="ol-overlaycontainer-stopevent",i.Ri.appendChild(i.Fi),i.Gi=null,i.bn=n.moveTolerance,i.qi=r.keyboardEventTarget,i.Di=null,i.controls=r.controls||new ht,i.interactions=r.interactions||new ht,i.Bi=r.overlays,i.Ui={},i.Zt=null,i.Wi,i.Vi=[],i.Ji=new fa(i.getTilePriority.bind(i),i.Xi.bind(i)),i.addChangeListener(ea,i.Hi),i.addChangeListener(aa,i.Yi),i.addChangeListener(oa,i.Zi),i.addChangeListener(sa,i.$i),i.setProperties(r.values),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.controls.addEventListener(et,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ot,function(t){t.element.setMap(null)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.addEventListener(et,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ot,function(t){t.element.setMap(null)}.bind(i)),i.Bi.forEach(i.Ki.bind(i)),i.Bi.addEventListener(et,function(t){this.Ki(t.element)}.bind(i)),i.Bi.addEventListener(ot,function(t){var n=t.element.getId();void 0!==n&&delete this.Ui[n.toString()],t.element.setMap(null)}.bind(i)),i}return Ba(n,t),n.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},n.prototype.addControl=function(t){this.getControls().push(t)},n.prototype.addInteraction=function(t){this.getInteractions().push(t)},n.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},n.prototype.addOverlay=function(t){this.getOverlays().push(t)},n.prototype.Ki=function(t){var n=t.getId();void 0!==n&&(this.Ui[n.toString()]=t),t.setMap(this)},n.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},n.prototype.forEachFeatureAtPixel=function(t,n,i){if(this.Ci){var r=this.getCoordinateFromPixelInternal(t),e=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:M,s=!1!==i.checkWrapped;return this.Zt.forEachFeatureAtCoordinate(r,this.Ci,e,s,n,null,o,null)}},n.prototype.getFeaturesAtPixel=function(t,n){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),n),i},n.prototype.forEachLayerAtPixel=function(t,n,i){if(this.Ci){var r=i||{},e=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||M;return this.Zt.forEachLayerAtPixel(t,this.Ci,e,n,o)}},n.prototype.hasFeatureAtPixel=function(t,n){if(!this.Ci)return!1;var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).layerFilter?n.layerFilter:M,e=void 0!==n.hitTolerance?n.hitTolerance:0,o=!1!==n.checkWrapped;return this.Zt.hasFeatureAtCoordinate(i,this.Ci,e,o,r,null)},n.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},n.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},n.prototype.getEventPixel=function(t){var n=this.Ri.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-n.left,i.clientY-n.top]},n.prototype.getTarget=function(){return this.get(sa)},n.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},n.prototype.getCoordinateFromPixel=function(t){return fr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},n.prototype.getCoordinateFromPixelInternal=function(t){var n=this.Ci;return n?Ft(n.pixelToCoordinateTransform,t.slice()):null},n.prototype.getControls=function(){return this.controls},n.prototype.getOverlays=function(){return this.Bi},n.prototype.getOverlayById=function(t){var n=this.Ui[t.toString()];return void 0!==n?n:null},n.prototype.getInteractions=function(){return this.interactions},n.prototype.getLayerGroup=function(){return this.get(ea)},n.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},n.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),n=0,i=t.length;n=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.Ci,n=this.Ji;if(!n.isEmpty()){var i=this.Mi,r=i;if(t){var e=t.viewHints;if(e[va]||e[da]){var o=Date.now()-t.time>8;i=o?0:8,r=o?0:2}}n.getTilesLoading()0;if(this.en!=i&&(this.element.style.display=i?"":"none",this.en=i),!b(n,this.vr)){po(this.ir);for(var r=0,e=n.length;r0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.gr,easing:eo}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var i=n.viewState.rotation;if(i!=this.br){var r="rotate("+i+"rad)";if(this.wr){var e=this.element.classList.contains(as);e||0!==i?e&&0!==i&&this.element.classList.remove(as):this.element.classList.add(as)}this.hr.style.transform=r}this.br=i}},n}(Va),Za=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$a=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var e=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:e+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:e+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"−",c=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",f=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=c,l.appendChild("string"==typeof u?document.createTextNode(u):u),l.addEventListener(L,i.lr.bind(i,o),!1);var v=document.createElement("button");v.className=a,v.setAttribute("type","button"),v.title=f,v.appendChild("string"==typeof h?document.createTextNode(h):h),v.addEventListener(L,i.lr.bind(i,-o),!1);var d=e+" "+"ol-unselectable "+fs,p=i.element;return p.className=d,p.appendChild(l),p.appendChild(v),i.gr=void 0!==r.duration?r.duration:250,i}return Za(n,t),n.prototype.lr=function(t,n){n.preventDefault(),this.Mr(t)},n.prototype.Mr=function(t){var n=this.getMap().getView();if(n){var i=n.getZoom();if(void 0!==i){var r=n.getConstrainedZoom(i+t);this.gr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.gr,easing:eo})):n.setZoom(r)}}},n}(Va);function Ka(t){var n=t||{},i=new ht;return(void 0===n.zoom||n.zoom)&&i.push(new $a(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&i.push(new Ya(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&i.push(new Xa(n.attributionOptions)),i}var Qa="active",tu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function nu(t,n,i){var r=t.getCenterInternal();if(r){var e=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==i?i:250,easing:so,center:t.getConstrainedCenter(e)})}}function iu(t,n,i,r){var e=t.getZoom();if(void 0!==e){var o=t.getConstrainedZoom(e+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==r?r:250,easing:eo})}}var ru=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,n&&n.handleEvent&&(i.handleEvent=n.handleEvent),i.Qt=null,i.setActive(!0),i}return tu(n,t),n.prototype.getActive=function(){return this.get(Qa)},n.prototype.getMap=function(){return this.Qt},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(Qa,t)},n.prototype.setMap=function(t){this.Qt=t},n}(rt),eu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ou=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Sr=r.delta?r.delta:1,i.gr=void 0!==r.duration?r.duration:250,i}return eu(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==Hs.DBLCLICK){var i=t.originalEvent,r=t.map,e=t.coordinate,o=i.shiftKey?-this.Sr:this.Sr;iu(r.getView(),o,e,this.gr),i.preventDefault(),n=!0}return!n},n}(ru),su=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function au(t){for(var n=t.length,i=0,r=0,e=0;e0}}else if(t.type==Hs.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==Hs.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.kr=function(t){if(function(t){var n=t.type;return n===Hs.POINTERDOWN||n===Hs.POINTERDRAG||n===Hs.POINTERUP}(t)){var n=t.originalEvent,i=n.pointerId.toString();t.type==Hs.POINTERUP?delete this._r[i]:(t.type==Hs.POINTERDOWN||i in this._r)&&(this._r[i]=n),this.targetPointers=A(this._r)}},n}(ru);function hu(t){var n=arguments;return function(t){for(var i=!0,r=0,e=n.length;r0&&this.Cr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Tr&&this.Tr.begin(),this.Pr=this.targetPointers.length>1,!0}return!1},n}(uu),_u=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ou=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{stopDown:S})||this).Cr=r.condition?r.condition:fu,i.Nr=void 0,i.gr=void 0!==r.duration?r.duration:250,i}return _u(n,t),n.prototype.handleDragEvent=function(t){if(xu(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==Oa){var r=n.getSize(),e=t.pixel,o=Math.atan2(r[1]/2-e[1],e[0]-r[0]/2);if(void 0!==this.Nr){var s=o-this.Nr;i.adjustRotationInternal(-s)}this.Nr=o}}},n.prototype.handleUpEvent=function(t){return!xu(t)||(t.map.getView().endInteraction(this.gr),!1)},n.prototype.handleDownEvent=function(t){return!!xu(t)&&(!(!pu(t)||!this.Cr(t))&&(t.map.getView().beginInteraction(),this.Nr=void 0,!0))},n}(uu),ku=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tu=function(t){function n(n){var i=t.call(this)||this;return i.zr=null,i.nn=document.createElement("div"),i.nn.style.position="absolute",i.nn.style.pointerEvents="auto",i.nn.className="ol-box "+n,i.Qt=null,i.Ir=null,i.Rr=null,i}return ku(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.Lr=function(){var t=this.Ir,n=this.Rr,i="px",r=this.nn.style;r.left=Math.min(t[0],n[0])+i,r.top=Math.min(t[1],n[1])+i,r.width=Math.abs(n[0]-t[0])+i,r.height=Math.abs(n[1]-t[1])+i},n.prototype.setMap=function(t){if(this.Qt){this.Qt.getOverlayContainer().removeChild(this.nn);var n=this.nn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.Qt=t,this.Qt&&this.Qt.getOverlayContainer().appendChild(this.nn)},n.prototype.setPixels=function(t,n){this.Ir=t,this.Rr=n,this.createOrUpdateGeometry(),this.Lr()},n.prototype.createOrUpdateGeometry=function(){var t=this.Ir,n=this.Rr,i=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.Qt.getCoordinateFromPixelInternal,this.Qt);i[4]=i[0].slice(),this.zr?this.zr.setCoordinates([i]):this.zr=new je([i])},n.prototype.getGeometry=function(){return this.zr},n}(l),Au=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eu="boxstart",Cu="boxdrag",Pu="boxend",Nu="boxcancel",zu=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.coordinate=i,e.mapBrowserEvent=r,e}return Au(n,t),n}(c),Iu=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.Fr=new Tu(r.className||"ol-dragbox"),i.Gr=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.Ir=null,i.Cr=r.condition?r.condition:pu,i.qr=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return Au(n,t),n.prototype.defaultBoxEndCondition=function(t,n,i){var r=i[0]-n[0],e=i[1]-n[1];return r*r+e*e>=this.Gr},n.prototype.getGeometry=function(){return this.Fr.getGeometry()},n.prototype.handleDragEvent=function(t){this.Fr.setPixels(this.Ir,t.pixel),this.dispatchEvent(new zu(Cu,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.Fr.setMap(null);var n=this.qr(t,this.Ir,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new zu(n?Pu:Nu,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Cr(t)&&(this.Ir=t.pixel,this.Fr.setMap(t.map),this.Fr.setPixels(this.Ir,this.Ir),this.dispatchEvent(new zu(Eu,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(uu),Ru=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lu=function(t){function n(n){var i=this,r=n||{},e=r.condition?r.condition:wu;return(i=t.call(this,{condition:e,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).gr=void 0!==r.duration?r.duration:200,i.Dr=void 0!==r.out&&r.out,i}return Ru(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),i=this.getGeometry();if(this.Dr){var r=n.rotatedExtentForGeometry(i),e=n.getResolutionForExtentInternal(r),o=n.getResolution()/e;(i=i.clone()).scale(o*o)}n.fitInternal(i,{duration:this.gr,easing:eo})},n}(Iu),Fu=37,Gu=38,qu=39,Du=40,Bu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uu=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Br=function(t){return gu(t)&&bu(t)},i.Cr=void 0!==r.condition?r.condition:i.Br,i.gr=void 0!==r.duration?r.duration:100,i.Ur=void 0!==r.pixelDelta?r.pixelDelta:128,i}return Bu(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B){var i=t.originalEvent,r=i.keyCode;if(this.Cr(t)&&(r==Du||r==Fu||r==qu||r==Gu)){var e=t.map.getView(),o=e.getResolution()*this.Ur,s=0,a=0;r==Du?a=-o:r==Fu?s=-o:r==qu?s=o:a=o;var u=[s,a];Fi(u,e.getRotation()),nu(e,u,this.gr),i.preventDefault(),n=!0}}return!n},n}(ru),Wu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vu=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Cr=r.condition?r.condition:bu,i.Sr=r.delta?r.delta:1,i.gr=void 0!==r.duration?r.duration:100,i}return Wu(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B||t.type==U){var i=t.originalEvent,r=i.charCode;if(this.Cr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var e=t.map,o=r=="+".charCodeAt(0)?this.Sr:-this.Sr;iu(e.getView(),o,void 0,this.gr),i.preventDefault(),n=!0}}return!n},n}(ru),Ju=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xu="trackpad",Hu="wheel",Yu=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,r)||this).Wr=0,i.Vr=0,i.rt=void 0!==r.maxDelta?r.maxDelta:1,i.gr=void 0!==r.duration?r.duration:250,i.Jr=void 0!==r.timeout?r.timeout:80,i.Xr=void 0===r.useAnchor||r.useAnchor,i.Hr=void 0!==r.constrainResolution&&r.constrainResolution;var e=r.condition?r.condition:du;return i.Cr=r.onFocusOnly?hu(vu,e):e,i.Yr=null,i.Zr=void 0,i.$r,i.Kr=void 0,i.Qr=400,i.te,i.ne=300,i}return Ju(n,t),n.prototype.ie=function(){this.te=void 0,this.getMap().getView().endInteraction(void 0,this.Vr?this.Vr>0?1:-1:0,this.Yr)},n.prototype.handleEvent=function(t){if(!this.Cr(t))return!0;if(t.type!==X)return!0;var n,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.Xr&&(this.Yr=t.coordinate),t.type==X&&(n=r.deltaY,St&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Tt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.Vr=n;var e=Date.now();void 0===this.Zr&&(this.Zr=e),(!this.Kr||e-this.Zr>this.Qr)&&(this.Kr=Math.abs(n)<4?Xu:Hu);var o=i.getView();if(this.Kr===Xu&&!o.getConstrainResolution()&&!this.Hr)return this.te?clearTimeout(this.te):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.te=setTimeout(this.ie.bind(this),this.Jr),o.adjustZoom(-n/this.ne,this.Yr),this.Zr=e,!1;this.Wr+=n;var s=Math.max(this.Jr-(e-this.Zr),0);return clearTimeout(this.$r),this.$r=setTimeout(this.re.bind(this,i),s),!1},n.prototype.re=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var i=-Vn(this.Wr,-this.rt*this.ne,this.rt*this.ne)/this.ne;(n.getConstrainResolution()||this.Hr)&&(i=i?i>0?1:-1:0),iu(n,i,this.Yr,this.gr),this.Kr=void 0,this.Wr=0,this.Yr=null,this.Zr=void 0,this.$r=void 0},n.prototype.setMouseAnchor=function(t){this.Xr=t,t||(this.Yr=null)},n}(ru),Zu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$u=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=S),(i=t.call(this,e)||this).ee=null,i.Nr=void 0,i.oe=!1,i.se=0,i.ae=void 0!==r.threshold?r.threshold:.3,i.gr=void 0!==r.duration?r.duration:250,i}return Zu(n,t),n.prototype.handleDragEvent=function(t){var n=0,i=this.targetPointers[0],r=this.targetPointers[1],e=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.Nr){var o=e-this.Nr;this.se+=o,!this.oe&&Math.abs(this.se)>this.ae&&(this.oe=!0),n=o}this.Nr=e;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Oa){var u=s.getViewport().getBoundingClientRect(),h=au(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.ee=s.getCoordinateFromPixelInternal(h),this.oe&&(s.render(),a.adjustRotationInternal(n,this.ee))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.gr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.ee=null,this.Nr=void 0,this.oe=!1,this.se=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(uu),Ku=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qu=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=S),(i=t.call(this,e)||this).ee=null,i.gr=void 0!==r.duration?r.duration:400,i.ue=void 0,i.he=1,i}return Ku(n,t),n.prototype.handleDragEvent=function(t){var n=1,i=this.targetPointers[0],r=this.targetPointers[1],e=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(e*e+o*o);void 0!==this.ue&&(n=this.ue/s),this.ue=s;var a=t.map,u=a.getView();1!=n&&(this.he=n);var h=a.getViewport().getBoundingClientRect(),c=au(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.ee=a.getCoordinateFromPixelInternal(c),a.render(),u.adjustResolutionInternal(n,this.ee)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),i=this.he>1?1:-1;return n.endInteraction(this.gr,i),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.ee=null,this.ue=void 0,this.he=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(uu);function th(t){var n=t||{},i=new ht,r=new wo(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&i.push(new Ou),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&i.push(new ou({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&i.push(new Su({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&i.push(new $u),(void 0===n.pinchZoom||n.pinchZoom)&&i.push(new Qu({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(i.push(new Uu),i.push(new Vu({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&i.push(new Yu({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&i.push(new Lu({duration:n.zoomDuration})),i}var nh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ih=function(t){function n(n){return(n=k({},n)).controls||(n.controls=Ka()),n.interactions||(n.interactions=th({onFocusOnly:!0})),t.call(this,n)||this}return nh(n,t),n.prototype.createRenderer=function(){return new qs(this)},n}(Ua),rh="bottom-left",eh="bottom-center",oh="bottom-right",sh="center-left",ah="center-center",uh="center-right",hh="top-left",ch="top-center",fh="top-right",lh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vh="element",dh="map",ph="offset",mh="position",yh="positioning",gh=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.options=n,i.id=n.id,i.insertFirst=void 0===n.insertFirst||n.insertFirst,i.stopEvent=void 0===n.stopEvent||n.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!=typeof r&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),i.autoPan=r||!1,i.rendered={lt:"",visible:!0},i.mapPostrenderListenerKey=null,i.addChangeListener(vh,i.handleElementChanged),i.addChangeListener(dh,i.handleMapChanged),i.addChangeListener(ph,i.handleOffsetChanged),i.addChangeListener(mh,i.handlePositionChanged),i.addChangeListener(yh,i.handlePositioningChanged),void 0!==n.element&&i.setElement(n.element),i.setOffset(void 0!==n.offset?n.offset:[0,0]),i.setPositioning(void 0!==n.positioning?n.positioning:hh),void 0!==n.position&&i.setPosition(n.position),i}return lh(n,t),n.prototype.getElement=function(){return this.get(vh)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(dh)},n.prototype.getOffset=function(){return this.get(ph)},n.prototype.getPosition=function(){return this.get(mh)},n.prototype.getPositioning=function(){return this.get(yh)},n.prototype.handleElementChanged=function(){po(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(vo(this.element),Z(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=H(t,na,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(vh,t)},n.prototype.setMap=function(t){this.set(dh,t)},n.prototype.setOffset=function(t){this.set(ph,t)},n.prototype.setPosition=function(t){this.set(mh,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(mh)){var i=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),e=this.getRect(r,[co(r),fo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!hn(i,e)){var a=e[0]-i[0],u=i[2]-e[2],h=e[1]-i[1],c=i[3]-e[3],f=[0,0];if(a<0?f[0]=a-s:u<0&&(f[0]=Math.abs(u)+s),h<0?f[1]=h-s:c<0&&(f[1]=Math.abs(c)+s),0!==f[0]||0!==f[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+f[0],v[1]+f[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,e=i.top+window.pageYOffset;return[r,e,r+n[0],e+n[1]]},n.prototype.setPositioning=function(t){this.set(yh,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var i=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var i=this.element.style,r=this.getOffset(),e=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";e==oh||e==uh||e==fh?a="-100%":e!=eh&&e!=ah&&e!=ch||(a="-50%"),e==rh||e==eh||e==oh?u="-100%":e!=sh&&e!=ah&&e!=uh||(u="-50%");var h="translate("+a+", "+u+") translate("+o+", "+s+")";this.rendered.lt!=h&&(this.rendered.lt=h,i.transform=h,i.msTransform=h)},n.prototype.getOptions=function(){return this.options},n}(rt),wh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.ce=0,this.fe={},this.le=null,this.ve=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.ce=0,this.fe={},this.le=null,this.ve=null},t.prototype.containsKey=function(t){return this.fe.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.le;n;)t(n.de,n.pe,this),n=n.newer},t.prototype.get=function(t,n){var i=this.fe[t];return ct(void 0!==i,15),i===this.ve||(i===this.le?(this.le=this.le.newer,this.le.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.ve,this.ve.newer=i,this.ve=i),i.de},t.prototype.remove=function(t){var n=this.fe[t];return ct(void 0!==n,15),n===this.ve?(this.ve=n.older,this.ve&&(this.ve.newer=null)):n===this.le?(this.le=n.newer,this.le&&(this.le.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.fe[t],--this.ce,n.de},t.prototype.getCount=function(){return this.ce},t.prototype.getKeys=function(){var t,n=new Array(this.ce),i=0;for(t=this.ve;t;t=t.older)n[i++]=t.pe;return n},t.prototype.getValues=function(){var t,n=new Array(this.ce),i=0;for(t=this.ve;t;t=t.older)n[i++]=t.de;return n},t.prototype.peekLast=function(){return this.le.de},t.prototype.peekLastKey=function(){return this.le.pe},t.prototype.peekFirstKey=function(){return this.ve.pe},t.prototype.pop=function(){var t=this.le;return delete this.fe[t.pe],t.newer&&(t.newer.older=null),this.le=t.newer,this.le||(this.ve=null),--this.ce,t.de},t.prototype.replace=function(t,n){this.get(t),this.fe[t].de=n},t.prototype.set=function(t,n){ct(!(t in this.fe),16);var i={pe:t,newer:null,older:this.ve,de:n};this.ve?this.ve.newer=i:this.le=i,this.ve=i,this.fe[t]=i,++this.ce},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function bh(t,n,i,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=i,r):[t,n,i]}function xh(t,n,i){return t+"/"+n+"/"+i}function jh(t){return xh(t[0],t[1],t[2])}function Mh(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return xh(n[0],n[1],n[2])}function Sh(t){return t.split("/").map(Number)}function _h(t){return(t[1]<i||i>n.getMaxZoom())return!1;var o=n.getFullTileRange(i);return!o||o.containsXY(r,e)}var kh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return kh(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Sh(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(jh(n.tileCoord)),n.release())}.bind(this))}},n}(wh),Ah=function(){function t(t,n,i,r){this.minX=t,this.maxX=n,this.minY=i,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Eh(t,n,i,r,e){return void 0!==e?(e.minX=t,e.maxX=n,e.minY=i,e.maxY=r,e):new Ah(t,n,i,r)}var Ch=Ah,Ph=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nh=[],zh=function(t){function n(n,i,r,e){var o=t.call(this,n,i,{transition:0})||this;return o.me={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.ye={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=e.bind(void 0,o),o.wrappedTileCoord=r,o}return Ph(n,t),n.prototype.getContext=function(t){var n=e(t);return n in this.me||(this.me[n]=ho(1,1,Nh)),this.me[n]},n.prototype.hasContext=function(t){return e(t)in this.me},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=e(t);return n in this.ye||(this.ye[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.ye[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.me)Nh.push(this.me[n].canvas),delete this.me[n];t.prototype.release.call(this)},n}(uo),Ih=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rh=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i,s)||this;return a.extent=null,a.ge=e,a.we=null,a.Tt,a.projection=null,a.resolution,a.It=o,a.be=r,a.key=r,a}return Ih(n,t),n.prototype.getFormat=function(){return this.ge},n.prototype.getFeatures=function(){return this.we},n.prototype.load=function(){this.state==Ke&&(this.setState(Qe),this.It(this,this.be),this.Tt&&this.Tt(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(no)},n.prototype.setFeatures=function(t){this.we=t,this.setState(to)},n.prototype.setLoader=function(t){this.Tt=t},n}(uo);function Lh(t){return Array.isArray(t)?ko(t):t}var Fh="arraybuffer",Gh="json",qh="text",Dh="xml",Bh=!1;function Uh(t,n,i,r,e,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,r,e):t,!0),n.getType()==Fh&&(a.responseType="arraybuffer"),a.withCredentials=Bh,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=n.getType(),u=void 0;r==Gh||r==qh?u=a.responseText:r==Dh?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==Fh&&(u=a.response),u?o(n.readFeatures(u,{extent:i,featureProjection:e}),n.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function Wh(t,n){return function(i,r,e,o,s){var a=this;Uh(t,n,i,r,e,(function(t,n){a.addFeatures(t),void 0!==o&&o(t)}),s||_)}}function Vh(t,n){return[[-1/0,-1/0,1/0,1/0]]}function Jh(t,n,i,r){var o=document.createElement("script"),s="olc_"+e(n);function a(){delete window[s],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var u=setTimeout((function(){a(),i&&i()}),1e4);window[s]=function(t){clearTimeout(u),a(),n(t)},document.getElementsByTagName("head")[0].appendChild(o)}var Xh=function(){function t(){}return t.prototype.drawCustom=function(t,n,i){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),Hh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yh=function(t){function n(n,i,r,e,o,s,a){var u=t.call(this)||this;return u.me=n,u.bt=i,u.B=r,u.lt=e,u.xe=o,u.je=s,u.Me=a,u.Se=null,u._e=null,u.Oe=null,u.ke=null,u.Te=null,u.jt=null,u.Ae=0,u.Ee=0,u.Ce=0,u.Pe=0,u.Ne=0,u.ze=0,u.Ie=!1,u.Re=0,u.Le=[0,0],u.Fe=0,u.Ge="",u.qe=0,u.De=0,u.Be=!1,u.Ue=0,u.We=[0,0],u.Ve=null,u.Je=null,u.Xe=null,u.He=[],u.Ye=[1,0,0,1,0,0],u}return Hh(n,t),n.prototype.Ze=function(t,n,i,r){if(this.jt){var e=yr(t,n,i,r,this.lt,this.He),o=this.me,s=this.Ye,a=o.globalAlpha;1!=this.Pe&&(o.globalAlpha=a*this.Pe);var u=this.Re;this.Ie&&(u+=this.xe);for(var h=0,c=e.length;h2||Math.abs(t[4*n+3]-191.25)>2}function dc(t,n,i,r){var e=sr(i,n,t),o=$i(n,r,i),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||un(u,e)){var h=$i(t,o,e)/o;isFinite(h)&&h>0&&(o/=h)}return o}function pc(t,n,i,r){var e=An(i),o=dc(t,n,e,r);return(!isFinite(o)||o<=0)&&_n(i,(function(i){return o=dc(t,n,i,r),isFinite(o)&&o>0})),o}function mc(t,n,i,r,e,o,s,a,u,h,c,f){var l=ho(Math.round(i*t),Math.round(i*n));if(k(l,f),0===u.length)return l.canvas;function v(t){return Math.round(t*i)/i}l.scale(i,i),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,n,i){wn(d,t.extent)}));var p=Rn(d),m=Pn(d),y=ho(Math.round(i*p/r),Math.round(i*m/r));k(y,f);var g=i/r;u.forEach((function(t,n,i){var r=t.extent[0]-d[0],e=-(t.extent[3]-d[3]),o=Rn(t.extent),s=Pn(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,r*g,e*g,o*g,s*g)}));var w=zn(s);return a.getTriangles().forEach((function(t,n,e){var s=t.source,a=t.target,u=s[0][0],h=s[0][1],c=s[1][0],p=s[1][1],m=s[2][0],g=s[2][1],b=v((a[0][0]-w[0])/o),x=v(-(a[0][1]-w[1])/o),j=v((a[1][0]-w[0])/o),M=v(-(a[1][1]-w[1])/o),S=v((a[2][0]-w[0])/o),_=v(-(a[2][1]-w[1])/o),O=u,k=h;u=0,h=0;var T=Zn([[c-=O,p-=k,0,0,j-b],[m-=O,g-=k,0,0,S-b],[0,0,c,p,M-x],[0,0,m,g,_-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===hc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",lc(t,4,5,4,0),lc(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;hc=vc(n,0)||vc(n,4)||vc(n,8)}return hc}()||f===fc){l.moveTo(j,M);for(var A=b-j,E=x-M,C=0;C<4;C++)l.lineTo(j+v((C+1)*A/4),M+v(C*E/3)),3!=C&&l.lineTo(j+v((C+1)*A/4),M+v((C+1)*E/3));l.lineTo(S,_)}else l.moveTo(j,M),l.lineTo(b,x),l.lineTo(S,_);l.clip(),l.transform(T[0],T[2],T[1],T[3],b,x),l.translate(d[0]-O,d[3]-k),l.scale(r/i,-r/i),l.drawImage(y.canvas,0,0),l.restore()}})),c&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t,n,i){var r=t.target,e=(r[0][0]-w[0])/o,s=-(r[0][1]-w[1])/o,a=(r[1][0]-w[0])/o,u=-(r[1][1]-w[1])/o,h=(r[2][0]-w[0])/o,c=-(r[2][1]-w[1])/o;l.beginPath(),l.moveTo(a,u),l.lineTo(e,s),l.lineTo(h,c),l.closePath(),l.stroke()})),l.restore()),l.canvas}var yc=[0,0,0],gc=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.fi=t.resolutions,ct(j(this.fi,(function(t,n){return n-t}),!0),17),!t.origins)for(var i=0,r=this.fi.length-1;i=this.minZoom;){if(n(a,2===this.ci?Eh(e=Math.floor(e/2),e,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.B},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.eo?this.eo:this.oo[t]},t.prototype.getResolution=function(t){return this.fi[t]},t.prototype.getResolutions=function(){return this.fi},t.prototype.getTileCoordChildTileRange=function(t,n,i){if(t[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),h=e+1,c=new Array(h),f=0;f=0;o--)this.Io[o].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.Ao),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,i){var r=this.getGL(),e=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,e[0],e[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Ao),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var i=this.getGL(),r=i.UNSIGNED_INT,e=n-t,o=4*t;i.drawElements(i.TRIANGLES,e,r,o)},n.prototype.finalizeDraw=function(t){for(var n=0;nthis.Do[0]||n>=this.Do[1])return Pf[0]=0,Pf[1]=0,Pf[2]=0,Pf[3]=0,Pf;this.readAll();var i=Math.floor(t)+(this.Do[1]-Math.floor(n)-1)*this.Do[0];return Pf[0]=this.Bo[4*i],Pf[1]=this.Bo[4*i+1],Pf[2]=this.Bo[4*i+2],Pf[3]=this.Bo[4*i+3],Pf},t.prototype.getTexture=function(){return this.Go},t.prototype.getFramebuffer=function(){return this.qo},t.prototype.Wo=function(){var t=this.Do,n=this.Fo.getGL();this.Go=this.Fo.createTexture(t,null,this.Go),n.bindFramebuffer(n.FRAMEBUFFER,this.qo),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.Go,0),this.Bo=new Uint8Array(t[0]*t[1]*4)},t}(),zf=1,If=2,Rf=4,Lf=8,Ff=16,Gf=31,qf={};function Df(t){if("number"==typeof t)return zf;if("boolean"==typeof t)return Lf;if("string"==typeof t)return To(t)?Rf|If:If;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?Rf|Ff:Ff;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(n));var i=qf[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: "+JSON.stringify(n));return i.getReturnType(n.slice(1))}function Bf(t){return Math.log2(t)%1==0}function Uf(t){var n=t.toString();return-1===n.indexOf(".")?n+".0":n}function Wf(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(Uf).join(", ")+")"}function Vf(t){var n=_o(t).slice();return n.length<4&&n.push(1),Wf(n.map((function(t,n){return n<3?t/255:t})))}function Jf(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function Xf(t,n){return Uf(Jf(t,n))}function Hf(t,n,i){if(Array.isArray(n)&&"string"==typeof n[0]){var r=qf[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(n));return r.toGlsl(t,n.slice(1),i)}var e=Df(n);if((e&zf)>0)return Uf(n);if((e&Lf)>0)return n.toString();if((e&If)>0&&(void 0===i||i==If))return Xf(t,n.toString());if((e&Rf)>0&&(void 0===i||i==Rf))return Vf(n);if((e&Ff)>0)return Wf(n);throw new Error("Unexpected expression "+n+" (expected type "+i+")")}function Yf(t){if(!(Df(t)&zf))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function Zf(t){for(var n=0;nn)throw new Error("At most "+n+" arguments were expected, got "+t.length+" instead")}function il(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function rl(t,n){if(!Bf(n))throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t))}function el(t){return"u_var_"+t}function ol(t){return{getReturnType:function(t){return Lf},toGlsl:function(n,i){Qf(i,2);for(var r=Gf,e=0;e"]={getReturnType:function(t){return Lf},toGlsl:function(t,n){return Qf(n,2),Zf(n),"("+Hf(t,n[0])+" > "+Hf(t,n[1])+")"}},qf[">="]={getReturnType:function(t){return Lf},toGlsl:function(t,n){return Qf(n,2),Zf(n),"("+Hf(t,n[0])+" >= "+Hf(t,n[1])+")"}},qf["<"]={getReturnType:function(t){return Lf},toGlsl:function(t,n){return Qf(n,2),Zf(n),"("+Hf(t,n[0])+" < "+Hf(t,n[1])+")"}},qf["<="]={getReturnType:function(t){return Lf},toGlsl:function(t,n){return Qf(n,2),Zf(n),"("+Hf(t,n[0])+" <= "+Hf(t,n[1])+")"}},qf["=="]=ol("=="),qf["!="]=ol("!="),qf["!"]={getReturnType:function(t){return Lf},toGlsl:function(t,n){return Qf(n,1),Kf(n[0]),"(!"+Hf(t,n[0])+")"}},qf.all=sl("&&"),qf.any=sl("||"),qf.between={getReturnType:function(t){return Lf},toGlsl:function(t,n){Qf(n,3),Zf(n);var i=Hf(t,n[1]),r=Hf(t,n[2]),e=Hf(t,n[0]);return"("+e+" >= "+i+" && "+e+" <= "+r+")"}},qf.array={getReturnType:function(t){return Ff},toGlsl:function(t,n){tl(n,2),nl(n,4),Zf(n);var i=n.map((function(n){return Hf(t,n,zf)}));return"vec"+n.length+"("+i.join(", ")+")"}},qf.color={getReturnType:function(t){return Rf},toGlsl:function(t,n){tl(n,3),nl(n,4),Zf(n);var i=n;3===n.length&&i.push(1);var r=n.map((function(n,i){return Hf(t,n,zf)+(i<3?" / 255.0":"")}));return"vec"+n.length+"("+r.join(", ")+")"}},qf.interpolate={getReturnType:function(t){for(var n=Rf|zf,i=3;i=1;u-=2){a="("+o+" == "+Hf(t,n[u])+" ? "+Hf(t,n[u+1],e)+" : "+(a||s)+")"}return a}},qf.case={getReturnType:function(t){for(var n=Gf,i=1;i=0;o-=2){a="("+Hf(t,n[o])+" ? "+Hf(t,n[o+1],e)+" : "+(a||s)+")"}return a}};var al=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,i){return this.varyings.push({name:t,type:n,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,r=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+i.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+n+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+n+"\n}"},t}();function ul(t){var n=t.symbol,i=void 0!==n.size?n.size:1,r=n.color||"white",e=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,u={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},h=Hf(u,i,Ff|zf),c=Hf(u,o,Ff),f=Hf(u,e,Ff),l=Hf(u,a,zf),v={inFragmentShader:!0,variables:u.variables,attributes:[],stringLiteralsMap:u.stringLiteralsMap},d=Hf(v,r,Rf),p=Hf(v,s,zf),m="1.0",y="vec2("+Hf(v,i,Ff|zf)+").x";switch(n.symbolType){case"square":case"image":break;case"circle":m="(1.0-smoothstep(1.-4./"+y+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var g="(v_quadCoord*2.-1.)",w="(atan("+g+".x,"+g+".y))";m="(1.0-smoothstep(.5-3./"+y+",.5,cos(floor(.5+"+w+"/2.094395102)*2.094395102-"+w+")*length("+g+")))";break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var b=(new al).setSizeExpression("vec2("+h+")").setRotationExpression(l).setSymbolOffsetExpression(c).setTextureCoordinateExpression(f).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+p+" * "+m+")");if(t.filter){var x=Hf(v,t.filter,Lf);b.setFragmentDiscardExpression("!"+x)}var j={};if(v.variables.forEach((function(n){var i=el(n);b.addUniform("float "+i),j[i]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: "+n);var i=t.variables[n];return"string"==typeof i&&(i=Jf(u,i)),void 0!==i?i:-9999999}})),"image"===n.symbolType&&n.src){var M=new Image;M.src=n.src,b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),j.u_texture=M}return v.attributes.forEach((function(t){-1===u.attributes.indexOf(t)&&u.attributes.push(t),b.addVarying("v_"+t,"float","a_"+t)})),u.attributes.forEach((function(t){b.addAttribute("float a_"+t)})),{builder:b,attributes:u.attributes.map((function(t){return{name:t,callback:function(n,i){var r=i[t];return"string"==typeof r&&(r=Jf(u,r)),void 0!==r?r:-9999999}}})),uniforms:j}}var hl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cl=function(t){function n(n){var i=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return i.Vo=n.matrixIds,i}return hl(n,t),n.prototype.getMatrixId=function(t){return this.Vo[t]},n.prototype.getMatrixIds=function(){return this.Vo},n}(gc),fl=cl;function ll(t,n,i){var r=[],e=[],o=[],s=[],a=[],u=void 0!==i?i:[],h=Zi(t.SupportedCRS),c=h.getMetersPerUnit(),f="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(u.length>0)||w(u,(function(i){return n.Identifier==i.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===i.TileMatrix}))){e.push(n.Identifier);var i=28e-5*n.ScaleDenominator/c,h=n.TileWidth,l=n.TileHeight;f?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(i),s.push(h==l?h:[h,l]),a.push([n.MatrixWidth,n.MatrixHeight])}})),new cl({extent:n,origins:o,resolutions:r,matrixIds:e,tileSizes:s,sizes:a})}var vl=function(){function n(t){this.Jo=t.opacity,this.Xo=t.rotateWithView,this.br=t.rotation,this.Ho=t.scale,this.Yo=Da(t.scale),this.Zo=t.displacement}return n.prototype.clone=function(){var t=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},n.prototype.getOpacity=function(){return this.Jo},n.prototype.getRotateWithView=function(){return this.Xo},n.prototype.getRotation=function(){return this.br},n.prototype.getScale=function(){return this.Ho},n.prototype.getScaleArray=function(){return this.Yo},n.prototype.getDisplacement=function(){return this.Zo},n.prototype.getAnchor=function(){return t()},n.prototype.getImage=function(n){return t()},n.prototype.getHitDetectionImage=function(){return t()},n.prototype.getPixelRatio=function(t){return 1},n.prototype.getImageState=function(){return t()},n.prototype.getImageSize=function(){return t()},n.prototype.getOrigin=function(){return t()},n.prototype.getSize=function(){return t()},n.prototype.setOpacity=function(t){this.Jo=t},n.prototype.setRotateWithView=function(t){this.Xo=t},n.prototype.setRotation=function(t){this.br=t},n.prototype.setScale=function(t){this.Ho=t,this.Yo=Da(t)},n.prototype.listenImageChange=function(n){t()},n.prototype.load=function(){t()},n.prototype.unlistenImageChange=function(n){t()},n}(),dl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pl=function(t){function n(n){var i=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this).At=void 0,i.$o=null,i.Ko=void 0!==n.fill?n.fill:null,i.eo=[0,0],i.Gt=n.points,i.Qo=void 0!==n.radius?n.radius:n.radius1,i.ts=n.radius2,i.qt=void 0!==n.angle?n.angle:0,i.ns=void 0!==n.stroke?n.stroke:null,i.ee=null,i.Do=null,i.rs=null,i.render(),i}return dl(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},n.prototype.getAnchor=function(){return this.ee},n.prototype.getAngle=function(){return this.qt},n.prototype.getFill=function(){return this.Ko},n.prototype.getHitDetectionImage=function(){return this.$o||this.es(this.rs),this.$o},n.prototype.getImage=function(t){var n=this.At[t];if(!n){var i=this.rs,r=ho(i.size*t,i.size*t);this.os(i,r,t),n=r.canvas,this.At[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.Do},n.prototype.getImageState=function(){return We},n.prototype.getOrigin=function(){return this.eo},n.prototype.getPoints=function(){return this.Gt},n.prototype.getRadius=function(){return this.Qo},n.prototype.getRadius2=function(){return this.ts},n.prototype.getSize=function(){return this.Do},n.prototype.getStroke=function(){return this.ns},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.ss=function(t,n,i){if(0===n||this.Gt===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.Qo,e=void 0===this.ts?r:this.ts;if(r0,6);var l=void 0!==r.src?Be:We;return i.cs=void 0!==r.color?_o(r.color):null,i.Ms=Tl(h,f,c,i.zt,l,i.cs),i.Ss=void 0!==r.offset?r.offset:[0,0],i._s=void 0!==r.offsetOrigin?r.offsetOrigin:Ml,i.eo=null,i.Do=void 0!==r.size?r.size:null,i}return El(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.ee.slice(),anchorOrigin:this.ws,anchorXUnits:this.bs,anchorYUnits:this.xs,crossOrigin:this.zt,color:this.cs&&this.cs.slice?this.cs.slice():this.cs||void 0,src:this.getSrc(),offset:this.Ss.slice(),offsetOrigin:this._s,size:null!==this.Do?this.Do.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},n.prototype.getAnchor=function(){if(this.gs)return this.gs;var t=this.ee,n=this.getSize();if(this.bs==wl||this.xs==wl){if(!n)return null;t=this.ee.slice(),this.bs==wl&&(t[0]*=n[0]),this.xs==wl&&(t[1]*=n[1])}if(this.ws!=Ml){if(!n)return null;t===this.ee&&(t=this.ee.slice()),this.ws!=Sl&&this.ws!=jl||(t[0]=-t[0]+n[0]),this.ws!=xl&&this.ws!=jl||(t[1]=-t[1]+n[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.gs=t,this.gs},n.prototype.setAnchor=function(t){this.ee=t,this.gs=null},n.prototype.getColor=function(){return this.cs},n.prototype.getImage=function(t){return this.Ms.getImage(t)},n.prototype.getPixelRatio=function(t){return this.Ms.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.Ms.getSize()},n.prototype.getImageState=function(){return this.Ms.getImageState()},n.prototype.getHitDetectionImage=function(){return this.Ms.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this.eo)return this.eo;var t=this.Ss;if(this._s!=Ml){var n=this.getSize(),i=this.Ms.getSize();if(!n||!i)return null;t=t.slice(),this._s!=Sl&&this._s!=jl||(t[0]=i[0]-n[0]-t[0]),this._s!=xl&&this._s!=jl||(t[1]=i[1]-n[1]-t[1])}return this.eo=t,this.eo},n.prototype.getSrc=function(){return this.Ms.getSrc()},n.prototype.getSize=function(){return this.Do?this.Do:this.Ms.getSize()},n.prototype.listenImageChange=function(t){this.Ms.addEventListener(N,t)},n.prototype.load=function(){this.Ms.load()},n.prototype.unlistenImageChange=function(t){this.Ms.removeEventListener(N,t)},n}(vl),Pl=function(){function t(t){var n=t||{};this.cs=void 0!==n.color?n.color:null,this.Os=n.lineCap,this.ks=void 0!==n.lineDash?n.lineDash:null,this.Ts=n.lineDashOffset,this.As=n.lineJoin,this.Es=n.miterLimit,this.Cs=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.cs},t.prototype.getLineCap=function(){return this.Os},t.prototype.getLineDash=function(){return this.ks},t.prototype.getLineDashOffset=function(){return this.Ts},t.prototype.getLineJoin=function(){return this.As},t.prototype.getMiterLimit=function(){return this.Es},t.prototype.getWidth=function(){return this.Cs},t.prototype.setColor=function(t){this.cs=t},t.prototype.setLineCap=function(t){this.Os=t},t.prototype.setLineDash=function(t){this.ks=t},t.prototype.setLineDashOffset=function(t){this.Ts=t},t.prototype.setLineJoin=function(t){this.As=t},t.prototype.setMiterLimit=function(t){this.Es=t},t.prototype.setWidth=function(t){this.Cs=t},t}(),Nl=function(){function t(t){var n=t||{};this.zr=null,this.Ps=Fl,void 0!==n.geometry&&this.setGeometry(n.geometry),this.Ko=void 0!==n.fill?n.fill:null,this.jt=void 0!==n.image?n.image:null,this.Zt=void 0!==n.renderer?n.renderer:null,this.ns=void 0!==n.stroke?n.stroke:null,this.Ge=void 0!==n.text?n.text:null,this.Ns=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"==typeof n&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.Zt},t.prototype.setRenderer=function(t){this.Zt=t},t.prototype.getGeometry=function(){return this.zr},t.prototype.getGeometryFunction=function(){return this.Ps},t.prototype.getFill=function(){return this.Ko},t.prototype.setFill=function(t){this.Ko=t},t.prototype.getImage=function(){return this.jt},t.prototype.setImage=function(t){this.jt=t},t.prototype.getStroke=function(){return this.ns},t.prototype.setStroke=function(t){this.ns=t},t.prototype.getText=function(){return this.Ge},t.prototype.setText=function(t){this.Ge=t},t.prototype.getZIndex=function(){return this.Ns},t.prototype.setGeometry=function(t){"function"==typeof t?this.Ps=t:"string"==typeof t?this.Ps=function(n){return n.get(t)}:t?void 0!==t&&(this.Ps=function(){return t}):this.Ps=Fl,this.zr=t},t.prototype.setZIndex=function(t){this.Ns=t},t}();function zl(t){var n;if("function"==typeof t)n=t;else{var i;if(Array.isArray(t))i=t;else ct("function"==typeof t.getZIndex,41),i=[t];n=function(){return i}}return n}var Il=null;function Rl(t,n){if(!Il){var i=new gl({color:"rgba(255,255,255,0.4)"}),r=new Pl({color:"#3399CC",width:1.25});Il=[new Nl({image:new yl({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return Il}function Ll(){var t={},n=[255,255,255,1],i=[0,153,255,1];return t[gt.POLYGON]=[new Nl({fill:new gl({color:[255,255,255,.5]})})],t[gt.MULTI_POLYGON]=t[gt.POLYGON],t[gt.LINE_STRING]=[new Nl({stroke:new Pl({color:n,width:5})}),new Nl({stroke:new Pl({color:i,width:3})})],t[gt.MULTI_LINE_STRING]=t[gt.LINE_STRING],t[gt.CIRCLE]=t[gt.POLYGON].concat(t[gt.LINE_STRING]),t[gt.POINT]=[new Nl({image:new yl({radius:6,fill:new gl({color:i}),stroke:new Pl({color:n,width:1.5})}),zIndex:1/0})],t[gt.MULTI_POINT]=t[gt.POINT],t[gt.GEOMETRY_COLLECTION]=t[gt.POLYGON].concat(t[gt.LINE_STRING],t[gt.POINT]),t}function Fl(t){return t.getGeometry()}var Gl=Nl,ql="point",Dl="line",Bl=function(){function t(t){var n=t||{};this.zs=n.font,this.br=n.rotation,this.Xo=n.rotateWithView,this.Ho=n.scale,this.Yo=Da(void 0!==n.scale?n.scale:1),this.Ge=n.text,this.Is=n.textAlign,this.Rs=n.textBaseline,this.Ko=void 0!==n.fill?n.fill:new gl({color:"#333"}),this.Ls=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.Fs=void 0!==n.placement?n.placement:ql,this.Gs=!!n.overflow,this.ns=void 0!==n.stroke?n.stroke:null,this.qs=void 0!==n.offsetX?n.offsetX:0,this.Ds=void 0!==n.offsetY?n.offsetY:0,this.Bs=n.backgroundFill?n.backgroundFill:null,this.Us=n.backgroundStroke?n.backgroundStroke:null,this.li=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.Gs},t.prototype.getFont=function(){return this.zs},t.prototype.getMaxAngle=function(){return this.Ls},t.prototype.getPlacement=function(){return this.Fs},t.prototype.getOffsetX=function(){return this.qs},t.prototype.getOffsetY=function(){return this.Ds},t.prototype.getFill=function(){return this.Ko},t.prototype.getRotateWithView=function(){return this.Xo},t.prototype.getRotation=function(){return this.br},t.prototype.getScale=function(){return this.Ho},t.prototype.getScaleArray=function(){return this.Yo},t.prototype.getStroke=function(){return this.ns},t.prototype.getText=function(){return this.Ge},t.prototype.getTextAlign=function(){return this.Is},t.prototype.getTextBaseline=function(){return this.Rs},t.prototype.getBackgroundFill=function(){return this.Bs},t.prototype.getBackgroundStroke=function(){return this.Us},t.prototype.getPadding=function(){return this.li},t.prototype.setOverflow=function(t){this.Gs=t},t.prototype.setFont=function(t){this.zs=t},t.prototype.setMaxAngle=function(t){this.Ls=t},t.prototype.setOffsetX=function(t){this.qs=t},t.prototype.setOffsetY=function(t){this.Ds=t},t.prototype.setPlacement=function(t){this.Fs=t},t.prototype.setRotateWithView=function(t){this.Xo=t},t.prototype.setFill=function(t){this.Ko=t},t.prototype.setRotation=function(t){this.br=t},t.prototype.setScale=function(t){this.Ho=t,this.Yo=Da(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.ns=t},t.prototype.setText=function(t){this.Ge=t},t.prototype.setTextAlign=function(t){this.Is=t},t.prototype.setTextBaseline=function(t){this.Rs=t},t.prototype.setBackgroundFill=function(t){this.Bs=t},t.prototype.setBackgroundStroke=function(t){this.Us=t},t.prototype.setPadding=function(t){this.li=t},t}(),Ul=function(){function t(t){this.Ws,this.Vs,this.Js,this.Xs=void 0===t||t,this.Hs=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},i=this.Js;if(i){var r=i.next;n.prev=i,n.next=r,i.next=n,r&&(r.prev=n),i===this.Vs&&(this.Vs=n)}else this.Ws=n,this.Vs=n,this.Xs&&(n.next=n,n.prev=n);this.Js=n,this.Hs++},t.prototype.removeItem=function(){var t=this.Js;if(t){var n=t.next,i=t.prev;n&&(n.prev=i),i&&(i.next=n),this.Js=n||i,this.Ws===this.Vs?(this.Js=void 0,this.Ws=void 0,this.Vs=void 0):this.Ws===t?this.Ws=this.Js:this.Vs===t&&(this.Vs=i?this.Js.prev:this.Js),this.Hs--}},t.prototype.firstItem=function(){if(this.Js=this.Ws,this.Js)return this.Js.data},t.prototype.lastItem=function(){if(this.Js=this.Vs,this.Js)return this.Js.data},t.prototype.nextItem=function(){if(this.Js&&this.Js.next)return this.Js=this.Js.next,this.Js.data},t.prototype.getNextItem=function(){if(this.Js&&this.Js.next)return this.Js.next.data},t.prototype.prevItem=function(){if(this.Js&&this.Js.prev)return this.Js=this.Js.prev,this.Js.data},t.prototype.getPrevItem=function(){if(this.Js&&this.Js.prev)return this.Js.prev.data},t.prototype.getCurrItem=function(){if(this.Js)return this.Js.data},t.prototype.setFirstItem=function(){this.Xs&&this.Js&&(this.Ws=this.Js,this.Vs=this.Js.prev)},t.prototype.concat=function(t){if(t.Js){if(this.Js){var n=this.Js.next;this.Js.next=t.Ws,t.Ws.prev=this.Js,n.prev=t.Vs,t.Vs.next=n,this.Hs+=t.Hs}else this.Js=t.Js,this.Ws=t.Ws,this.Vs=t.Vs,this.Hs=t.Hs;t.Js=void 0,t.Ws=void 0,t.Vs=void 0,t.Hs=0}},t.prototype.getLength=function(){return this.Hs},t}(),Wl=i(582),Vl=function(){function t(t){this.Ys=new Wl(t),this.Zs={}}return t.prototype.insert=function(t,n){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.Ys.insert(i),this.Zs[e(n)]=i},t.prototype.load=function(t,n){for(var i=new Array(n.length),r=0,o=n.length;rthis.sa/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-y>this.sa/2&&(n[0][0]-=this.sa),n[1][0]-y>this.sa/2&&(n[1][0]-=this.sa),n[2][0]-y>this.sa/2&&(n[2][0]-=this.sa);var i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i.5&&c<1,v=!1;if(u>0){if(this.Qs.isGlobal()&&this.aa)v=Rn(en([t,n,i,r]))/this.aa>.25||v;!l&&this.Ks.isGlobal()&&c&&(v=c>.25||v)}if(!(!v&&this.na&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Ln(h,this.na)){var d=0;if(!(v||isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)v=!0;else if(1!=(d=(isFinite(e[0])&&isFinite(e[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!v){var p=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.ta(p),y=void 0;if(l)y=(Qn(e[0],f)+Qn(s[0],f))/2-Qn(m[0],f);else y=(e[0]+s[0])/2-m[0];var g=(e[1]+s[1])/2-m[1];v=y*y+g*g>this.ia}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var w=[(n[0]+i[0])/2,(n[1]+i[1])/2],b=this.ta(w),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.ta(x);this.ua(t,n,w,x,e,o,b,j,u-1),this.ua(x,w,i,r,j,b,s,a,u-1)}else{var M=[(t[0]+n[0])/2,(t[1]+n[1])/2],S=this.ta(M),_=[(i[0]+r[0])/2,(i[1]+r[1])/2],O=this.ta(_);this.ua(t,M,_,r,e,S,O,a,u-1),this.ua(M,n,i,_,S,o,s,O,u-1)}return}}if(l){if(!this.oa)return;this.ea=!0}0==(11&d)&&this.ha(t,i,r,e,s,a),0==(14&d)&&this.ha(t,i,n,e,s,o),d&&(0==(13&d)&&this.ha(n,r,t,o,a,e),0==(7&d)&&this.ha(n,r,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.ra.forEach((function(n,i,r){var e=n.source;bn(t,e[0]),bn(t,e[1]),bn(t,e[2])})),t},t.prototype.getTriangles=function(){return this.ra},t}(),Hl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yl=function(t){function n(n,i,r,e,o,s,a,u,h,c,f,l){var v=t.call(this,o,Ke)||this;v.ca=void 0!==f&&f,v.fa=l,v.bt=a,v.la=u,v.At=null,v.va=i,v.da=e,v.pa=s||o,v.ma=[],v.ya=null,v.ga=0;var d=e.getTileCoordExtent(v.pa),p=v.da.getExtent(),m=v.va.getExtent(),y=p?Nn(d,p):d;if(0===On(y))return v.state=io,v;var g=n.getExtent();g&&(m=m?Nn(m,g):g);var w=e.getResolution(v.pa[0]),b=pc(n,r,y,w);if(!isFinite(b)||b<=0)return v.state=io,v;var x=void 0!==c?c:.5;if(v.wa=new Xl(n,r,y,m,b*x,w),0===v.wa.getTriangles().length)return v.state=io,v;v.ga=i.getZForResolution(b);var j=v.wa.calculateSourceExtent();if(m&&(n.canWrapX()?(j[1]=Vn(j[1],m[1],m[3]),j[3]=Vn(j[3],m[1],m[3])):j=Nn(j,m)),On(j)){for(var M=i.getTileRangeForExtentAndZ(j,v.ga),S=M.minX;S<=M.maxX;S++)for(var _=M.minY;_<=M.maxY;_++){var O=h(v.ga,S,_,a);O&&v.ma.push(O)}0===v.ma.length&&(v.state=io)}else v.state=io;return v}return Hl(n,t),n.prototype.getImage=function(){return this.At},n.prototype.ba=function(){var t=[];if(this.ma.forEach(function(n,i,r){n&&n.getState()==to&&t.push({extent:this.va.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.ma.length=0,0===t.length)this.state=no;else{var n=this.pa[0],i=this.da.getTileSize(n),r="number"==typeof i?i:i[0],e="number"==typeof i?i:i[1],o=this.da.getResolution(n),s=this.va.getResolution(this.ga),a=this.da.getTileCoordExtent(this.pa);this.At=mc(r,e,this.bt,s,this.va.getExtent(),o,a,this.wa,t,this.la,this.ca,this.fa),this.state=to}this.changed()},n.prototype.load=function(){if(this.state==Ke){this.state=Qe,this.changed();var t=0;this.ya=[],this.ma.forEach(function(n,i,r){var e=n.getState();if(e==Ke||e==Qe){t++;var o=H(n,N,(function(i){var r=n.getState();r!=to&&r!=no&&r!=io||(Z(o),0===--t&&(this.xa(),this.ba()))}),this);this.ya.push(o)}}.bind(this)),0===t?setTimeout(this.ba.bind(this),0):this.ma.forEach((function(t,n,i){t.getState()==Ke&&t.load()}))}},n.prototype.xa=function(){this.ya.forEach(Z),this.ya=null},n}(uo),Zl="tileloadstart",$l="tileloadend",Kl="tileloaderror",Ql=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function tv(t){return t?Array.isArray(t)?function(n){return t}:"function"==typeof t?t:function(n){return[t]}:null}var nv=function(n){function i(t){var i=n.call(this)||this;return i.projection=Zi(t.projection),i.ja=tv(t.attributions),i.Ma=void 0===t.attributionsCollapsible||t.attributionsCollapsible,i.loading=!1,i.Jt=void 0!==t.state?t.state:$o,i.Sa=void 0!==t.wrapX&&t.wrapX,i}return Ql(i,n),i.prototype.getAttributions=function(){return this.ja},i.prototype.getAttributionsCollapsible=function(){return this.Ma},i.prototype.getProjection=function(){return this.projection},i.prototype.getResolutions=function(){return t()},i.prototype.getState=function(){return this.Jt},i.prototype.getWrapX=function(){return this.Sa},i.prototype.getContextOptions=function(){},i.prototype.refresh=function(){this.changed()},i.prototype.setAttributions=function(t){this.ja=tv(t),this.changed()},i.prototype.setState=function(t){this.Jt=t,this.changed()},i}(rt),iv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rv=function(n){function i(t){var i=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX})||this;i.on,i.once,i.un,i._a=void 0!==t.opaque&&t.opaque,i.Oa=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,i.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;var r=t.tileGrid;return r&&Da(r.getTileSize(r.getMinZoom()),[256,256]),i.tileCache=new Th(t.cacheSize||0),i.tmpSize=[0,0],i.pe=t.key||"",i.tileOptions={transition:t.transition},i.zDirection=t.zDirection?t.zDirection:0,i}return iv(i,n),i.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},i.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);i&&i.expireCache(n)},i.prototype.forEachLoadedTile=function(t,n,i,r){var e=this.getTileCacheForProjection(t);if(!e)return!1;for(var o,s,a,u=!0,h=i.minX;h<=i.maxX;++h)for(var c=i.minY;c<=i.maxY;++c)s=xh(n,h,c),a=!1,e.containsKey(s)&&(a=(o=e.get(s)).getState()===to)&&(a=!1!==r(o)),a||(u=!1);return u},i.prototype.getGutterForProjection=function(t){return 0},i.prototype.getKey=function(){return this.pe},i.prototype.setKey=function(t){this.pe!==t&&(this.pe=t,this.changed())},i.prototype.getOpaque=function(t){return this._a},i.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},i.prototype.getTile=function(n,i,r,e,o){return t()},i.prototype.getTileGrid=function(){return this.tileGrid},i.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:wc(t)},i.prototype.getTileCacheForProjection=function(t){return ct(rr(this.getProjection(),t),68),this.tileCache},i.prototype.getTilePixelRatio=function(t){return this.Oa},i.prototype.getTilePixelSize=function(t,n,i){var r=this.getTileGridForProjection(i),e=this.getTilePixelRatio(n),o=Da(r.getTileSize(t),this.tmpSize);return 1==e?o:qa(o,e,this.tmpSize)},i.prototype.getTileCoordForTileUrlFunction=function(t,n){var i=void 0!==n?n:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=bc(r,t,i)),Oh(t,r)?t:null},i.prototype.clear=function(){this.tileCache.clear()},i.prototype.refresh=function(){this.clear(),n.prototype.refresh.call(this)},i.prototype.updateCacheSize=function(t,n){var i=this.getTileCacheForProjection(n);t>i.highWaterMark&&(i.highWaterMark=t)},i.prototype.useTile=function(t,n,i,r){},i}(nv),ev=function(t){function n(n,i){var r=t.call(this,n)||this;return r.tile=i,r}return iv(n,t),n}(c),ov=rv,sv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),av=function(t){function n(i){var r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.ka=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(r.tileUrlFunction=i.tileUrlFunction),r.urls=null,i.urls?r.setUrls(i.urls):i.url&&r.setUrl(i.url),r.Ta={},r}return sv(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,i=t.target,r=e(i),o=i.getState();o==Qe?(this.Ta[r]=!0,n=Zl):r in this.Ta&&(delete this.Ta[r],n=o==no?Kl:o==to?$l:void 0),null!=n&&this.dispatchEvent(new ev(n,i))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=Ec(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.ka?this.setTileUrlFunction(kc(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,i){},n.prototype.useTile=function(t,n,i){var r=xh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(ov),uv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hv(t,n){t.getImage().src=n}var cv=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:hv,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return i.crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,i.tileClass=void 0!==n.tileClass?n.tileClass:go,i.tileCacheForProjection={},i.tileGridForProjection={},i.Aa=n.reprojectionErrorThreshold,i.fa=!1===n.imageSmoothing?fc:void 0,i.Ea=!1,i}return uv(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?n:{}),this.tileCacheForProjection){var e=this.tileCacheForProjection[r];e.expireCache(e==i?n:{})}},n.prototype.getContextOptions=function(){return this.fa},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!rr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.fa?"\n"+JSON.stringify(this.fa):"")},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!rr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!rr(n,t)){var i=e(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=wc(t)),this.tileGridForProjection[i]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||rr(n,t))return this.tileCache;var i=e(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Th(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},n.prototype.Ca=function(t,n,i,r,e,o){var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=a?this.tileUrlFunction(a,r,e):void 0,h=new this.tileClass(s,void 0!==u?Ke:io,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(N,this.handleTileChange.bind(this)),h},n.prototype.getTile=function(t,n,i,r,e){var o=this.getProjection();if(o&&e&&!rr(o,e)){var s=this.getTileCacheForProjection(e),a=[t,n,i],u=void 0,h=jh(a);s.containsKey(h)&&(u=s.get(h));var c=this.getKey();if(u&&u.key==c)return u;var f=this.getTileGridForProjection(o),l=this.getTileGridForProjection(e),v=this.getTileCoordForTileUrlFunction(a,e),d=new Yl(o,f,e,l,a,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,i,r){return this.getTileInternal(t,n,i,r,o)}.bind(this),this.Aa,this.Ea,this.fa);return d.key=c,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,n,i,r,o||e)},n.prototype.getTileInternal=function(t,n,i,r,e){var o=null,s=xh(t,n,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.Ca(t,n,i,r,e,a),u.getState()==Ke?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.Ca(t,n,i,r,e,a),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.Ea!=t){for(var n in this.Ea=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var i=Zi(t);if(i){var r=e(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(av),fv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function lv(t){var n,i,r=t[0],e=new Array(r),o=1<>=1;return e.join("")}var vv=function(t){function n(n){var i=this,r=void 0!==n.hidpi&&n.hidpi;return(i=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",imageSmoothing:n.imageSmoothing,opaque:!0,projection:Zi("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:Zo,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Pa=r,i.Na=void 0!==n.culture?n.culture:"en-us",i.za=void 0!==n.maxZoom?n.maxZoom:-1,i.Ia=n.key,i.Ra=n.imagerySet,Jh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.Ra+"?uriScheme=https&include=ImageryProviders&key="+i.Ia+"&c="+i.Na,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return fv(n,t),n.prototype.getApiKey=function(){return this.Ia},n.prototype.getImagerySet=function(){return this.Ra},n.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var n=t.resourceSets[0].resources[0],i=-1==this.za?n.zoomMax:this.za,r=_c(this.getProjection()),e=this.Pa?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/e:[n.imageWidth/e,n.imageHeight/e],s=jc({extent:r,minZoom:n.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var a=this.Na,u=this.Pa;if(this.tileUrlFunction=Tc(n.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,n,e){if(t){bh(t[0],t[1],t[2],i);var o=r;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",lv(i))}}}))),n.imageryProviders){var h=er(Zi("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,e=this.getTileGrid(),o=e.getZForResolution(r.resolution,this.zDirection),s=e.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,e=n.coverageAreas,o=0,a=e.length;o=u.zoomMin&&s<=u.zoomMax){var c=u.bbox;if(Ln(Bn([c[1],c[0],c[3],c[2]],h),t.extent)){r=!0;break}}}r&&i.push(n.attribution)})),i.push('Terms of Use'),i}.bind(this))}this.setState($o)}else this.setState(Ko)},n}(cv),dv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pv=function(t){function n(n){var i=n||{},r=void 0!==i.projection?i.projection:"EPSG:3857",e=void 0!==i.tileGrid?i.tileGrid:jc({extent:_c(r),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:r,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:e,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return dv(n,t),n}(cv),mv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yv=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return i.La=n.account,i.Fa=n.map||"",i.Ga=n.config||{},i.qa={},i.Da(),i}return mv(n,t),n.prototype.getConfig=function(){return this.Ga},n.prototype.updateConfig=function(t){k(this.Ga,t),this.Da()},n.prototype.setConfig=function(t){this.Ga=t||{},this.Da()},n.prototype.Da=function(){var t=JSON.stringify(this.Ga);if(this.qa[t])this.Ba(this.qa[t]);else{var n="https://"+this.La+".carto.com/api/v1/map";this.Fa&&(n+="/named/"+this.Fa);var i=new XMLHttpRequest;i.addEventListener("load",this.Ua.bind(this,t)),i.addEventListener("error",this.Wa.bind(this)),i.open("POST",n),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.Ga))}},n.prototype.Ua=function(t,n){var i=n.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(Ko)}this.Ba(r),this.qa[t]=r,this.setState($o)}else this.setState(Ko)},n.prototype.Wa=function(t){this.setState(Ko)},n.prototype.Ba=function(t){var n="https://"+t.cdn_url.https+"/"+this.La+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(pv),gv="addfeature",wv="changefeature",bv="clear",xv="removefeature",jv="featuresloadstart",Mv="featuresloadend",Sv="featuresloaderror",_v=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ov=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.feature=i,e.features=r,e}return _v(n,t),n}(c),kv=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{attributions:r.attributions,projection:void 0,state:$o,wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.Tt=_,i.ge=r.format,i.Va=void 0===r.overlaps||r.overlaps,i.be=r.url,void 0!==r.loader?i.Tt=r.loader:void 0!==i.be&&(ct(i.ge,7),i.Tt=Wh(i.be,i.ge)),i.Ja=void 0!==r.strategy?r.strategy:Vh;var e,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.Xa=s?new Vl:null,i.Ha=new Vl,i.Ya=0,i.Za={},i.$a={},i.Ka={},i.Qa={},i.tu=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(e=r.features).getArray()),s||void 0!==e||(e=new ht(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==e&&i.nu(e),i}return _v(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=e(t);if(this.iu(n,t)){this.ru(n,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.Xa&&this.Xa.insert(r,t)}else this.Za[n]=t;this.dispatchEvent(new Ov(gv,t))}else this.tu&&this.tu.remove(t)},n.prototype.ru=function(t,n){this.Qa[t]=[H(n,N,this.eu,this),H(n,f,this.eu,this)]},n.prototype.iu=function(t,n){var i=!0,r=n.getId();return void 0!==r&&(r.toString()in this.$a?i=!1:this.$a[r.toString()]=n),i&&(ct(!(t in this.Ka),30),this.Ka[t]=n),i},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],i=[],r=[],o=0,s=t.length;o0},n.prototype.refresh=function(){this.clear(!0),this.Ha.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,i=this.Ha;i.forEachInExtent(t,(function(i){if(yn(i.extent,t))return n=i,!0})),n&&i.remove(n)},n.prototype.removeFeature=function(t){var n=e(t);n in this.Za?delete this.Za[n]:this.Xa&&this.Xa.remove(t),this.removeFeatureInternal(t),this.changed()},n.prototype.removeFeatureInternal=function(t){var n=e(t);this.Qa[n].forEach(Z),delete this.Qa[n];var i=t.getId();void 0!==i&&delete this.$a[i.toString()],delete this.Ka[n],this.dispatchEvent(new Ov(xv,t))},n.prototype.ou=function(t){var n=!1;for(var i in this.$a)if(this.$a[i]===t){delete this.$a[i],n=!0;break}return n},n.prototype.setLoader=function(t){this.Tt=t},n.prototype.setUrl=function(t){ct(this.ge,7),this.be=t,this.setLoader(Wh(t,this.ge))},n}(nv),Tv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Av=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return i.resolution=void 0,i.distance=void 0!==n.distance?n.distance:20,i.minDistance=n.minDistance||0,i.interpolationRatio=0,i.features=[],i.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return ct(n.getType()==gt.POINT,10),n},i.source=null,i.su=i.refresh.bind(i),i.updateDistance(i.distance,i.minDistance),i.setSource(n.source||null),i}return Tv(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,i){this.source.loadFeatures(t,n,i),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(N,this.su),this.source=t,t&&t.addEventListener(N,this.su),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var i=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=n,this.interpolationRatio=i,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,i=this.source.getFeatures(),r={},o=0,s=i.length;o=0;--r){var e=this.geometryFunction(t[r]);e?Pi(i,e.getCoordinates()):t.splice(r,1)}Gi(i,1/t.length);var o=An(n),s=this.interpolationRatio,a=new ne([i[0]*(1-s)+o[0]*s,i[1]*(1-s)+o[1]*s]),u=new vt(a);return u.set("features",t,!0),u},n}(kv),Ev=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cv="default",Pv="truncated",Nv=function(t){function n(n,i,r,e,o,s,a){var u=t.call(this,i,r,e,o,s,a)||this;return u.au=null,u.ao=n,u}return Ev(n,t),n.prototype.getImage=function(){if(this.au)return this.au;var n=t.prototype.getImage.call(this);if(this.state==to){var i=this.ao;if(n.width==i[0]&&n.height==i[1])return this.au=n,n;var r=ho(i[0],i[1]);return r.drawImage(n,0,0),this.au=r.canvas,r.canvas}return n},n}(go),zv=function(t){function n(n){var i=this,r=n,e=r.size,o=void 0!==r.tierSizeCalculation?r.tierSizeCalculation:Cv,s=r.tilePixelRatio||1,a=e[0],u=e[1],h=[],c=r.tileSize||ga,f=c*s;switch(o){case Cv:for(;a>f||u>f;)h.push([Math.ceil(a/f),Math.ceil(u/f)]),f+=f;break;case Pv:for(var l=a,v=u;l>f||v>f;)h.push([Math.ceil(l/f),Math.ceil(v/f)]),l>>=1,v>>=1;break;default:ct(!1,53)}h.push([1,1]),h.reverse();for(var d=[s],p=[0],m=1,y=h.length;m1,r=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],e=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=i&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:Iv(Iv([],n.supports),r),formats:Iv(Iv([],n.formats),e),qualities:Iv(Iv([],n.qualities),o)}},Uv[Fv]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?n.formats:Iv(Iv([],n.formats),t.imageInfo.extraFormats),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return p(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&p(i,n)?n:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?n.supports:Iv(Iv([],n.supports),t.imageInfo.extraFeatures),formats:i,qualities:void 0===t.imageInfo.extraQualities?n.qualities:Iv(Iv([],n.qualities),t.imageInfo.extraQualities),preferredFormat:r}};var Wv=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var n=0;n0&&"string"==typeof this.imageInfo.profile[0]&&Dv.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var i=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?Gv.none.none:Gv[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},i=this.getImageApiVersion();if(void 0!==i){var r=void 0===i?void 0:Uv[i](this);if(void 0!==r)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&p(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&p(r.qualities,n.quality)?n.quality:p(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),Vv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Jv(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Xv=function(t){function n(n){var i=this,r=n||{},e=r.url||"";e+=e.lastIndexOf("/")===e.length-1||""===e?"":"/";var o=r.version||Lv,s=r.sizes||[],a=r.size;ct(null!=a&&Array.isArray(a)&&2==a.length&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);var u,h,c,f=a[0],l=a[1],v=r.tileSize,d=r.tilePixelRatio||1,m=r.format||"jpg",y=r.quality||(r.version==Rv?"native":"default"),g=r.resolutions||[],w=r.supports||[],b=r.extent||[0,-l,f,0],x=null!=s&&Array.isArray(s)&&s.length>0,j=void 0!==v&&("number"==typeof v&&Number.isInteger(v)&&v>0||Array.isArray(v)&&v.length>0),M=null!=w&&Array.isArray(w)&&(p(w,"regionByPx")||p(w,"regionByPct"))&&(p(w,"sizeByWh")||p(w,"sizeByH")||p(w,"sizeByW")||p(w,"sizeByPct"));if(g.sort((function(t,n){return n-t})),j||M)if(null!=v&&("number"==typeof v&&Number.isInteger(v)&&v>0?(u=v,h=v):Array.isArray(v)&&v.length>0&&((1==v.length||null==v[1]&&Number.isInteger(v[0]))&&(u=v[0],h=v[0]),2==v.length&&(Number.isInteger(v[0])&&Number.isInteger(v[1])?(u=v[0],h=v[1]):null==v[0]&&Number.isInteger(v[1])&&(u=v[1],h=v[1])))),void 0!==u&&void 0!==h||(u=ga,h=ga),0==g.length)for(var S=c=Math.max(Math.ceil(Math.log(f/u)/Math.LN2),Math.ceil(Math.log(l/h)/Math.LN2));S>=0;S--)g.push(Math.pow(2,S));else{var _=Math.max.apply(Math,g);c=Math.round(Math.log(_)/Math.LN2)}else if(u=f,h=l,g=[],x){s.sort((function(t,n){return t[0]-n[0]})),c=-1;var O=[];for(S=0;S0&&g[g.length-1]==k?O.push(S):(g.push(k),c++)}if(O.length>0)for(S=0;Sc)){var d=t[1],b=t[2],S=g[v];if(!(void 0===d||void 0===b||void 0===S||d<0||Math.ceil(f/S/u)<=d||b<0||Math.ceil(l/S/h)<=b)){if(M||j){var _=d*u*S,O=b*h*S,k=u*S,T=h*S,A=u,E=h;if(_+k>f&&(k=f-_),O+T>l&&(T=l-O),_+u*S>f&&(A=Math.floor((f-_+S-1)/S)),O+h*S>l&&(E=Math.floor((l-O+S-1)/S)),0==_&&k==f&&0==O&&T==l)r="full";else if(!M||p(w,"regionByPx"))r=_+","+O+","+k+","+T;else if(p(w,"regionByPct")){r="pct:"+Jv(_/f*100)+","+Jv(O/l*100)+","+Jv(k/f*100)+","+Jv(T/l*100)}o!=Fv||M&&!p(w,"sizeByWh")?!M||p(w,"sizeByW")?a=A+",":p(w,"sizeByH")?a=","+E:p(w,"sizeByWh")?a=A+","+E:p(w,"sizeByPct")&&(a="pct:"+Jv(100/S)):a=A+","+E}else if(r="full",x){var C=s[v][0],P=s[v][1];a=o==Fv?C==f&&P==l?"max":C+","+P:C==f?"full":C+","}else a=o==Fv?"max":"full";return e+r+"/"+a+"/0/"+y+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,i}return Vv(n,t),n}(cv),Hv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yv=function(t){function n(n,i,r,e,o,s,a){var u=this,h=n.getExtent(),c=i.getExtent(),f=c?Nn(r,c):r,l=dc(n,i,An(f),e),v=new Xl(n,i,f,h,.5*l,e),d=s(v.calculateSourceExtent(),l,o),p=d?Be:Je,m=d?d.getPixelRatio():1;return(u=t.call(this,r,e,m,p)||this).Qs=i,u.na=h,u.wa=v,u.ei=e,u.uu=r,u.hu=d,u.cu=m,u.fa=a,u.At=null,u.fu=null,u}return Hv(n,t),n.prototype.disposeInternal=function(){this.state==Ue&&this.lu(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.At},n.prototype.getProjection=function(){return this.Qs},n.prototype.ba=function(){var t=this.hu.getState();if(t==We){var n=Rn(this.uu)/this.ei,i=Pn(this.uu)/this.ei;this.At=mc(n,i,this.cu,this.hu.getResolution(),this.na,this.ei,this.uu,this.wa,[{extent:this.hu.getExtent(),image:this.hu.getImage()}],0,void 0,this.fa)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==Be){this.state=Ue,this.changed();var t=this.hu.getState();t==We||t==Ve?this.ba():(this.fu=H(this.hu,N,(function(t){var n=this.hu.getState();n!=We&&n!=Ve||(this.lu(),this.ba())}),this),this.hu.load())}},n.prototype.lu=function(){Z(this.fu),this.fu=null},n}(De),Zv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$v="imageloadstart",Kv="imageloadend",Qv="imageloaderror",td=function(t){function n(n,i){var r=t.call(this,n)||this;return r.image=i,r}return Zv(n,t),n}(c);function nd(t,n){t.getImage().src=n}var id=function(n){function i(t){var i=n.call(this,{attributions:t.attributions,projection:t.projection,state:t.state})||this;return i.on,i.once,i.un,i.fi=void 0!==t.resolutions?t.resolutions:null,i.vu=null,i.du=0,i.fa=!1===t.imageSmoothing?fc:void 0,i}return Zv(i,n),i.prototype.getResolutions=function(){return this.fi},i.prototype.getContextOptions=function(){return this.fa},i.prototype.findNearestResolution=function(t){if(this.fi){var n=m(this.fi,t,0);t=this.fi[n]}return t},i.prototype.getImage=function(t,n,i,r){var e=this.getProjection();if(e&&r&&!rr(e,r)){if(this.vu){if(this.du==this.getRevision()&&rr(this.vu.getProjection(),r)&&this.vu.getResolution()==n&&yn(this.vu.getExtent(),t))return this.vu;this.vu.dispose(),this.vu=null}return this.vu=new Yv(e,r,t,n,i,function(t,n,i){return this.getImageInternal(t,n,i,e)}.bind(this),this.fa),this.du=this.getRevision(),this.vu}return e&&(r=e),this.getImageInternal(t,n,i,r)},i.prototype.getImageInternal=function(n,i,r,e){return t()},i.prototype.handleImageChange=function(t){var n=t.target;switch(n.getState()){case Ue:this.loading=!0,this.dispatchEvent(new td($v,n));break;case We:this.loading=!1,this.dispatchEvent(new td(Kv,n));break;case Ve:this.loading=!1,this.dispatchEvent(new td(Qv,n))}},i}(nv),rd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ed=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).zt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Pa=void 0===r.hidpi||r.hidpi,i.be=r.url,i.St=void 0!==r.imageLoadFunction?r.imageLoadFunction:nd,i.pu=r.params||{},i.jt=null,i.mu=[0,0],i.yu=0,i.gu=void 0!==r.ratio?r.ratio:1.5,i}return rd(n,t),n.prototype.getParams=function(){return this.pu},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.be)return null;n=this.findNearestResolution(n),i=this.Pa?i:1;var e=this.jt;if(e&&this.yu==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&hn(e.getExtent(),t))return e;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};k(o,this.pu);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.gu){var u=this.gu*Rn(t)/2,h=this.gu*Pn(t)/2;t[0]=s-u,t[1]=a-h,t[2]=s+u,t[3]=a+h}var c=n/i,f=Math.ceil(Rn(t)/c),l=Math.ceil(Pn(t)/c);t[0]=s-c*f/2,t[2]=s+c*f/2,t[1]=a-c*l/2,t[3]=a+c*l/2,this.mu[0]=f,this.mu[1]=l;var v=this.wu(t,this.mu,i,r,o);return this.jt=new Ye(t,n,i,v,this.zt,this.St),this.yu=this.getRevision(),this.jt.addEventListener(N,this.handleImageChange.bind(this)),this.jt},n.prototype.getImageLoadFunction=function(){return this.St},n.prototype.wu=function(t,n,i,r,e){var o=r.getCode().split(/:(?=\d+$)/).pop();e.SIZE=n[0]+","+n[1],e.BBOX=t.join(","),e.BBOXSR=o,e.IMAGESR=o,e.DPI=Math.round(90*i);var s=this.be,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&ct(!1,50),Cc(a,e)},n.prototype.getUrl=function(){return this.be},n.prototype.setImageLoadFunction=function(t){this.jt=null,this.St=t,this.changed()},n.prototype.setUrl=function(t){t!=this.be&&(this.be=t,this.jt=null,this.changed())},n.prototype.updateParams=function(t){k(this.pu,t),this.jt=null,this.changed()},n}(id),od=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sd=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).bu=r.canvasFunction,i.At=null,i.yu=0,i.gu=void 0!==r.ratio?r.ratio:1.5,i}return od(n,t),n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n);var e=this.At;if(e&&this.yu==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&hn(e.getExtent(),t))return e;qn(t=t.slice(),this.gu);var o=[Rn(t)/n*i,Pn(t)/n*i],s=this.bu.call(this,t,n,i,o,r);return s&&(e=new $e(t,n,i,s)),this.At=e,this.yu=this.getRevision(),e},n}(id),ad=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var ud=function(t){function n(n){var i=t.call(this,{imageSmoothing:n.imageSmoothing,projection:n.projection,resolutions:n.resolutions})||this;return i.zt=void 0!==n.crossOrigin?n.crossOrigin:null,i.xu=void 0!==n.displayDpi?n.displayDpi:96,i.pu=n.params||{},i.be=n.url,i.St=void 0!==n.imageLoadFunction?n.imageLoadFunction:nd,i.Pa=void 0===n.hidpi||n.hidpi,i.nt=void 0!==n.metersPerUnit?n.metersPerUnit:1,i.gu=void 0!==n.ratio?n.ratio:1,i.ju=void 0!==n.useOverlay&&n.useOverlay,i.jt=null,i.yu=0,i}return ad(n,t),n.prototype.getParams=function(){return this.pu},n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n),i=this.Pa?i:1;var e=this.jt;if(e&&this.yu==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&hn(e.getExtent(),t))return e;1!=this.gu&&qn(t=t.slice(),this.gu);var o=[Rn(t)/n*i,Pn(t)/n*i];if(void 0!==this.be){var s=this.getUrl(this.be,this.pu,t,o,r);(e=new Ye(t,n,i,s,this.zt,this.St)).addEventListener(N,this.handleImageChange.bind(this))}else e=null;return this.jt=e,this.yu=this.getRevision(),e},n.prototype.getImageLoadFunction=function(){return this.St},n.prototype.updateParams=function(t){k(this.pu,t),this.changed()},n.prototype.getUrl=function(t,n,i,r,e){var o=function(t,n,i,r){var e=Rn(t),o=Pn(t),s=n[0],a=n[1],u=.0254/r;return a*e>s*o?e*i/(s*u):o*i/(a*u)}(i,r,this.nt,this.xu),s=An(i),a={OPERATION:this.ju?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.xu,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return k(a,n),Cc(t,a)},n.prototype.setImageLoadFunction=function(t){this.jt=null,this.St=t,this.changed()},n}(id),hd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cd=function(t){function n(n){var i=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,e=void 0!==n.imageLoadFunction?n.imageLoadFunction:nd;return(i=t.call(this,{attributions:n.attributions,imageSmoothing:n.imageSmoothing,projection:Zi(n.projection)})||this).be=n.url,i.Mu=n.imageExtent,i.jt=new Ye(i.Mu,void 0,1,i.be,r,e),i.mu=n.imageSize?n.imageSize:null,i.jt.addEventListener(N,i.handleImageChange.bind(i)),i}return hd(n,t),n.prototype.getImageExtent=function(){return this.Mu},n.prototype.getImageInternal=function(t,n,i,r){return Ln(t,this.jt.getExtent())?this.jt:null},n.prototype.getUrl=function(){return this.be},n.prototype.handleImageChange=function(n){if(this.jt.getState()==We){var i=this.jt.getExtent(),r=this.jt.getImage(),e=void 0,o=void 0;this.mu?(e=this.mu[0],o=this.mu[1]):(e=r.width,o=r.height);var s=Rn(i),a=Pn(i),u=s/e,h=a/o,c=e,f=o;if(u>h?c=Math.round(s/h):f=Math.round(a/u),c!==e||f!==o){var l=ho(c,f);k(l,this.getContextOptions());var v=l.canvas;l.drawImage(r,0,0,e,o,0,0,v.width,v.height),this.jt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(id),fd="carmentaserver",ld="geoserver",vd="mapserver",dd="qgis",pd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),md=[101,101],yd=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).zt=void 0!==r.crossOrigin?r.crossOrigin:null,i.be=r.url,i.St=void 0!==r.imageLoadFunction?r.imageLoadFunction:nd,i.pu=r.params||{},i.Su=!0,i._u(),i.Ou=r.serverType,i.Pa=void 0===r.hidpi||r.hidpi,i.jt=null,i.mu=[0,0],i.yu=0,i.gu=void 0!==r.ratio?r.ratio:1.5,i}return pd(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){if(void 0!==this.be){var e=Zi(i),o=this.getProjection();o&&o!==e&&(n=dc(o,e,t,n),t=sr(t,e,o));var s=Cn(t,n,0,md),a={SERVICE:"WMS",VERSION:cc,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.pu.LAYERS};k(a,this.pu,r);var u=Math.floor((t[0]-s[0])/n),h=Math.floor((s[3]-t[1])/n);return a[this.Su?"I":"X"]=u,a[this.Su?"J":"Y"]=h,this.wu(s,md,1,o||e,a)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.be){var i={SERVICE:"WMS",VERSION:cc,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.pu.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return k(i,n),Cc(this.be,i)}},n.prototype.getParams=function(){return this.pu},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.be)return null;n=this.findNearestResolution(n),1==i||this.Pa&&void 0!==this.Ou||(i=1);var e=n/i,o=An(t),s=Cn(o,e,0,[Math.ceil(Rn(t)/e),Math.ceil(Pn(t)/e)]),a=Cn(o,e,0,[Math.ceil(this.gu*Rn(t)/e),Math.ceil(this.gu*Pn(t)/e)]),u=this.jt;if(u&&this.yu==this.getRevision()&&u.getResolution()==n&&u.getPixelRatio()==i&&hn(u.getExtent(),s))return u;var h={SERVICE:"WMS",VERSION:cc,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};k(h,this.pu),this.mu[0]=Math.round(Rn(a)/e),this.mu[1]=Math.round(Pn(a)/e);var c=this.wu(a,this.mu,i,r,h);return this.jt=new Ye(a,n,i,c,this.zt,this.St),this.yu=this.getRevision(),this.jt.addEventListener(N,this.handleImageChange.bind(this)),this.jt},n.prototype.getImageLoadFunction=function(){return this.St},n.prototype.wu=function(t,n,i,r,e){if(ct(void 0!==this.be,9),e[this.Su?"CRS":"SRS"]=r.getCode(),"STYLES"in this.pu||(e.STYLES=""),1!=i)switch(this.Ou){case ld:var o=90*i+.5|0;"FORMAT_OPTIONS"in e?e.FORMAT_OPTIONS+=";dpi:"+o:e.FORMAT_OPTIONS="dpi:"+o;break;case vd:e.MAP_RESOLUTION=90*i;break;case fd:case dd:e.DPI=90*i;break;default:ct(!1,8)}e.WIDTH=n[0],e.HEIGHT=n[1];var s,a=r.getAxisOrientation();return s=this.Su&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,e.BBOX=s.join(","),Cc(this.be,e)},n.prototype.getUrl=function(){return this.be},n.prototype.setImageLoadFunction=function(t){this.jt=null,this.St=t,this.changed()},n.prototype.setUrl=function(t){t!=this.be&&(this.be=t,this.jt=null,this.changed())},n.prototype.updateParams=function(t){k(this.pu,t),this._u(),this.jt=null,this.changed()},n.prototype._u=function(){var t=this.pu.VERSION||cc;this.Su=Ci(t,"1.3")>=0},n}(id),gd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wd='© OpenStreetMap contributors.',bd=function(t){function n(n){var i,r=n||{};i=void 0!==r.attributions?r.attributions:[wd];var e=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",o=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:e,imageSmoothing:r.imageSmoothing,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:o,wrapX:r.wrapX,zDirection:r.zDirection})||this}return gd(n,t),n}(pv),xd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jd=function(t){function n(n){var i=n||{};return t.call(this,i)||this}return xd(n,t),n}(ns),Md=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sd=function(n){function i(t){var i=n.call(this)||this;return i.ku=i.Tu.bind(i),i.Au=t,i.declutterExecutorGroup=null,i}return Md(i,n),i.prototype.getFeatures=function(n){return t()},i.prototype.prepareFrame=function(n){return t()},i.prototype.renderFrame=function(n,i){return t()},i.prototype.loadedTileCallback=function(t,n,i){t[n]||(t[n]={}),t[n][i.tileCoord.toString()]=i},i.prototype.createLoadedTileFinder=function(t,n,i){return function(r,e){var o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(n,r,e,o)}.bind(this)},i.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){},i.prototype.getDataAtPixel=function(n,i,r){return t()},i.prototype.getLayer=function(){return this.Au},i.prototype.handleFontsChanged=function(){},i.prototype.Tu=function(t){t.target.getState()===We&&this.renderIfReadyAndVisible()},i.prototype.loadImage=function(t){var n=t.getState();return n!=We&&n!=Ve&&t.addEventListener(N,this.ku),n==Be&&(t.load(),n=t.getState()),n==We},i.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==$o&&t.changed()},i}(tt),_d=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Od=function(t){function n(n){var i=t.call(this,n)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return _d(n,t),n.prototype.useContainer=function(t,n,i){var r,e,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(e=a.getContext("2d")));if(!e||0!==e.canvas.width&&e.canvas.style.transform!==n?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=e,this.containerReused=!0),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var a=(e=ho()).canvas;r.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=e}},n.prototype.clipUnrotated=function(t,n,i){var r=zn(i),e=In(i),o=Tn(i),s=kn(i);Ft(n.coordinateToPixelTransform,r),Ft(n.coordinateToPixelTransform,e),Ft(n.coordinateToPixelTransform,o),Ft(n.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Ft(a,r),Ft(a,e),Ft(a,o),Ft(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(e[0]),Math.round(e[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},n.prototype.Eu=function(t,n,i){var r=this.getLayer();if(r.hasListener(t)){var e=new ss(t,this.inversePixelTransform,i,n);r.dispatchEvent(e)}},n.prototype.preRender=function(t,n){this.Eu(Wo,t,n)},n.prototype.postRender=function(t,n){this.Eu(Vo,t,n)},n.prototype.getRenderTransform=function(t,n,i,r,e,o,s){var a=e/2,u=o/2,h=r/n,c=-h,f=-t[0]+s,l=-t[1];return Ut(this.tempTransform,a,u,h,c,-i,f,l)},n.prototype.getDataAtPixel=function(t,n,i){var r,e=Ft(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!un(s,Ft(n.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(e[0]),u=Math.round(e[1]),h=document.createElement("canvas"),c=h.getContext("2d");h.width=1,h.height=1,c.clearRect(0,0,1,1),c.drawImage(o.canvas,a,u,1,1,0,0,1,1),r=c.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:r}return 0===r[3]?null:r},n}(Sd),kd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Td=function(t){function n(n){var i=t.call(this,n)||this;return i.jt=null,i}return kd(n,t),n.prototype.getImage=function(){return this.jt?this.jt.getImage():null},n.prototype.prepareFrame=function(t){var n=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,r=t.viewState,e=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==n.extent&&(a=Nn(a,dr(n.extent,r.projection))),!s[va]&&!s[da]&&!Fn(a))if(o){var u=r.projection,h=o.getImage(a,e,i,u);h&&this.loadImage(h)&&(this.jt=h)}else this.jt=null;return!!this.jt},n.prototype.renderFrame=function(t,n){var i=this.jt,r=i.getExtent(),e=i.getResolution(),o=i.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,u=t.viewState,h=u.center,c=u.resolution,f=t.size,l=a*e/(c*o),v=Math.round(f[0]*a),d=Math.round(f[1]*a),p=u.rotation;if(p){var m=Math.round(Math.sqrt(v*v+d*d));v=m,d=m}Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,p,-v/2,-d/2),Wt(this.inversePixelTransform,this.pixelTransform);var y=Jt(this.pixelTransform);this.useContainer(n,y,s.opacity);var g=this.context,w=g.canvas;w.width!=v||w.height!=d?(w.width=v,w.height=d):this.containerReused||g.clearRect(0,0,v,d);var b=!1,x=!0;if(s.extent){var j=dr(s.extent,u.projection);(b=(x=Ln(j,t.extent))&&!hn(j,t.extent))&&this.clipUnrotated(g,t,j)}var M=i.getImage(),S=Ut(this.tempTransform,v/2,d/2,l,l,0,o*(r[0]-h[0])/e,o*(h[1]-r[3])/e);this.renderedResolution=e*a/o;var _=M.width*S[0],O=M.height*S[3];if(k(g,this.getLayer().getSource().getContextOptions()),this.preRender(g,t),x&&_>=.5&&O>=.5){var T=S[4],A=S[5],E=s.opacity,C=void 0;1!==E&&(C=g.globalAlpha,g.globalAlpha=E),g.drawImage(M,0,0,+M.width,+M.height,Math.round(T),Math.round(A),Math.round(_),Math.round(O)),1!==E&&(g.globalAlpha=C)}return this.postRender(g,t),b&&g.restore(),y!==w.style.transform&&(w.style.transform=y),this.container},n}(Od),Ad=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ed=function(t){function n(n){return t.call(this,n)||this}return Ad(n,t),n.prototype.createRenderer=function(){return new Td(this)},n}(jd),Cd="preload",Pd="useInterimTilesOnError",Nd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),zd=function(t){function n(n){var i=this,r=n||{},e=k({},r);return delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,i.setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return Nd(n,t),n.prototype.getPreload=function(){return this.get(Cd)},n.prototype.setPreload=function(t){this.set(Cd,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(Pd)},n.prototype.setUseInterimTilesOnError=function(t){this.set(Pd,t)},n}(ns),Id=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rd=function(t){function n(n){var i=t.call(this,n)||this;return i.extentChanged=!0,i.Cu=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.Pu=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.Nu=new Ch(0,0,0,0),i}return Id(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==to||i==io||i==no&&!r},n.prototype.getTile=function(t,n,i,r){var e=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,n,i,e,o);return a.getState()==no&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Pu=!0):a.setState(to)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.loadedTileCallback=function(n,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,i,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,o=r.projection,s=r.resolution,a=r.center,u=r.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),l=f.getRevision(),v=f.getTileGridForProjection(o),p=v.getZForResolution(s,f.zDirection),m=v.getResolution(p),y=t.extent,g=i.extent&&dr(i.extent,o);g&&(y=Nn(y,dr(i.extent,o)));var w=f.getTilePixelRatio(h),b=Math.round(t.size[0]*w),x=Math.round(t.size[1]*w);if(u){var j=Math.round(Math.sqrt(b*b+x*x));b=j,x=j}var M=m*b/2/w,S=m*x/2/w,_=[a[0]-M,a[1]-S,a[0]+M,a[1]+S],O=v.getTileRangeForExtentAndZ(y,p),T={};T[p]={};var A=this.createLoadedTileFinder(f,o,T),E=this.tmpExtent,C=this.Nu;this.Pu=!1;for(var P=O.minX;P<=O.maxX;++P)for(var N=O.minY;N<=O.maxY;++N){var z=this.getTile(p,P,N,t);if(this.isDrawableTile(z)){var I=e(this);if(z.getState()==to){T[p][z.tileCoord.toString()]=z;var R=z.inTransition(I);this.Pu||!R&&-1!==this.renderedTiles.indexOf(z)||(this.Pu=!0)}if(1===z.getAlpha(I,t.time))continue}var L=v.getTileCoordChildTileRange(z.tileCoord,C,E),F=!1;L&&(F=A(p+1,L)),F||v.forEachTileCoordParentTileRange(z.tileCoord,A,C,E)}var G=m/s;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/w,1/w,u,-b/2,-x/2);var q=Jt(this.pixelTransform);this.useContainer(n,q,i.opacity);var D=this.context,B=D.canvas;Wt(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,b/2,x/2,G,G,0,-b/2,-x/2),B.width!=b||B.height!=x?(B.width=b,B.height=x):this.containerReused||D.clearRect(0,0,b,x),g&&this.clipUnrotated(D,t,g),k(D,f.getContextOptions()),this.preRender(D,t),this.renderedTiles.length=0;var U,W,V,J=Object.keys(T).map(Number);J.sort(d),1!==i.opacity||this.containerReused&&!f.getOpaque(t.viewState.projection)?(U=[],W=[]):J=J.reverse();for(var X=J.length-1;X>=0;--X){var H=J[X],Y=f.getTilePixelSize(H,h,o),Z=v.getResolution(H)/m,$=Y[0]*Z*G,K=Y[1]*Z*G,Q=v.getTileCoordForCoordAndZ(zn(_),H),tt=v.getTileCoordExtent(Q),nt=Ft(this.tempTransform,[w*(tt[0]-_[0])/m,w*(_[3]-tt[3])/m]),it=w*f.getGutterForProjection(o),rt=T[H];for(var et in rt){var ot=(z=rt[et]).tileCoord,st=Q[1]-ot[1],at=Math.round(nt[0]-(st-1)*$),ut=Q[2]-ot[2],ht=Math.round(nt[1]-(ut-1)*K),ct=at-(P=Math.round(nt[0]-st*$)),ft=ht-(N=Math.round(nt[1]-ut*K)),lt=p===H;if(!(R=lt&&1!==z.getAlpha(e(this),t.time)))if(U){D.save(),V=[P,N,P+ct,N,P+ct,N+ft,P,N+ft];for(var vt=0,dt=U.length;vtthis._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),e=this._workers.length;if(this._running=e,1===e)this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:n,height:i},r);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/e),a=0;aStamen Design, under CC BY 3.0.',wd],op={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},sp={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},ap=function(t){function n(n){var i=n.layer.indexOf("-"),r=-1==i?n.layer:n.layer.slice(0,i),e=sp[r],o=op[n.layer],s=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:ep,cacheSize:n.cacheSize,crossOrigin:"anonymous",imageSmoothing:n.imageSmoothing,maxZoom:null!=n.maxZoom?n.maxZoom:e.maxZoom,minZoom:null!=n.minZoom?n.minZoom:e.minZoom,opaque:o.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:s,wrapX:n.wrapX,zDirection:n.zDirection})||this}return rp(n,t),n}(pv),up=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hp=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).pu=r.params||{},i.Pa=void 0===r.hidpi||r.hidpi,i.co=[1/0,1/0,-1/0,-1/0],i.setKey(i.Wu()),i}return up(n,t),n.prototype.Wu=function(){var t=0,n=[];for(var i in this.pu)n[t++]=i+"-"+this.pu[i];return n.join("/")},n.prototype.getParams=function(){return this.pu},n.prototype.wu=function(t,n,i,r,e,o){var s=this.urls;if(s){var a,u=e.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=i.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[Qn(_h(t),s.length)];return Cc(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this.Pa?t:1},n.prototype.updateParams=function(t){k(this.pu,t),this.setKey(this.Wu())},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Pa||(n=1);var e=r.getTileCoordExtent(t,this.co),o=Da(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=qa(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return k(s,this.pu),this.wu(t,o,e,n,i,s)}},n}(cv),cp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fp=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],e=Da(i.tileGrid.getTileSize(r)),o=ho(e[0],e[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,e[0]+.5,e[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,e[0]/2,e[1]/2,e[0]),o.fillText(n,e[0]/2,e[1]/2,e[0]),t.setImage(o.canvas)}})||this}return cp(n,t),n}(pv),lp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vp=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,projection:Zi("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:Zo,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this;if(i.Vu=null,i.ao=n.tileSize,n.url)if(n.jsonp)Jh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Ju.bind(i)),r.addEventListener("error",i.Xu.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):ct(!1,51);return i}return lp(n,t),n.prototype.Ju=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Xu=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Vu},n.prototype.handleTileJSONResponse=function(t){var n,i=Zi("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=er(i,r);n=Bn(t.bounds,e)}var o=_c(r),s=t.minzoom||0,a=jc({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.ao});if(this.tileGrid=a,this.tileUrlFunction=kc(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==n?n:o;this.setAttributions((function(n){return Ln(u,n.extent)?[t.attribution]:null}))}this.Vu=t,this.setState($o)},n.prototype.handleTileJSONError=function(){this.setState(Ko)},n}(cv),dp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pp=function(t){function n(n){var i=this,r=n||{},e=r.params||{},o=!("TRANSPARENT"in e)||e.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:!o,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).la=void 0!==r.gutter?r.gutter:0,i.pu=e,i.Su=!0,i.Ou=r.serverType,i.Pa=void 0===r.hidpi||r.hidpi,i.co=[1/0,1/0,-1/0,-1/0],i._u(),i.setKey(i.Wu()),i}return dp(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){var e=Zi(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(e));var a=s.getZForResolution(n,this.zDirection),u=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=u[0])){var h=s.getResolution(u[0]),c=s.getTileCoordExtent(u,this.co),f=Da(s.getTileSize(u[0]),this.tmpSize),l=this.la;0!==l&&(f=Fa(f,l,this.tmpSize),c=on(c,h*l,c)),o&&o!==e&&(h=dc(o,e,t,h),c=ar(c,e,o),t=sr(t,e,o));var v={SERVICE:"WMS",VERSION:cc,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.pu.LAYERS};k(v,this.pu,r);var d=Math.floor((t[0]-c[0])/h),p=Math.floor((c[3]-t[1])/h);return v[this.Su?"I":"X"]=d,v[this.Su?"J":"Y"]=p,this.wu(u,f,c,1,o||e,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:cc,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.pu.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return k(i,n),Cc(this.urls[0],i)}},n.prototype.getGutter=function(){return this.la},n.prototype.getParams=function(){return this.pu},n.prototype.wu=function(t,n,i,r,e,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Su?"CRS":"SRS"]=e.getCode(),"STYLES"in this.pu||(o.STYLES=""),1!=r)switch(this.Ou){case ld:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case vd:o.MAP_RESOLUTION=90*r;break;case fd:case dd:o.DPI=90*r;break;default:ct(!1,52)}var u,h=e.getAxisOrientation(),c=i;if(this.Su&&"ne"==h.substr(0,2)){var f=void 0;f=i[0],c[0]=i[1],c[1]=f,f=i[2],c[2]=i[3],c[3]=f}if(o.BBOX=c.join(","),1==s.length)u=s[0];else u=s[Qn(_h(t),s.length)];return Cc(u,o)}},n.prototype.getTilePixelRatio=function(t){return this.Pa&&void 0!==this.Ou?t:1},n.prototype.Wu=function(){var t=0,n=[];for(var i in this.pu)n[t++]=i+"-"+this.pu[i];return n.join("/")},n.prototype.updateParams=function(t){k(this.pu,t),this._u(),this.setKey(this.Wu())},n.prototype._u=function(){var t=this.pu.VERSION||cc;this.Su=Ci(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this.Pa&&void 0!==this.Ou||(n=1);var e=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.co),s=Da(r.getTileSize(t[0]),this.tmpSize),a=this.la;0!==a&&(s=Fa(s,a,this.tmpSize),o=on(o,e*a,o)),1!=n&&(s=qa(s,n,this.tmpSize));var u={SERVICE:"WMS",VERSION:cc,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return k(u,this.pu),this.wu(t,s,o,n,i,u)}},n}(cv),mp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yp=function(t){function n(n,i,r,e,o,s){var a=t.call(this,n,i)||this;return a.xt=r,a.B=e,a.Hu=o,a.Yu=null,a.Zu=null,a.Bo=null,a.$u=s,a}return mp(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.Yu||!this.Zu)return null;var n=(t[0]-this.B[0])/(this.B[2]-this.B[0]),i=(t[1]-this.B[1])/(this.B[3]-this.B[1]),r=this.Yu[Math.floor((1-i)*this.Yu.length)];if("string"!=typeof r)return null;var e=r.charCodeAt(Math.floor(n*r.length));e>=93&&e--,e>=35&&e--;var o=null;if((e-=32)in this.Zu){var s=this.Zu[e];o=this.Bo&&s in this.Bo?this.Bo[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,i){this.state==io&&!0===i?(this.state=Ke,Y(this,N,(function(i){n(this.getData(t))}),this),this.Ku()):!0===i?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.xt},n.prototype.Qu=function(){this.state=no,this.changed()},n.prototype.Ct=function(t){this.Yu=t.grid,this.Zu=t.keys,this.Bo=t.data,this.state=to,this.changed()},n.prototype.Ku=function(){if(this.state==Ke)if(this.state=Qe,this.$u)Jh(this.xt,this.Ct.bind(this),this.Qu.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Ju.bind(this)),t.addEventListener("error",this.Xu.bind(this)),t.open("GET",this.xt),t.send()}},n.prototype.Ju=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.Qu()}this.Ct(i)}else this.Qu()},n.prototype.Xu=function(t){this.Qu()},n.prototype.load=function(){this.Hu?this.Ku():this.setState(io)},n}(uo),gp=function(t){function n(n){var i=t.call(this,{projection:Zi("EPSG:3857"),state:Zo,zDirection:n.zDirection})||this;if(i.Hu=void 0===n.preemptive||n.preemptive,i.th=Ac,i.nh=void 0,i.$u=n.jsonp||!1,n.url)if(i.$u)Jh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Ju.bind(i)),r.addEventListener("error",i.Xu.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):ct(!1,51);return i}return mp(n,t),n.prototype.Ju=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Xu=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.nh},n.prototype.forDataAtCoordinateAndResolution=function(t,n,i,r){if(this.tileGrid){var e=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,e);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,i,r)}else!0===r?setTimeout((function(){i(null)}),0):i(null)},n.prototype.handleTileJSONError=function(){this.setState(Ko)},n.prototype.handleTileJSONResponse=function(t){var n,i=Zi("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=er(i,r);n=Bn(t.bounds,e)}var o=_c(r),s=t.minzoom||0,a=jc({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=a,this.nh=t.template;var u=t.grids;if(u){if(this.th=kc(u,a),void 0!==t.attribution){var h=void 0!==n?n:o;this.setAttributions((function(n){return Ln(h,n.extent)?[t.attribution]:null}))}this.setState($o)}else this.setState(Ko)},n.prototype.getTile=function(t,n,i,r,e){var o=xh(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,i],a=this.getTileCoordForTileUrlFunction(s,e),u=this.th(a,r,e),h=new yp(s,void 0!==u?Ke:io,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(s),this.Hu,this.$u);return this.tileCache.set(o,h),h},n.prototype.useTile=function(t,n,i){var r=xh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(ov),wp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bp=function(t){function n(n){var i=this,r=n.projection||"EPSG:3857",e=n.extent||_c(r),o=n.tileGrid||jc({extent:e,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:xp,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).ge=n.format?n.format:null,i.sourceTileCache=new Th(i.tileCache.highWaterMark),i.Va=null==n.overlaps||n.overlaps,i.tileClass=n.tileClass?n.tileClass:Rh,i.ih={},i}return wp(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],i=this.tileCache;if(0===i.getCount())return n;var r=Sh(i.peekFirstKey())[0],e=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===to)for(var o=i.getSourceTiles(),s=0,a=o.length;s0&&(i.tileUrlFunction=Tc(o.map(i.createFromWMTSTemplate.bind(i)))),i}return Sp(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(Tc(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.eh},n.prototype.getFormat=function(){return this.ge},n.prototype.getLayer=function(){return this.Au},n.prototype.getMatrixSet=function(){return this.oh},n.prototype.getRequestEncoding=function(){return this.sh},n.prototype.getStyle=function(){return this.C},n.prototype.getVersion=function(){return this.rh},n.prototype.ah=function(){var t=0,n=[];for(var i in this.eh)n[t++]=i+"-"+this.eh[i];return n.join("/")},n.prototype.updateDimensions=function(t){k(this.eh,t),this.setKey(this.ah())},n.prototype.createFromWMTSTemplate=function(t){var n=this.sh,i={layer:this.Au,style:this.C,tilematrixset:this.oh};n==jp&&k(i,{Service:"WMTS",Request:"GetTile",Version:this.rh,Format:this.ge}),t=n==jp?Cc(t,i):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in i?i[n.toLowerCase()]:t}));var r=this.tileGrid,e=this.eh;return function(i,o,s){if(i){var a={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};k(a,e);var u=t;return u=n==jp?Cc(u,a):u.replace(/\{(\w+?)\}/g,(function(t,n){return a[n]}))}}},n}(cv);var Op=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kp="GENERATE_BUFFERS",Tp=function(t){function n(n,i){var r=t.call(this,n)||this,e=i||{};return r.helper=new Cf({postProcesses:e.postProcesses,uniforms:e.uniforms}),void 0!==e.className&&(r.helper.getCanvas().className=e.className),r}return Op(n,t),n.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},n.prototype.Eu=function(t,n){var i=this.getLayer();if(i.hasListener(t)){var r=new ss(t,null,n,null);i.dispatchEvent(r)}},n.prototype.preRender=function(t){this.Eu(Wo,t)},n.prototype.postRender=function(t){this.Eu(Vo,t)},n}(Sd),Ap=[],Ep={vertexPosition:0,indexPosition:0};function Cp(t,n,i,r,e){t[n+0]=i,t[n+1]=r,t[n+2]=e}function Pp(t,n){var i=n||[],r=256,e=255;return i[0]=Math.floor(t/r/r/r)/e,i[1]=Math.floor(t/r/r)%r/e,i[2]=Math.floor(t/r)%r/e,i[3]=t%r/e,i}function Np(t){var n=0,i=256,r=255;return n+=Math.round(t[0]*i*i*i*r),n+=Math.round(t[1]*i*i*r),n+=Math.round(t[2]*i*r),n+=Math.round(t[3]*r)}var zp=Tp,Ip=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rp="renderOrder",Lp=function(t){function n(n){var i=this,r=n||{},e=k({},r);return delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,(i=t.call(this,e)||this).uh=void 0!==r.declutter&&r.declutter,i.hh=void 0!==r.renderBuffer?r.renderBuffer:100,i.C=null,i.P=void 0,i.setStyle(r.style),i.fh=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.lh=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return Ip(n,t),n.prototype.getDeclutter=function(){return this.uh},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.hh},n.prototype.getRenderOrder=function(){return this.get(Rp)},n.prototype.getStyle=function(){return this.C},n.prototype.getStyleFunction=function(){return this.P},n.prototype.getUpdateWhileAnimating=function(){return this.fh},n.prototype.getUpdateWhileInteracting=function(){return this.lh},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Wl(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(Rp,t)},n.prototype.setStyle=function(t){this.C=void 0!==t?t:Rl,this.P=null===t?void 0:zl(this.C),this.changed()},n}(ns),Fp=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;rc&&this.instructions.push([Xp.CUSTOM,c,e,t,i,Jr])):u==gt.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),e=this.coordinates.length,this.instructions.push([Xp.CUSTOM,c,e,t,i]));this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.Rh=[Xp.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.Rh),this.Lh=[Xp.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.Lh)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var i,r,e=n.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.Fh=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},n.prototype.createFill=function(t){var n=t.fillStyle,i=[Xp.SET_FILL_STYLE,n];return"string"!=typeof n&&i.push(!0),i},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[Xp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(n.call(this,t)),t.currentFillStyle=i)},n.prototype.updateStrokeStyle=function(t,n){var i=t.strokeStyle,r=t.lineCap,e=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||e!=t.currentLineDash&&!b(t.currentLineDash,e)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==i&&n.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=e,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},n.prototype.endGeometry=function(t){this.Rh[2]=this.instructions.length,this.Rh=null,this.Lh[2]=this.hitDetectionInstructions.length,this.Lh=null;var n=[Xp.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Fh&&(this.Fh=sn(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;on(this.Fh,t,this.Fh)}return this.Fh},n}(Xh),Zp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$p=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.fs=null,o.jt=null,o.Dh=void 0,o.Bh=void 0,o.Uh=void 0,o.Wh=void 0,o.Jo=void 0,o.Vh=void 0,o.Jh=void 0,o.Xo=void 0,o.br=void 0,o.Ho=void 0,o.Cs=void 0,o.Xh=void 0,o}return Zp(n,t),n.prototype.drawPoint=function(t,n){if(this.jt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([Xp.DRAW_IMAGE,e,o,this.jt,this.Bh*this.Dh,this.Uh*this.Dh,Math.ceil(this.Wh*this.Dh),this.Jo,this.Vh,this.Jh,this.Xo,this.br,[this.Ho[0]*this.pixelRatio/this.Dh,this.Ho[1]*this.pixelRatio/this.Dh],Math.ceil(this.Cs*this.Dh),this.Xh]),this.hitDetectionInstructions.push([Xp.DRAW_IMAGE,e,o,this.fs,this.Bh,this.Uh,this.Wh,this.Jo,this.Vh,this.Jh,this.Xo,this.br,this.Ho,this.Cs,this.Xh]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.jt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([Xp.DRAW_IMAGE,e,o,this.jt,this.Bh*this.Dh,this.Uh*this.Dh,Math.ceil(this.Wh*this.Dh),this.Jo,this.Vh,this.Jh,this.Xo,this.br,[this.Ho[0]*this.pixelRatio/this.Dh,this.Ho[1]*this.pixelRatio/this.Dh],Math.ceil(this.Cs*this.Dh),this.Xh]),this.hitDetectionInstructions.push([Xp.DRAW_IMAGE,e,o,this.fs,this.Bh,this.Uh,this.Wh,this.Jo,this.Vh,this.Jh,this.Xo,this.br,this.Ho,this.Cs,this.Xh]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.Bh=void 0,this.Uh=void 0,this.fs=null,this.jt=null,this.Dh=void 0,this.Wh=void 0,this.Ho=void 0,this.Jo=void 0,this.Vh=void 0,this.Jh=void 0,this.Xo=void 0,this.br=void 0,this.Cs=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var i=t.getAnchor(),r=t.getSize(),e=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.Dh=t.getPixelRatio(this.pixelRatio),this.Bh=i[0],this.Uh=i[1],this.fs=e,this.jt=o,this.Wh=r[1],this.Jo=t.getOpacity(),this.Vh=s[0],this.Jh=s[1],this.Xo=t.getRotateWithView(),this.br=t.getRotation(),this.Ho=t.getScaleArray(),this.Cs=r[0],this.Xh=n},n}(Yp),Kp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qp=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return Kp(n,t),n.prototype.Hh=function(t,n,i,r){var e=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,i,r,!1,!1),s=[Xp.MOVE_TO_LINE_TO,e,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},n.prototype.drawLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([Xp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ws,0],Vp);var o=t.getFlatCoordinates(),s=t.getStride();this.Hh(o,0,o.length,s),this.hitDetectionInstructions.push(Wp),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([Xp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Vp);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,h=0,c=o.length;ht&&(y>m&&(m=y,d=g,p=o),y=0,g=o-e)),s=a,c=l,f=v),u=w,h=b}return(y+=a)>m?[g,o]:[d,p]}var rm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),em={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},om=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.$h=null,o.Ge="",o.qe=0,o.De=0,o.Be=void 0,o.Ue=0,o.Ve=null,o.fillStates={},o.Je=null,o.strokeStates={},o.Xe={},o.textStates={},o.Kh="",o.Qh="",o.tc="",o.Xh=void 0,o}return rm(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var i=this.Ve,r=this.Je,e=this.Xe;if(""!==this.Ge&&e&&(i||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,h=t.getStride();if(e.placement!==Dl||a!=gt.LINE_STRING&&a!=gt.MULTI_LINE_STRING&&a!=gt.POLYGON&&a!=gt.MULTI_POLYGON){var c=e.overflow?null:[];switch(a){case gt.POINT:case gt.MULTI_POINT:u=t.getFlatCoordinates();break;case gt.LINE_STRING:u=t.getFlatMidpoint();break;case gt.CIRCLE:u=t.getCenter();break;case gt.MULTI_LINE_STRING:u=t.getFlatMidpoints(),h=2;break;case gt.POLYGON:u=t.getFlatInteriorPoint(),e.overflow||c.push(u[2]/this.resolution),h=3;break;case gt.MULTI_POLYGON:var f=t.getFlatInteriorPoints();u=[];for(j=0,M=f.length;jT[2]}else _=b>O;var A,E=Math.PI,C=[],P=j+r===n;if(m=0,y=M,l=t[n=j],v=t[n+1],P){g();var N=Math.atan2(v-p,l-d);_&&(N+=N>0?-E:E);var z=(O+b)/2,I=(k+x)/2;return C[0]=[z,I,(S-o)/2,N,e],C}for(var R=0,L=e.length;R0?-E:E),void 0!==A){var G=F-A;if(G+=G>E?-2*E:G<-E?2*E:0,Math.abs(G)>s)return null}A=F;for(var q=R,D=0;Rt?t-u:e,b=o+h>n?n-h:o,x=v[3]+w*f[0]+v[1],j=v[0]+b*f[1]+v[2],M=y-v[3],S=g-v[0];return(d||0!==c)&&(fm[0]=M,dm[0]=M,fm[1]=S,lm[1]=S,lm[0]=M+x,vm[0]=lm[0],vm[1]=S+j,dm[1]=vm[1]),0!==c?(Ft(m=Ut([1,0,0,1,0,0],i,r,1,1,c,-i,-r),fm),Ft(m,lm),Ft(m,vm),Ft(m,dm),vn(Math.min(fm[0],lm[0],vm[0],dm[0]),Math.min(fm[1],lm[1],vm[1],dm[1]),Math.max(fm[0],lm[0],vm[0],dm[0]),Math.max(fm[1],lm[1],vm[1],dm[1]),cm)):vn(Math.min(M,M+x),Math.min(S,S+j),Math.max(M,M+x),Math.max(S,S+j),cm),l&&(y=Math.round(y),g=Math.round(g)),{drawImageX:y,drawImageY:g,drawImageW:w,drawImageH:b,originX:u,originY:h,declutterBox:{minX:cm[0],minY:cm[1],maxX:cm[2],maxY:cm[3],value:p},canvasTransform:m,scale:f}},t.prototype.dc=function(t,n,i,r,e,o,s){var a=!(!o&&!s),u=r.declutterBox,h=t.canvas,c=s?s[2]*r.scale[0]/2:0;return u.minX-c<=h.width/n&&u.maxX+c>=0&&u.minY-c<=h.height/n&&u.maxY+c>=0&&(a&&this.fc(t,fm,lm,vm,dm,o,s),Fs(t,r.canvasTransform,e,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.Ko=function(t){if(this.ac){var n=Ft(this.hc,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),t.rotate(this.xe)}t.fill(),this.ac&&t.restore()},t.prototype.lc=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.mc=function(t,n,i,r){var e=this.textStates[n],o=this.createLabel(t,n,r,i),s=this.strokeStates[i],a=this.pixelRatio,u=ym(t,e.textAlign||Ms),h=em[e.textBaseline||Ss],c=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*e.scale[0])+2*(.5-u)*c,anchorY:h*o.height/a+2*(.5-h)*c}},t.prototype.yc=function(t,n,i,r,e,o,s,a){var u;this.He&&b(i,this.hc)?u=this.He:(this.He||(this.He=[]),u=yr(this.coordinates,0,this.coordinates.length,2,i,this.He),Lt(this.hc,i));for(var h,c,f,l,v,d,p,m,y,g,w,x,j,M,S,_,O=0,k=r.length,T=0,A=0,E=0,C=null,P=null,N=this.uc,z=this.xe,I=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,R={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:z},L=this.instructions!=r||this.overlaps?0:200;OL&&(this.Ko(t),A=0),E>L&&(t.stroke(),E=0),A||E||(t.beginPath(),l=NaN,v=NaN),++O;break;case Xp.CIRCLE:var G=u[T=F[1]],q=u[T+1],D=u[T+2]-G,B=u[T+3]-q,U=Math.sqrt(D*D+B*B);t.moveTo(G+U,q),t.arc(G,q,U,0,2*Math.PI,!0),++O;break;case Xp.CLOSE_PATH:t.closePath(),++O;break;case Xp.CUSTOM:T=F[1],h=F[2];var W=F[3],V=F[4],J=6==F.length?F[5]:void 0;R.geometry=W,R.feature=j,O in N||(N[O]=[]);var X=N[O];J?J(u,T,h,2,X):(X[0]=u[T],X[1]=u[T+1],X.length=2),V(X,R),++O;break;case Xp.DRAW_IMAGE:T=F[1],h=F[2],m=F[3],c=F[4],f=F[5];var H=F[6],Y=F[7],Z=F[8],$=F[9],K=F[10],Q=F[11],tt=F[12],nt=F[13],it=F[14];if(!m&&F.length>=19){y=F[18],g=F[19],w=F[20],x=F[21];var rt=this.mc(y,g,w,x);m=rt.label,F[3]=m;var et=F[22];c=(rt.anchorX-et)*this.pixelRatio,F[4]=c;var ot=F[23];f=(rt.anchorY-ot)*this.pixelRatio,F[5]=f,H=m.height,F[6]=H,nt=m.width,F[13]=nt}var st=void 0;F.length>24&&(st=F[24]);var at=void 0,ut=void 0,ht=void 0;F.length>16?(at=F[15],ut=F[16],ht=F[17]):(at=_s,ut=!1,ht=!1),K&&I?Q+=z:K||I||(Q-=z);for(var ct=0;T0){if(!o||f!==Kh&&f!==nc||-1!==o.indexOf(t)){var h=(l[a]-3)/4,v=r-h%s,d=r-(h/s|0),p=e(t,n,v*v+d*d);if(p)return p}c.clearRect(0,0,s,s);break}}var p,m,y,g,w,b=Object.keys(this.gc).map(Number);for(b.sort(d),p=b.length-1;p>=0;--p){var x=b[p].toString();for(y=this.gc[x],m=wm.length-1;m>=0;--m)if(void 0!==(g=y[f=wm[m]])&&(w=g.executeHitDetection(c,a,i,v,h)))return w}},t.prototype.getClipCoords=function(t){var n=this.ec;if(!n)return null;var i=n[0],r=n[1],e=n[2],o=n[3],s=[i,r,i,o,e,o,e,r];return yr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return E(this.gc)},t.prototype.execute=function(t,n,i,r,e,o,s){var a=Object.keys(this.gc).map(Number);a.sort(d),this.ec&&(t.save(),this.clip(t,i));var u,h,c,f,l,v,p=o||wm;for(s&&a.reverse(),u=0,h=a.length;ui)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+e)*n+(t+o))+3),e>0&&a.push(4*((t-e)*n+(t+o))+3),o>0&&(a.push(4*((t+e)*n+(t-o))+3),e>0&&a.push(4*((t-e)*n+(t-o))+3))}for(var u=[],h=(e=0,r.length);e0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),c=Math.round(t.size[1]*i);s.width!=h||s.height!=c?(s.width=h,s.height=c,s.style.transform!==e&&(s.style.transform=e)):this.containerReused||o.clearRect(0,0,h,c),this.preRender(o,t);var f=t.viewState,l=f.projection,v=!1,d=!0;if(r.extent&&this.clipping){var p=dr(r.extent,l);(v=(d=Ln(p,t.extent))&&!hn(p,t.extent))&&this.clipUnrotated(o,t,p)}d&&this.renderWorlds(a,t),v&&o.restore(),this.postRender(o,t);var m=r.opacity,y=this.container;return m!==parseFloat(y.style.opacity)&&(y.style.opacity=1===m?"":String(m)),this.Ec!==f.rotation&&(this.Ec=f.rotation,this.Oc=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(n){if(!this.Oc&&!this.Sc){var i=[this.context.canvas.width,this.context.canvas.height];Ft(this.pixelTransform,i);var r=this.Cc,e=this.Tc,o=this.Ec,s=this.Pc,a=this.Ac,u=this.getLayer(),h=[],c=i[0]*Sm,f=i[1]*Sm;h.push(this.getRenderTransform(r,e,o,Sm,c,f,0).slice());var l=u.getSource(),v=s.getExtent();if(l.getWrapX()&&s.canWrapX()&&!hn(v,a)){for(var d=a[0],p=Rn(v),m=0,y=void 0;dv[2];)y=p*++m,h.push(this.getRenderTransform(r,e,o,Sm,c,f,y).slice()),d-=p}this.Oc=_m(i,h,this.kc,u.getStyleFunction(),a,e,o)}n(Om(t,this.kc,this.Oc))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,o){var s=this;if(this.zc){var a,u=n.viewState.resolution,h=n.viewState.rotation,c=this.getLayer(),f={},l=function(t,n,i){var s=e(t),a=f[s];if(a){if(!0!==a&&iw[0]&&M[2]>w[2]&&g.push([M[0]-x,M[1],M[2]-x,M[3]])}if(!this._c&&this.Tc==c&&this.yu==l&&this.Nc==d&&hn(this.Ac,m))return b(this.Cu,y)||(this.Oc=null,this.Cu=y),this.Cc=p,this.replayGroupChanged=!1,!0;this.zc=null,this._c=!1;var S,_=new am(oc(c,f),m,c,f);this.getLayer().getDeclutter()&&(S=new am(oc(c,f),m,c,f));var O,k=cr();if(k){for(var T=0,A=g.length;T0)n([]);else{var y=zn(f.getTileCoordExtent(r.wrappedTileCoord)),g=[(l[0]-y[0])/c,(y[1]-l[1])/c],w=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),b=r.hitDetectionImageData[s];if(!b&&!this.Sc){var x=Da(f.getTileSize(f.getZForResolution(c))),j=this.Ec;b=_m(x,[this.getRenderTransform(f.getTileCoordCenter(r.wrappedTileCoord),c,0,Sm,x[0]*Sm,x[1]*Sm,0)],w,o.getStyleFunction(),f.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(o).renderedResolution,j),r.hitDetectionImageData[s]=b}n(Om(g,w,b))}}.bind(this))},n.prototype.handleFontsChanged=function(){T(this.qc);var t=this.getLayer();t.getVisible()&&void 0!==this.Gc&&t.changed()},n.prototype.Mc=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,i=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,o=!(r[va]||r[da]),s=this.renderedTiles,a=0,u=s.length;a=0;--f)c[f].execute(this.context,1,this.getTileRenderTransform(h,t),t.viewState.rotation,o,void 0,t.declutterTree)}n.globalAlpha=i},n.prototype.getTileRenderTransform=function(t,n){var i=n.pixelRatio,r=n.viewState,e=r.center,o=r.resolution,s=r.rotation,a=n.size,u=Math.round(a[0]*i),h=Math.round(a[1]*i),c=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),f=t.tileCoord,l=c.getTileCoordExtent(t.wrappedTileCoord),v=c.getTileCoordExtent(f,this.tmpExtent)[0]-l[0];return It(qt(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(e,o,s,i,u,h,v))},n.prototype.renderFrame=function(n,i){var r=n.viewHints,o=!(r[va]||r[da]);this.Jc(o,n),t.prototype.renderFrame.call(this,n,i),this.Fc=n.pixelToCoordinateTransform.slice(),this.Ec=n.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),u=s.getSource(),h=n.usedTiles[e(u)];for(var c in this.qc)h&&c in h||delete this.qc[c];var f=this.context,l=f.globalAlpha;f.globalAlpha=s.getOpacity();for(var v=Rm[a],d=n.viewState.rotation,p=this.renderedTiles,m=[],y=[],g=p.length-1;g>=0;--g)for(var w=p[g],b=this.getTileRenderTransform(w,n),x=w.executorGroups[e(s)],j=!1,M=0,S=x.length;M8){n.animate=!0;break}var r=this.qc[i];delete this.qc[i],this.Vc(r,n)}},n.prototype.renderFeature=function(t,n,i,r,e){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,a=i.length;s1?s:2,x=o||new Array(b);for(p=0;p>1;e0&&m.length>0;)o=m.pop(),c=d.pop(),l=p.pop(),(u=o.toString())in y||(h.push(l[0],l[1]),y[u]=!0),s=m.pop(),f=d.pop(),v=p.pop(),Hn((e=n(r=t(a=(o+s)/2)))[0],e[1],l[0],l[1],v[0],v[1])this.Nf.length;)a=new vt,this.Nf.push(a);var h=r.getFeaturesCollection();h.clear();var c,f,l=0;for(c=0,f=this.ff.length;cMath.PI/2);for(var m=uc(t),y=f;y<=l;++y){var g=this.ff.length+this.lf.length,w=void 0,b=void 0,x=void 0,j=void 0;if(this.xf)for(b=0,x=this.xf.length;b=a?(t[0]=s[0],t[2]=s[2]):o=!0);var u=[Vn(n[0],this.af,this.ef),Vn(n[1],this.uf,this.sf)],h=this.pf(u);isNaN(h[1])&&(h[1]=Math.abs(this.tf)>=Math.abs(this.if)?this.tf:this.if);var c,f,l,v,d=Vn(h[0],this.rf,this.nf),p=Vn(h[1],this.if,this.tf),m=this.cf,y=t;o||(y=[Vn(t[0],this.af,this.ef),Vn(t[1],this.uf,this.sf),Vn(t[2],this.af,this.ef),Vn(t[3],this.uf,this.sf)]);var g=Bn(y,this.pf,void 0,8),w=g[3],b=g[2],x=g[1],j=g[0];if(o||(un(y,this.yf)&&(j=this.rf,x=this.if),un(y,this.gf)&&(b=this.nf,x=this.if),un(y,this.wf)&&(j=this.rf,w=this.tf),un(y,this.bf)&&(b=this.nf,w=this.tf),w=Vn(w,p,this.tf),b=Vn(b,d,this.nf),x=Vn(x,this.if,p),j=Vn(j,this.rf,d)),v=Vn(d=Math.floor(d/e)*e,this.rf,this.nf),f=this.Ff(v,x,w,r,t,0),c=0,o)for(;(v-=e)>=j&&c++r[o]&&(e=o,o=1);var s=Math.max(n[1],r[e]),a=Math.min(n[3],r[o]),u=Vn(n[1]+Math.abs(n[1]-n[3])*this._f,s,a),h=[r[e-1]+(r[o-1]-r[e-1])*(u-r[e])/(r[o]-r[e]),u],c=this.xf[i].geom;return c.setCoordinates(h),c},n.prototype.getMeridians=function(){return this.ff},n.prototype.Df=function(t,n,i,r,e){var o=$m(t,n,i,this.ni,r),s=this.lf[e];return s?(s.setFlatCoordinates(dt,o),s.changed()):s=new Jm(o,dt),s},n.prototype.Uf=function(t,n,i){var r=t.getFlatCoordinates(),e=0,o=r.length-2;r[e]>r[o]&&(e=o,o=0);var s=Math.max(n[0],r[e]),a=Math.min(n[2],r[o]),u=Vn(n[0]+Math.abs(n[0]-n[2])*this.Of,s,a),h=[u,r[e+1]+(r[o+1]-r[e+1])*(u-r[e])/(r[o]-r[e])],c=this.jf[i].geom;return c.setCoordinates(h),c},n.prototype.getParallels=function(){return this.lf},n.prototype.Rf=function(t){var n=Zi("EPSG:4326"),i=t.getWorldExtent();this.tf=i[3],this.nf=i[2],this.if=i[1],this.rf=i[0];var r=or(t,n);if(this.rf=Math.abs(this.if)?this.tf:this.if),this.ni=t},n}(Hm),iy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ry="blur",ey="gradient",oy="radius",sy=["#00f","#0ff","#0f0","#ff0","#f00"];var ay=function(t){function n(n){var i=this,r=n||{},e=k({},r);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,(i=t.call(this,e)||this).Vf=null,i.addChangeListener(ey,i.Jf),i.setGradient(r.gradient?r.gradient:sy),i.setBlur(void 0!==r.blur?r.blur:15),i.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return i.Xf="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return iy(n,t),n.prototype.getBlur=function(){return this.get(ry)},n.prototype.getGradient=function(){return this.get(ey)},n.prototype.getRadius=function(){return this.get(oy)},n.prototype.Jf=function(){this.Vf=function(t){for(var n=1,i=256,r=ho(n,i),e=r.createLinearGradient(0,0,n,i),o=1/(t.length-1),s=0,a=t.length;s>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;n.values.push(r)}}function xy(t,n,i){if(1==t)n.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos>3}s--,1===o||2===o?(a+=t.readSVarint(),u+=t.readSVarint(),1===o&&h>c&&(r.push(h),c=h),i.push(a,u),h+=2):7===o?h>c&&(i.push(i[c],i[c+1]),h+=2):ct(!1,59)}h>c&&(r.push(h),c=h)},n.prototype.tl=function(t,n,i){var r,e=n.type;if(0===e)return null;var o,s=n.properties;this.Kf?(o=s[this.Kf],delete s[this.Kf]):o=n.id,s[this.$f]=n.layer.name;var a=[],u=[];this.Qf(t,n,a,u);var h=function(t,n){var i;1===t?i=1===n?gt.POINT:gt.MULTI_POINT:2===t?i=1===n?gt.LINE_STRING:gt.MULTI_LINE_STRING:3===t&&(i=gt.POLYGON);return i}(e,u.length);if(this.Zf===Wm)(r=new this.Zf(h,a,u,s,o)).transform(i.dataProjection);else{var c=void 0;if(h==gt.POLYGON){for(var f=[],l=0,v=0,d=0,p=u.length;d1?new my(a,dt,f):new je(a,dt,u)}else c=h===gt.POINT?new ne(a,dt):h===gt.LINE_STRING?new Jm(a,dt):h===gt.POLYGON?new je(a,dt,u):h===gt.MULTI_POINT?new dy(a,dt):h===gt.MULTI_LINE_STRING?new ly(a,dt,u):null;r=new(0,this.Zf),this.A&&r.setGeometryName(this.A);var y=hy(c,!1,i);r.setGeometry(y),r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return Fh},n.prototype.readFeatures=function(t,n){var i=this.Lu,r=this.adaptOptions(n),e=Zi(r.dataProjection);e.setWorldExtent(r.extent),r.dataProjection=e;var o=new yy(t),s=o.readFields(wy,{}),a=[];for(var u in s)if(!i||-1!=i.indexOf(u)){var h=s[u],c=h?[0,0,h.extent,h.extent]:null;e.setExtent(c);for(var f=0,l=h.length;f`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var Fy="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gy(t){var n={exports:{}};return t(n,n.exports),n.exports}var qy=Gy((function(t,n){!function(i){var r=n&&!n.nodeType&&n,e=t&&!t.nodeType&&t,o="object"==typeof Fy&&Fy;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,u=2147483647,h=36,c=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function m(t){throw RangeError(v[t])}function y(t,n){for(var i=t.length,r=[];i--;)r[i]=n(t[i]);return r}function g(t,n){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+y((t=t.replace(l,".")).split("."),n).join(".")}function w(t){for(var n,i,r=[],e=0,o=t.length;e=55296&&n<=56319&&e65535&&(n+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+=p(t)})).join("")}function x(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function j(t,n,i){var r=0;for(t=i?d(t/700):t>>1,t+=d(t/n);t>455;r+=h)t=d(t/35);return d(r+36*t/(t+38))}function M(t){var n,i,r,e,o,s,a,c,f,l,v,p=[],y=t.length,g=0,w=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),r=0;r=128&&m("not-basic"),p.push(t.charCodeAt(r));for(e=i>0?i+1:0;e=y&&m("invalid-input"),((c=(v=t.charCodeAt(e++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:h)>=h||c>d((u-g)/s))&&m("overflow"),g+=c*s,!(c<(f=a<=x?1:a>=x+26?26:a-x));a+=h)s>d(u/(l=h-f))&&m("overflow"),s*=l;x=j(g-o,n=p.length+1,0==o),d(g/n)>u-w&&m("overflow"),w+=d(g/n),g%=n,p.splice(g++,0,w)}return b(p)}function S(t){var n,i,r,e,o,s,a,c,f,l,v,y,g,b,M,S=[];for(y=(t=w(t)).length,n=128,i=0,o=72,s=0;s=n&&vd((u-i)/(g=r+1))&&m("overflow"),i+=(a-n)*g,n=a,s=0;su&&m("overflow"),v==n){for(c=i,f=h;!(c<(l=f<=o?1:f>=o+26?26:f-o));f+=h)M=c-l,b=h-l,S.push(p(x(l+M%b,0))),c=d(M/b);S.push(p(x(c,0))),o=j(i,g,r==e),i=0,++r}++i,++n}return S.join("")}if(s={version:"1.3.2",ucs2:{decode:w,encode:b},decode:M,encode:S,toASCII:function(t){return g(t,(function(t){return f.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return c.test(t)?M(t.slice(4).toLowerCase()):t}))}},r&&e)if(t.exports==r)e.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else i.punycode=s}(Fy)})),Dy=function(t){return"string"==typeof t},By=function(t){return"object"==typeof t&&null!==t},Uy=function(t){return null===t},Wy=function(t){return null==t};function Vy(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var Jy=function(t,n,i,r){n=n||"&",i=i||"=";var e={};if("string"!=typeof t||0===t.length)return e;var o=/\+/g;t=t.split(n);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u=0?(h=v.substr(0,d),c=v.substr(d+1)):(h=v,c=""),f=decodeURIComponent(h),l=decodeURIComponent(c),Vy(e,f)?Array.isArray(e[f])?e[f].push(l):e[f]=[e[f],l]:e[f]=l}return e},Xy=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Hy=function(t,n,i,r){return n=n||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(r){var e=encodeURIComponent(Xy(r))+i;return Array.isArray(t[r])?t[r].map((function(t){return e+encodeURIComponent(Xy(t))})).join(n):e+encodeURIComponent(Xy(t[r]))})).join(n):r?encodeURIComponent(Xy(r))+i+encodeURIComponent(Xy(t)):""},Yy=Gy((function(t,n){n.decode=n.parse=Jy,n.encode=n.stringify=Hy}));function Zy(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var $y=/^([a-z0-9.+-]+:)/i,Ky=/:[0-9]*$/,Qy=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,tg=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ng=["'"].concat(tg),ig=["%","/","?",";","#"].concat(ng),rg=["/","?","#"],eg=/^[+a-z0-9A-Z_-]{0,63}$/,og=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sg={javascript:!0,"javascript:":!0},ag={javascript:!0,"javascript:":!0},ug={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function hg(t,n,i){if(t&&By(t)&&t instanceof Zy)return t;var r=new Zy;return r.parse(t,n,i),r}Zy.prototype.parse=function(t,n,i){if(!Dy(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),e=-1!==r&&r127?b+="x":b+=w[x];if(!b.match(eg)){var M=y.slice(0,d),S=y.slice(d+1),_=w.match(og);_&&(M.push(_[1]),S.unshift(_[2])),S.length&&(s="/"+S.join(".")+s),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=qy.toASCII(this.hostname));var O=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+O,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!sg[h])for(d=0,g=ng.length;d0)&&i.host.split("@"))&&(i.auth=_.shift(),i.host=i.hostname=_.shift());return i.search=t.search,i.query=t.query,Uy(i.pathname)&&Uy(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!w.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var x=w.slice(-1)[0],j=(i.host||t.host||w.length>1)&&("."===x||".."===x)||""===x,M=0,S=w.length;S>=0;S--)"."===(x=w[S])?w.splice(S,1):".."===x?(w.splice(S,1),M++):M&&(w.splice(S,1),M--);if(!y&&!g)for(;M--;M)w.unshift("..");!y||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),j&&"/"!==w.join("/").substr(-1)&&w.push("");var _,O=""===w[0]||w[0]&&"/"===w[0].charAt(0);b&&(i.hostname=i.host=O?"":w.length?w.shift():"",(_=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=_.shift(),i.host=i.hostname=_.shift()));return(y=y||i.host&&w.length)&&!O&&w.unshift(""),w.length?i.pathname=w.join("/"):(i.pathname=null,i.path=null),Uy(i.pathname)&&Uy(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},Zy.prototype.parseHost=function(){var t=this.host,n=Ky.exec(t);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(this.hostname=t)};function cg(t){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];for(var r=0,e=n;r":"value"===t.itemType.kind?"array":"array<"+n+">"}return t.kind}var _g=[vg,dg,pg,mg,yg,xg,gg,Mg(wg),jg];function Og(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!Og(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind)for(var i=0,r=_g;i255?255:t}function e(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function s(t){return"%"===t[t.length-1]?e(parseFloat(t)/100):e(parseFloat(t))}function a(t,n,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(n-t)*i*6:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t}try{n.parseCSSColor=function(t){var n,e=t.replace(/ /g,"").toLowerCase();if(e in i)return i[e].slice();if("#"===e[0])return 4===e.length?(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===e.length&&(n=parseInt(e.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var u=e.indexOf("("),h=e.indexOf(")");if(-1!==u&&h+1===e.length){var c=e.substr(0,u),f=e.substr(u+1,h-(u+1)).split(","),l=1;switch(c){case"rgba":if(4!==f.length)return null;l=s(f.pop());case"rgb":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),l];case"hsla":if(4!==f.length)return null;l=s(f.pop());case"hsl":if(3!==f.length)return null;var v=(parseFloat(f[0])%360+360)%360/360,d=s(f[1]),p=s(f[2]),m=p<=.5?p*(d+1):p+d-p*d,y=2*p-m;return[r(255*a(y,m,v+1/3)),r(255*a(y,m,v)),r(255*a(y,m,v-1/3)),l];default:return null}}return null}}catch(t){}})),Eg=function(t,n,i,r){void 0===r&&(r=1),this.r=t,this.g=n,this.b=i,this.a=r};Eg.parse=function(t){if(t){if(t instanceof Eg)return t;if("string"==typeof t){var n=Ag.parseCSSColor(t);if(n)return new Eg(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}}},Eg.prototype.toString=function(){var t=this.toArray(),n=t[0],i=t[1],r=t[2],e=t[3];return"rgba("+Math.round(n)+","+Math.round(i)+","+Math.round(r)+","+e+")"},Eg.prototype.toArray=function(){var t=this,n=t.r,i=t.g,r=t.b,e=t.a;return 0===e?[0,0,0,0]:[255*n/e,255*i/e,255*r/e,e]},Eg.black=new Eg(0,0,0,1),Eg.white=new Eg(1,1,1,1),Eg.transparent=new Eg(0,0,0,0),Eg.red=new Eg(1,0,0,1),Eg.blue=new Eg(0,0,1,1);var Cg=function(t,n,i){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Cg.prototype.compare=function(t,n){return this.collator.compare(t,n)},Cg.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Pg=function(t,n,i,r,e){this.text=t,this.image=n,this.scale=i,this.fontStack=r,this.textColor=e},Ng=function(t){this.sections=t};Ng.fromString=function(t){return new Ng([new Pg(t,null,null,null,null)])},Ng.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},Ng.factory=function(t){return t instanceof Ng?t:Ng.fromString(t)},Ng.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},Ng.prototype.serialize=function(){for(var t=["format"],n=0,i=this.sections;n=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,n,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Rg(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Eg)return!0;if(t instanceof Cg)return!0;if(t instanceof Ng)return!0;if(t instanceof zg)return!0;if(Array.isArray(t)){for(var n=0,i=t;n2){var a=t[1];if("string"!=typeof a||!(a in Dg)||"object"===a)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=Dg[a],r++}else o=wg;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);s=t[2],r++}i=Mg(o,s)}else i=Dg[e];for(var u=[];r1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))};var Ug=function(t){this.type=xg,this.sections=t};Ug.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return n.error("First argument must be an image or text section.");for(var r=[],e=!1,o=1;o<=t.length-1;++o){var s=t[o];if(e&&"object"==typeof s&&!Array.isArray(s)){e=!1;var a=null;if(s["font-scale"]&&!(a=n.parse(s["font-scale"],1,dg)))return null;var u=null;if(s["text-font"]&&!(u=n.parse(s["text-font"],1,Mg(pg))))return null;var h=null;if(s["text-color"]&&!(h=n.parse(s["text-color"],1,yg)))return null;var c=r[r.length-1];c.scale=a,c.font=u,c.textColor=h}else{var f=n.parse(t[o],1,wg);if(!f)return null;var l=f.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");e=!0,r.push({content:f,scale:null,font:null,textColor:null})}}return new Ug(r)},Ug.prototype.evaluate=function(t){return new Ng(this.sections.map((function(n){var i=n.content.evaluate(t);return Lg(i)===jg?new Pg("",i,null,null,null):new Pg(Fg(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)})))},Ug.prototype.eachChild=function(t){for(var n=0,i=this.sections;n-1),i},Wg.prototype.eachChild=function(t){t(this.input)},Wg.prototype.outputDefined=function(){return!1},Wg.prototype.serialize=function(){return["image",this.input.serialize()]};var Vg={"to-boolean":mg,"to-color":yg,"to-number":dg,"to-string":pg},Jg=function(t,n){this.type=t,this.args=n};Jg.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return n.error("Expected one argument.");for(var r=Vg[i],e=[],o=1;o4?"Invalid rbga value "+JSON.stringify(n)+": expected an array containing either three or four numeric values.":Ig(n[0],n[1],n[2],n[3])))return new Eg(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new qg(i||"Could not parse color from value '"+("string"==typeof n?n:String(JSON.stringify(n)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,u=this.args;a=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function tw(t,n){var i,r=(180+t[0])/360,e=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*$g),Math.round(e*o*$g)]}function nw(t,n,i){var r=t[0]-n[0],e=t[1]-n[1],o=t[0]-i[0],s=t[1]-i[1];return r*s-o*e==0&&r*o<=0&&e*s<=0}function iw(t,n,i){return n[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-n[0])*(t[1]-n[1])/(i[1]-n[1])+n[0]}function rw(t,n){for(var i=!1,r=0,e=n.length;r0&&f<0||c<0&&f>0}function sw(t,n,i){for(var r=0,e=i;ri[2]){var e=.5*r,o=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===o&&(o=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=o}Kg(n,t)}function lw(t,n,i,r){for(var e=Math.pow(2,r.z)*$g,o=[r.x*$g,r.y*$g],s=[],a=0,u=t;a=0)return!1;var i=!0;return t.eachChild((function(t){i&&!yw(t,n)&&(i=!1)})),i}dw.parse=function(t,n){if(2!==t.length)return n.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Rg(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;rn))throw new qg("Input is not a number.");s=a-1}return 0}ww.prototype.parse=function(t,n,i,r,e){return void 0===e&&(e={}),n?this.concat(n,i,r)._parse(t,e):this._parse(t,e)},ww.prototype._parse=function(t,n){function i(t,n,i){return"assert"===i?new Bg(n,[t]):"coerce"===i?new Jg(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var e=this.registry[r];if(e){var o=e.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=i(o,s,n.typeAnnotation||"coerce");else o=i(o,s,n.typeAnnotation||"assert")}if(!(o instanceof Gg)&&"resolvedImage"!==o.type.kind&&bw(o)){var u=new Hg;try{o=new Gg(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},ww.prototype.concat=function(t,n,i){var r="number"==typeof t?this.path.concat(t):this.path,e=i?this.scope.concat(i):this.scope;return new ww(this.registry,r,n||null,e,this.errors)},ww.prototype.error=function(t){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var r=""+this.key+n.map((function(t){return"["+t+"]"})).join("");this.errors.push(new fg(r,t))},ww.prototype.checkSubtype=function(t,n){var i=Og(t,n);return i&&this.error(i),i};var jw=function(t,n,i){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(var r=0,e=i;r=s)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=n.parse(a,h,e);if(!c)return null;e=e||c.type,r.push([s,c])}return new jw(e,i,r)},jw.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;return r>=n[e-1]?i[e-1].evaluate(t):i[xw(n,r)].evaluate(t)},jw.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t};var Mw=Sw;function Sw(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function _w(t,n,i){return t*(1-i)+n*i}Sw.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Sw.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Sw.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Sw.prototype.solveCurveX=function(t,n){var i,r,e,o,s;for(void 0===n&&(n=1e-6),e=t,s=0;s<8;s++){if(o=this.sampleCurveX(e)-t,Math.abs(o)(r=1))return r;for(;io?i=e:r=e,e=.5*(r-i)+i}return e},Sw.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var Ow=Object.freeze({__proto__:null,number:_w,color:function(t,n,i){return new Eg(_w(t.r,n.r,i),_w(t.g,n.g,i),_w(t.b,n.b,i),_w(t.a,n.a,i))},array:function(t,n,i){return t.map((function(t,r){return _w(t,n[r],i)}))}}),kw=.95047,Tw=1.08883,Aw=4/29,Ew=6/29,Cw=3*Ew*Ew,Pw=Math.PI/180,Nw=180/Math.PI;function zw(t){return t>.008856451679035631?Math.pow(t,1/3):t/Cw+Aw}function Iw(t){return t>Ew?t*t*t:Cw*(t-Aw)}function Rw(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lw(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fw(t){var n=Lw(t.r),i=Lw(t.g),r=Lw(t.b),e=zw((.4124564*n+.3575761*i+.1804375*r)/kw),o=zw((.2126729*n+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(e-o),b:200*(o-zw((.0193339*n+.119192*i+.9503041*r)/Tw)),alpha:t.a}}function Gw(t){var n=(t.l+16)/116,i=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*Iw(n),i=kw*Iw(i),r=Tw*Iw(r),new Eg(Rw(3.2404542*i-1.5371385*n-.4985314*r),Rw(-.969266*i+1.8760108*n+.041556*r),Rw(.0556434*i-.2040259*n+1.0572252*r),t.alpha)}function qw(t,n,i){var r=n-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var Dw={forward:Fw,reverse:Gw,interpolate:function(t,n,i){return{l:_w(t.l,n.l,i),a:_w(t.a,n.a,i),b:_w(t.b,n.b,i),alpha:_w(t.alpha,n.alpha,i)}}},Bw={forward:function(t){var n=Fw(t),i=n.l,r=n.a,e=n.b,o=Math.atan2(e,r)*Nw;return{h:o<0?o+360:o,c:Math.sqrt(r*r+e*e),l:i,alpha:t.a}},reverse:function(t){var n=t.h*Pw,i=t.c;return Gw({l:t.l,a:Math.cos(n)*i,b:Math.sin(n)*i,alpha:t.alpha})},interpolate:function(t,n,i){return{h:qw(t.h,n.h,i),c:_w(t.c,n.c,i),l:_w(t.l,n.l,i),alpha:_w(t.alpha,n.alpha,i)}}},Uw=Object.freeze({__proto__:null,lab:Dw,hcl:Bw}),Ww=function(t,n,i,r,e){this.type=t,this.operator=n,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,s=e;o1})))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(e=n.parse(e,2,dg)))return null;var u=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=yg:n.expectedType&&"value"!==n.expectedType.kind&&(h=n.expectedType);for(var c=0;c=f)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var p=n.parse(l,d,h);if(!p)return null;h=h||p.type,u.push([f,p])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new Ww(h,i,r,e,u):n.error("Type "+Sg(h)+" is not interpolatable.")},Ww.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;if(r>=n[e-1])return i[e-1].evaluate(t);var o=xw(n,r),s=n[o],a=n[o+1],u=Ww.interpolationFactor(this.interpolation,r,s,a),h=i[o].evaluate(t),c=i[o+1].evaluate(t);return"interpolate"===this.operator?Ow[this.type.kind.toLowerCase()](h,c,u):"interpolate-hcl"===this.operator?Bw.reverse(Bw.interpolate(Bw.forward(h),Bw.forward(c),u)):Dw.reverse(Dw.interpolate(Dw.forward(h),Dw.forward(c),u))},Ww.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n=i.length)throw new qg("Array index out of bounds: "+n+" > "+(i.length-1)+".");if(n!==Math.floor(n))throw new qg("Array index must be an integer, but found "+n+" instead.");return i[n]},Hw.prototype.eachChild=function(t){t(this.index),t(this.input)},Hw.prototype.outputDefined=function(){return!1},Hw.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Yw=function(t,n){this.type=mg,this.needle=t,this.haystack=n};Yw.parse=function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,wg),r=n.parse(t[2],2,wg);return i&&r?kg(i.type,[mg,pg,dg,vg,wg])?new Yw(i,r):n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sg(i.type)+" instead"):null},Yw.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Tg(n,["boolean","string","number","null"]))throw new qg("Expected first argument to be of type boolean, string, number or null, but found "+Sg(Lg(n))+" instead.");if(!Tg(i,["string","array"]))throw new qg("Expected second argument to be of type array or string, but found "+Sg(Lg(i))+" instead.");return i.indexOf(n)>=0},Yw.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Yw.prototype.outputDefined=function(){return!0},Yw.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Zw=function(t,n,i){this.type=dg,this.needle=t,this.haystack=n,this.fromIndex=i};Zw.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,wg),r=n.parse(t[2],2,wg);if(!i||!r)return null;if(!kg(i.type,[mg,pg,dg,vg,wg]))return n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sg(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,dg);return e?new Zw(i,r,e):null}return new Zw(i,r)},Zw.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Tg(n,["boolean","string","number","null"]))throw new qg("Expected first argument to be of type boolean, string, number or null, but found "+Sg(Lg(n))+" instead.");if(!Tg(i,["string","array"]))throw new qg("Expected second argument to be of type array or string, but found "+Sg(Lg(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(n,r)}return i.indexOf(n)},Zw.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Zw.prototype.outputDefined=function(){return!1},Zw.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var $w=function(t,n,i,r,e,o){this.inputType=t,this.type=n,this.input=i,this.cases=r,this.outputs=e,this.otherwise=o};$w.parse=function(t,n){if(t.length<5)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return n.error("Expected an even number of arguments.");var i,r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);for(var e={},o=[],s=2;sNumber.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof l&&Math.floor(l)!==l)return h.error("Numeric branch labels must be integer values.");if(i){if(h.checkSubtype(i,Lg(l)))return null}else i=Lg(l);if(void 0!==e[String(l)])return h.error("Branch labels must be unique.");e[String(l)]=o.length}var v=n.parse(u,s,r);if(!v)return null;r=r||v.type,o.push(v)}var d=n.parse(t[1],1,wg);if(!d)return null;var p=n.parse(t[t.length-1],t.length-1,r);return p?"value"!==d.type.kind&&n.concat(1).checkSubtype(i,d.type)?null:new $w(i,r,d,e,o,p):null},$w.prototype.evaluate=function(t){var n=this.input.evaluate(t);return(Lg(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)},$w.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},$w.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},$w.prototype.serialize=function(){for(var t=this,n=["match",this.input.serialize()],i=[],r={},e=0,o=Object.keys(this.cases).sort();e=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,wg),r=n.parse(t[2],2,dg);if(!i||!r)return null;if(!kg(i.type,[Mg(wg),pg,wg]))return n.error("Expected first argument to be of type array or string, but found "+Sg(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,dg);return e?new Qw(i.type,i,r,e):null}return new Qw(i.type,i,r)},Qw.prototype.evaluate=function(t){var n=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Tg(n,["string","array"]))throw new qg("Expected first argument to be of type array or string, but found "+Sg(Lg(n))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return n.slice(i,r)}return n.slice(i)},Qw.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Qw.prototype.outputDefined=function(){return!1},Qw.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var rb=ib("==",(function(t,n,i){return n===i}),nb),eb=ib("!=",(function(t,n,i){return n!==i}),(function(t,n,i,r){return!nb(0,n,i,r)})),ob=ib("<",(function(t,n,i){return n",(function(t,n,i){return n>i}),(function(t,n,i,r){return r.compare(n,i)>0})),ab=ib("<=",(function(t,n,i){return n<=i}),(function(t,n,i,r){return r.compare(n,i)<=0})),ub=ib(">=",(function(t,n,i){return n>=i}),(function(t,n,i,r){return r.compare(n,i)>=0})),hb=function(t,n,i,r,e){this.type=pg,this.number=t,this.locale=n,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=e};hb.parse=function(t,n){if(3!==t.length)return n.error("Expected two arguments.");var i=n.parse(t[1],1,dg);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");var e=null;if(r.locale&&!(e=n.parse(r.locale,1,pg)))return null;var o=null;if(r.currency&&!(o=n.parse(r.currency,1,pg)))return null;var s=null;if(r["min-fraction-digits"]&&!(s=n.parse(r["min-fraction-digits"],1,dg)))return null;var a=null;return r["max-fraction-digits"]&&!(a=n.parse(r["max-fraction-digits"],1,dg))?null:new hb(i,e,o,s,a)},hb.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},hb.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},hb.prototype.outputDefined=function(){return!1},hb.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var cb=function(t){this.type=dg,this.input=t};cb.parse=function(t,n){if(2!==t.length)return n.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?n.error("Expected argument of type string or array, but found "+Sg(i.type)+" instead."):new cb(i):null},cb.prototype.evaluate=function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new qg("Expected value to be of type string or array, but found "+Sg(Lg(n))+" instead.")},cb.prototype.eachChild=function(t){t(this.input)},cb.prototype.outputDefined=function(){return!1},cb.prototype.serialize=function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t};var fb={"==":rb,"!=":eb,">":sb,"<":ob,">=":ub,"<=":ab,array:Bg,at:Hw,boolean:Bg,case:Kw,coalesce:Jw,collator:Zg,format:Ug,image:Wg,in:Yw,"index-of":Zw,interpolate:Ww,"interpolate-hcl":Ww,"interpolate-lab":Ww,length:cb,let:Xw,literal:Gg,match:$w,number:Bg,"number-format":hb,object:Bg,slice:Qw,step:jw,string:Bg,"to-boolean":Jg,"to-color":Jg,"to-number":Jg,"to-string":Jg,var:gw,within:dw};function lb(t,n){var i=n[0],r=n[1],e=n[2],o=n[3];i=i.evaluate(t),r=r.evaluate(t),e=e.evaluate(t);var s=o?o.evaluate(t):1,a=Ig(i,r,e,s);if(a)throw new qg(a);return new Eg(i/255*s,r/255*s,e/255*s,s)}function vb(t,n){return t in n}function db(t,n){var i=n[t];return void 0===i?null:i}function pb(t){return{type:t}}function mb(t){return{result:"success",value:t}}function yb(t){return{result:"error",value:t}}function gb(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function wb(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function bb(t){return!!t.expression&&t.expression.interpolated}function xb(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function jb(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Mb(t){return t}function Sb(t,n){var i,r,e,o="color"===n.type,s=t.stops&&"object"==typeof t.stops[0][0],a=s||void 0!==t.property,u=s||!a,h=t.type||(bb(n)?"exponential":"interval");if(o&&((t=cg({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],Eg.parse(t[1])]}))),t.default?t.default=Eg.parse(t.default):t.default=Eg.parse(n.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Uw[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===h)i=Tb;else if("interval"===h)i=kb;else if("categorical"===h){i=Ob,r=Object.create(null);for(var c=0,f=t.stops;c=t.stops[r-1][0])return t.stops[r-1][1];var e=xw(t.stops.map((function(t){return t[0]})),i);return t.stops[e][1]}function Tb(t,n,i){var r=void 0!==t.base?t.base:1;if("number"!==xb(i))return _b(t.default,n.default);var e=t.stops.length;if(1===e)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[e-1][0])return t.stops[e-1][1];var o=xw(t.stops.map((function(t){return t[0]})),i),s=function(t,n,i,r){var e=r-i,o=t-i;return 0===e?0:1===n?o/e:(Math.pow(n,o)-1)/(Math.pow(n,e)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],u=t.stops[o+1][1],h=Ow[n.type]||Mb;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=Uw[t.colorSpace];h=function(t,n){return c.reverse(c.interpolate(c.forward(t),c.forward(n),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var i=a.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==r)return h(i,r,s)}}:h(a,u,s)}function Ab(t,n,i){return"color"===n.type?i=Eg.parse(i):"formatted"===n.type?i=Ng.fromString(i.toString()):"resolvedImage"===n.type?i=zg.fromString(i.toString()):xb(i)===n.type||"enum"===n.type&&n.values[i]||(i=void 0),_b(i,t.default,n.default)}Yg.register(fb,{error:[{kind:"error"},[pg],function(t,n){var i=n[0];throw new qg(i.evaluate(t))}],typeof:[pg,[wg],function(t,n){return Sg(Lg(n[0].evaluate(t)))}],"to-rgba":[Mg(dg,4),[yg],function(t,n){return n[0].evaluate(t).toArray()}],rgb:[yg,[dg,dg,dg],lb],rgba:[yg,[dg,dg,dg,dg],lb],has:{type:mg,overloads:[[[pg],function(t,n){return vb(n[0].evaluate(t),t.properties())}],[[pg,gg],function(t,n){var i=n[0],r=n[1];return vb(i.evaluate(t),r.evaluate(t))}]]},get:{type:wg,overloads:[[[pg],function(t,n){return db(n[0].evaluate(t),t.properties())}],[[pg,gg],function(t,n){var i=n[0],r=n[1];return db(i.evaluate(t),r.evaluate(t))}]]},"feature-state":[wg,[pg],function(t,n){return db(n[0].evaluate(t),t.featureState||{})}],properties:[gg,[],function(t){return t.properties()}],"geometry-type":[pg,[],function(t){return t.geometryType()}],id:[wg,[],function(t){return t.id()}],zoom:[dg,[],function(t){return t.globals.zoom}],"heatmap-density":[dg,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[dg,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[dg,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[wg,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[dg,pb(dg),function(t,n){for(var i=0,r=0,e=n;r":[mg,[pg,wg],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>o}],"filter-id->":[mg,[wg],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>e}],"filter-<=":[mg,[pg,wg],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e<=o}],"filter-id-<=":[mg,[wg],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r<=e}],"filter->=":[mg,[pg,wg],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>=o}],"filter-id->=":[mg,[wg],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>=e}],"filter-has":[mg,[wg],function(t,n){return n[0].value in t.properties()}],"filter-has-id":[mg,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[mg,[Mg(pg)],function(t,n){return n[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[mg,[Mg(wg)],function(t,n){return n[0].value.indexOf(t.id())>=0}],"filter-in-small":[mg,[pg,Mg(wg)],function(t,n){var i=n[0];return n[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[mg,[pg,Mg(wg)],function(t,n){var i=n[0],r=n[1];return function(t,n,i,r){for(;i<=r;){var e=i+r>>1;if(n[e]===t)return!0;n[e]>t?r=e-1:i=e+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:mg,overloads:[[[mg,mg],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)&&r.evaluate(t)}],[pb(mg),function(t,n){for(var i=0,r=n;i0&&"string"==typeof t[0]&&t[0]in fb}function Pb(t,n){var i=new ww(fb,[],n?function(t){var n={color:yg,string:pg,number:dg,enum:pg,boolean:mg,formatted:xg,resolvedImage:jg};if("array"===t.type)return Mg(n[t.value]||wg,t.length);return n[t.type]}(n):void 0),r=i.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?mb(new Eb(r,n)):yb(i.errors)}Eb.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Eb.prototype.evaluate=function(t,n,i,r,e,o){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new qg("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Nb=function(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent="constant"!==t&&!mw(n.expression)};Nb.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)},Nb.prototype.evaluate=function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)};var zb=function(t,n,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=n,this.isStateDependent="camera"!==t&&!mw(n.expression),this.interpolationType=r};function Ib(t,n){if("error"===(t=Pb(t,n)).result)return t;var i=t.value.expression,r=pw(i);if(!r&&!gb(n))return yb([new fg("","data expressions not supported")]);var e=yw(i,["zoom"]);if(!e&&!wb(n))return yb([new fg("","zoom expressions not supported")]);var o=Lb(i);if(!o&&!e)return yb([new fg("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof fg)return yb([o]);if(o instanceof Ww&&!bb(n))return yb([new fg("",'"interpolate" expressions cannot be used with this property')]);if(!o)return mb(new Nb(r?"constant":"source",t.value));var s=o instanceof Ww?o.interpolation:void 0;return mb(new zb(r?"camera":"composite",t.value,o.labels,s))}zb.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)},zb.prototype.evaluate=function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)},zb.prototype.interpolationFactor=function(t,n,i){return this.interpolationType?Ww.interpolationFactor(this.interpolationType,t,n,i):0};var Rb=function(t,n){this._parameters=t,this._specification=n,cg(this,Sb(this._parameters,this._specification))};function Lb(t){var n=null;if(t instanceof Xw)n=Lb(t.result);else if(t instanceof Jw)for(var i=0,r=t.args;i3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(i))}function Vb(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function Jb(t){for(var n=["concat"],i=/{([^{}]+)}/g,r=0,e=i.exec(t);null!==e;e=i.exec(t)){var o=t.slice(r,i.lastIndex-e[0].length);r=i.lastIndex,o.length>0&&n.push(o),n.push(["get",e[1]])}if(1===n.length)return t;if(r=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var n=0,i=t.slice(1);nn?1:0}function $b(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n"===i||"<="===i||">="===i?Qb(t[1],t[2],i):"any"===i?(n=t.slice(1),["any"].concat(n.map(Kb))):"all"===i?["all"].concat(t.slice(1).map(Kb)):"none"===i?["all"].concat(t.slice(1).map(Kb).map(ix)):"in"===i?tx(t[1],t.slice(2)):"!in"===i?ix(tx(t[1],t.slice(2))):"has"===i?nx(t[1]):"!has"===i?ix(nx(t[1])):"within"!==i||t}function Qb(t,n,i){switch(t){case"$type":return["filter-type-"+i,n];case"$id":return["filter-id-"+i,n];default:return["filter-"+i,t,n]}}function tx(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return typeof t!=typeof n[0]}))?["filter-in-large",t,["literal",n.sort(Zb)]]:["filter-in-small",t,["literal",n]]}}function nx(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ix(t){return["!",t]}var rx=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ex(t,n){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return rx.forEach((function(t){t in n&&(i[t]=n[t])})),i}var ox=function(t,n,i,r){this.message=(t?t+": ":"")+i,r&&(this.identifier=r),null!=n&&n.ul&&(this.line=n.ul)},sx=function(t){this.error=t,this.message=t.message;var n=t.message.match(/line (\d+)/);this.line=n?parseInt(n[1],10):0};function ax(t){var n=t.key,i=t.value;return i?[new ox(n,i,"constants have been deprecated as of v8")]:[]}function ux(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function hx(t){if(Array.isArray(t))return t.map(hx);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var i in t)n[i]=hx(t[i]);return n}return ux(t)}function cx(t){var n=t.key,i=t.value,r=t.valueSpec||{},e=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],u=xb(i);if("object"!==u)return[new ox(n,i,"object expected, "+u+" found")];for(var h in i){var c=h.split(".")[0],f=r[c]||r["*"],l=void 0;if(e[c])l=e[c];else if(r[c])l=Ax;else if(e["*"])l=e["*"];else{if(!r["*"]){a.push(new ox(n,i[h],'unknown property "'+h+'"'));continue}l=Ax}a=a.concat(l({key:(n?n+".":n)+h,value:i[h],valueSpec:f,style:o,styleSpec:s,object:i,objectKey:h},i))}for(var v in r)e[v]||r[v].required&&void 0===r[v].default&&void 0===i[v]&&a.push(new ox(n,i,'missing required property "'+v+'"'));return a}function fx(t){var n=t.value,i=t.valueSpec,r=t.style,e=t.styleSpec,o=t.key,s=t.arrayElementValidator||Ax;if("array"!==xb(n))return[new ox(o,n,"array expected, "+xb(n)+" found")];if(i.length&&n.length!==i.length)return[new ox(o,n,"array length "+i.length+" expected, length "+n.length+" found")];if(i["min-length"]&&n.lengtha)return[new ox(n,i,i+" is greater than the maximum value "+a)]}return[]}function vx(t){var n,i,r,e=t.valueSpec,o=ux(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,u=!a,h="array"===xb(t.value.stops)&&"array"===xb(t.value.stops[0])&&"object"===xb(t.value.stops[0][0]),c=cx({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new ox(t.key,t.value,'identity function may not have a "stops" property')];var n=[],i=t.value;n=n.concat(fx({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:f})),"array"===xb(i)&&0===i.length&&n.push(new ox(t.key,i,"array must have at least one stop"));return n},default:function(t){return Ax({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&c.push(new ox(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new ox(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!bb(t.valueSpec)&&c.push(new ox(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!gb(t.valueSpec)?c.push(new ox(t.key,t.value,"property functions not supported")):a&&!wb(t.valueSpec)&&c.push(new ox(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!h||void 0!==t.value.property||c.push(new ox(t.key,t.value,'"property" property is required')),c;function f(t){var n=[],o=t.value,a=t.key;if("array"!==xb(o))return[new ox(a,o,"array expected, "+xb(o)+" found")];if(2!==o.length)return[new ox(a,o,"array length 2 expected, length "+o.length+" found")];if(h){if("object"!==xb(o[0]))return[new ox(a,o,"object expected, "+xb(o[0])+" found")];if(void 0===o[0].zoom)return[new ox(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new ox(a,o,"object stop key must have value")];if(r&&r>ux(o[0].zoom))return[new ox(a,o[0].zoom,"stop zoom values must appear in ascending order")];ux(o[0].zoom)!==r&&(r=ux(o[0].zoom),i=void 0,s={}),n=n.concat(cx({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:lx,value:l}}))}else n=n.concat(l({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Cb(hx(o[1]))?n.concat([new ox(a+"[1]",o[1],"expressions are not allowed in function stops.")]):n.concat(Ax({key:a+"[1]",value:o[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function l(t,r){var a=xb(t.value),u=ux(t.value),h=null!==t.value?t.value:r;if(n){if(a!==n)return[new ox(t.key,h,a+" stop domain type must match previous stop domain type "+n)]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new ox(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var c="number expected, "+a+" found";return gb(e)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ox(t.key,h,c)]}return"categorical"!==o||"number"!==a||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===a&&void 0!==i&&u":case">=":n.length>=2&&"$type"===ux(n[1])&&o.push(new ox(i,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&o.push(new ox(i,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(r=xb(n[1]))&&o.push(new ox(i+"[1]",n[1],"string expected, "+r+" found"));for(var s=2;sh&&_.push("'"+this.cl[j]+"'");k=l.showPosition?"Parse error on line "+(a+1)+":\n"+l.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.cl[g]||g)+"'":"Parse error on line "+(a+1)+": Unexpected "+(g==c?"end of input":"'"+(this.cl[g]||g)+"'"),this.parseError(k,{text:l.match,token:this.cl[g]||g,line:l.yylineno,loc:p,expected:_})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+g);switch(b[0]){case 1:i.push(g),r.push(l.yytext),e.push(l.yylloc),i.push(b[1]),g=null,u=l.yyleng,s=l.yytext,a=l.yylineno,p=l.yylloc;break;case 2:if(M=this.fl[b[1]][1],O.$=r[r.length-M],O._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},m&&(O._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),void 0!==(x=this.performAction.apply(O,[s,u,a,v.yy,b[1],r,e].concat(f))))return x;M&&(i=i.slice(0,-1*M*2),r=r.slice(0,-1*M),e=e.slice(0,-1*M)),i.push(this.fl[b[1]][0]),r.push(O.$),e.push(O._$),S=o[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}},l={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var i,r,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in e)this[o]=e[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),o=0;on[0].length)){if(n=i,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[o])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,n,i,r){switch(i){case 0:break;case 1:return 6;case 2:return n.yytext=n.yytext.substr(1,n.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function v(){this.yy={}}return f.lexer=l,v.prototype=f,f.Parser=v,new v}();n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)}}));function Ix(t){if(t instanceof String||"string"==typeof t||t instanceof Buffer)try{return zx.parse(t.toString())}catch(t){throw new sx(t)}return t}function Rx(t,n){void 0===n&&(n=Ly);var i=t;try{i=Ix(i)}catch(t){return[t]}return Cx(i,n)}new Set(["vector","raster","raster-dem"]);var Lx=Cb,Fx=Ib,Gx=Gb,qx=jb;Rx.parsed=Rx,Rx.latest=Rx;"function"==typeof Object.assign&&Object.assign;function Dx(t){return t*Math.PI/180}var Bx=function(){for(var t=[],n=78271.51696402048;t.length<=24;n/=2)t.push(n);return t}();function Ux(t,n){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,n);var i=document.createElement("canvas");return i.width=t,i.height=n,i}var Wx,Vx=Array(256).join(" ");function Jx(t,n){if(n>=.05){for(var i="",r=t.split("\n"),e=Vx.slice(0,Math.round(n/.1)),o=0,s=r.length;o0&&(i+="\n"),i+=r[o].split("").join(e);return i}return t}function Xx(){return Wx||(Wx=Ux(1,1).getContext("2d")),Wx}function Hx(t,n){return Xx().measureText(t).width+(t.length-1)*n}var Yx={};function Zx(t,n,i,r){if(-1!==t.indexOf("\n")){for(var e=t.split("\n"),o=[],s=0,a=e.length;s1){var f=Xx();f.font=n;var l=f.measureText("M").width*i,v="";for(o=[],s=0,a=c.length;s1;++s){var m=o[s];if(Hx(m,r)<.35*l){var y=s>0?Hx(o[s-1],r):1/0,g=s.7*l&&Hx(b,r)<.6*l){var x=w.split(" "),j=x.pop();Hx(j,r)<.2*l&&(o[s]=x.join(" "),o[s+1]=j+" "+b),a-=1}}h=o.join("\n")}else h=t;h=Jx(h,r),Yx[u]=h}return h}ks&&H(ks,I,(function(){Yx={}}));var $x,Kx,Qx=qx,tj=Gx,nj=Lx,ij=Fx,rj={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},ej={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},oj={},sj={zoom:0},aj={};function uj(t,n,i,r,e){var o=t.id;aj[o]||(aj[o]={});var s=aj[o];if(!s[i]){var a=(t[n]||oj)[i],u=Ly[n+"_"+t.type][i];void 0===a&&(a=u.default);var h=nj(a);if(!h&&Qx(a)&&(a=tj(a,u),h=!0),h){var c=function(t,n){var i=ij(t,n);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,u);s[i]=c.evaluate.bind(c)}else"color"==u.type&&(a=Eg.parse(a)),s[i]=function(){return a}}return sj.zoom=r,s[i](sj,e)}var hj={};function cj(t,n){if(t){if(0===t.a||0===n)return;var i=t.a;return n=void 0===n?1:n,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*n+")"}return t}var fj=/^([^]*)\{(.*)\}([^]*)$/;function lj(t,n){var i;do{if(i=t.match(fj)){var r=n[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}var vj=!1;function dj(t,n,i,r,e,o,s){if(void 0===r&&(r=Bx),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var a,u;if(o)if("undefined"!=typeof Image){var h=new Image;h.crossOrigin="anonymous",h.onload=function(){a=h,u=[h.width,h.height],t.changed(),h.onload=null},h.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var c=self;c.postMessage({action:"loadImage",src:o}),c.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,u=[a.width,a.height])}))}for(var f,l=function(t){t=t.slice();for(var n=Object.create(null),i=0;i=m.maxzoom)return"continue";var b=m.filter;if(!b||function(t,n,i,r){return t in hj||(hj[t]=Yb(n).filter),sj.zoom=r,hj[t](sj,i)}(y,b,l,h)){c=m;var x=void 0,j=void 0,T=void 0,A=void 0,E=void 0,C=void 0,P=p.index;if(3==f&&("fill"==m.type||"fill-extrusion"==m.type))if(j=uj(m,"paint",m.type+"-opacity",h,l),m.type+"-pattern"in w){var N=uj(m,"paint",m.type+"-pattern",h,l);if(N){var z="string"==typeof N?lj(N,i):N.toString();if(a&&e&&e[z]){++d,(C=k[d])&&C.getFill()&&!C.getStroke()&&!C.getText()||(C=new Gl({fill:new gl}),k[d]=C),T=C.getFill(),C.setZIndex(P);var I=O[ht=z+"."+j];if(!I)(lt=(ft=Ux((ct=e[z]).width,ct.height)).getContext("2d")).globalAlpha=j,lt.drawImage(a,ct.x,ct.y,ct.width,ct.height,0,0,ct.width,ct.height),I=lt.createPattern(ft,"repeat"),O[ht]=I;T.setColor(I)}}}else(x=cj(uj(m,"paint",m.type+"-color",h,l),j))&&(m.type+"-outline-color"in w&&(E=cj(uj(m,"paint",m.type+"-outline-color",h,l),j)),E||(E=x),++d,(C=k[d])&&C.getFill()&&C.getStroke()&&!C.getText()||(C=new Gl({fill:new gl,stroke:new Pl}),k[d]=C),(T=C.getFill()).setColor(x),(A=C.getStroke()).setColor(E),A.setWidth(1),C.setZIndex(P));if(1!=f&&"line"==m.type){x=!("line-pattern"in w)&&"line-color"in w?cj(uj(m,"paint","line-color",h,l),uj(m,"paint","line-opacity",h,l)):void 0;var R=uj(m,"paint","line-width",h,l);x&&R>0&&(++d,(C=k[d])&&C.getStroke()&&!C.getFill()&&!C.getText()||(C=new Gl({stroke:new Pl}),k[d]=C),(A=C.getStroke()).setLineCap(uj(m,"layout","line-cap",h,l)),A.setLineJoin(uj(m,"layout","line-join",h,l)),A.setMiterLimit(uj(m,"layout","line-miter-limit",h,l)),A.setColor(x),A.setWidth(R),A.setLineDash(w["line-dasharray"]?uj(m,"paint","line-dasharray",h,l).map((function(t){return t*R})):null),C.setZIndex(P))}var L=!1,F=null,G=0,q=void 0,D=void 0,B=void 0;if((1==f||2==f)&&"icon-image"in g){var U=uj(m,"layout","icon-image",h,l);if(U){q="string"==typeof U?lj(U,i):U.toString();var W=void 0;if(a&&e&&e[q]){var V=uj(m,"layout","icon-rotation-alignment",h,l);if(2==f){var J=t.getGeometry();if(J.getFlatMidpoint||J.getFlatMidpoints){var X=J.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/n,2),Math.pow((X[3]-X[1])/n,2)))>150){var H="MultiLineString"===J.getType()?J.getFlatMidpoints():J.getFlatMidpoint();if(Kx||(Kx=new Wm("Point",$x=[NaN,NaN],[],{},null)),W=Kx,$x[0]=H[0],$x[1]=H[1],"line"===(Pt=uj(m,"layout","symbol-placement",h,l))&&"map"===V)for(var Y=J.getStride(),Z=J.getFlatCoordinates(),$=0,K=Z.length-Y;$=rt&&H[0]<=ot&&H[1]>=et&&H[1]<=st){G=Math.atan2(tt-it,nt-Q);break}}}}}if(2!==f||W){var at=uj(m,"layout","icon-size",h,l),ut=void 0!==w["icon-color"]?uj(m,"paint","icon-color",h,l):null;if(!ut||0!==ut.a){var ht=q+"."+at;if(null!==ut&&(ht+="."+ut),!(D=_[ht])){var ct=e[q];if(null!==ut){var ft,lt;(lt=(ft=Ux(ct.width,ct.height)).getContext("2d")).drawImage(a,ct.x,ct.y,ct.width,ct.height,0,0,ct.width,ct.height);for(var vt=lt.getImageData(0,0,ft.width,ft.height),dt=0,pt=vt.data.length;dt0?new Pl({width:bt,color:gt}):void 0,fill:wt?new gl({color:wt}):void 0}),_[xt]=D),C.setImage(D),F=C.getText(),C.setText(void 0),C.setGeometry(void 0),C.setZIndex(P),L=!0}var jt=void 0;if("text-field"in g)jt=lj(uj(m,"layout","text-field",h,l).toString(),i).trim(),j=uj(m,"paint","text-opacity",h,l);if(jt&&j&&!B){L||(++d,(C=k[d])&&C.getText()&&!C.getFill()&&!C.getStroke()||(C=new Gl,k[d]=C),C.setImage(void 0),C.setGeometry(void 0)),C.getText()||C.setText(F||new Bl({padding:[2,2,2,2]})),F=C.getText();var Mt=Math.round(uj(m,"layout","text-size",h,l)),St=uj(m,"layout","text-font",h,l),_t=uj(m,"layout","text-line-height",h,l),Ot=Ry(s?s(St):St,Mt,_t),kt=g["text-transform"];"uppercase"==kt?jt=jt.toUpperCase():"lowercase"==kt&&(jt=jt.toLowerCase());var Tt=uj(m,"layout","text-max-width",h,l),At=uj(m,"layout","text-letter-spacing",h,l),Et=2==f?Jx(jt,At):Zx(jt,Ot,Tt,At);F.setText(Et),F.setFont(Ot),F.setRotation(Dx(uj(m,"layout","text-rotate",h,l)));var Ct=uj(m,"layout","text-anchor",h,l),Pt=L||1==f?"point":uj(m,"layout","symbol-placement",h,l);F.setPlacement(Pt);var Nt=uj(m,"paint","text-halo-width",h,l),zt=uj(m,"layout","text-offset",h,l),It=uj(m,"paint","text-translate",h,l),Rt=0,Lt=0;if("point"==Pt){var Ft="center";-1!==Ct.indexOf("left")?(Ft="left",Lt=Nt):-1!==Ct.indexOf("right")&&(Ft="right",Lt=-Nt),F.setTextAlign(Ft);var Gt=uj(m,"layout","text-rotation-alignment",h,l);F.setRotateWithView("map"==Gt)}else F.setMaxAngle(Dx(uj(m,"layout","text-max-angle",h,l))*jt.length/Et.length),F.setTextAlign(),F.setRotateWithView(!1);var qt="middle";0==Ct.indexOf("bottom")?(qt="bottom",Rt=-Nt-.5*(_t-1)*Mt):0==Ct.indexOf("top")&&(qt="top",Rt=Nt+.5*(_t-1)*Mt),F.setTextBaseline(qt),F.setOffsetX(zt[0]*Mt+Lt+It[0]),F.setOffsetY(zt[1]*Mt+Rt+It[1]),S.setColor(cj(uj(m,"paint","text-color",h,l),j)),F.setFill(S);var Dt=cj(uj(m,"paint","text-halo-color",h,l),j);if(Dt){M.setColor(Dt),Nt*=2;var Bt=.5*Mt;M.setWidth(Nt<=Bt?Nt:Bt),F.setStroke(M)}else F.setStroke(void 0);var Ut=uj(m,"layout","text-padding",h,l),Wt=F.getPadding();Ut!==Wt[0]&&(Wt[0]=Ut,Wt[1]=Ut,Wt[2]=Ut,Wt[3]=Ut),C.setZIndex(P)}}},m=0,y=o.length;m-1?(k.length=d+1,vj&&("function"==typeof t.set?t.set("mapbox-layer",c):t.getProperties()["mapbox-layer"]=c),k):void 0}};return t.setStyle(T),t.set("mapbox-source",f),t.set("mapbox-layers",d),T}var pj,mj=i(975),yj=/font-family: ?([^;]*);/,gj=/("|')/g;function wj(t){if(!pj){pj={};for(var n=document.styleSheets,i=0,r=n.length;i2?r[2]:""):t+i}function Oj(t,n,i,r,e){return new Promise((function(o,s){if("object"!=typeof n&&(n=JSON.parse(n)),8!=n.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Hm||t instanceof _y))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,u,h;function c(){h||n.sprite&&!a?h?(t.setStyle(h),o()):s(new Error("Something went wrong trying to apply style.")):(h=dj(t,n,i,e,a,u,jj),t.getStyle()?o():s(new Error("Nothing to show for source ["+i+"]")))}if(n.sprite){var f=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",l=_j(n.sprite,r,f+".json");fetch(l,{credentials:"same-origin"}).then((function(t){return t.ok||""===f?t:(l=_j(n.sprite,r,".json"),fetch(l,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from "+l+": "+t.statusText))})).then((function(t){if(void 0===t)return s(new Error("No sprites found."));a=t,u=_j(n.sprite,r,f+".png"),c()})).catch((function(t){s(new Error("Sprites cannot be loaded: "+l+": "+t.message))}))}else c()}))}new Iy;var kj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tj="https://api.mapbox.com";function Aj(t){var n="mapbox://";return 0!==t.indexOf(n)?"":t.slice(n.length)}function Ej(t,n){var i=Aj(t);if(!i)return t;var r="sprites/";if(0!==i.indexOf(r))throw new Error("unexpected sprites url: "+t);var e=i.slice(r.length);return Tj+"/styles/v1/"+e+"/sprite?access_token="+n}function Cj(t,n){var i=Aj(t);if(!i)return t;var r="fonts/";if(0!==i.indexOf(r))throw new Error("unexpected fonts url: "+t);var e=i.slice(r.length);return Tj+"/fonts/v1/"+e+"/0-255.pbf?access_token="+n}function Pj(t,n){var i=Aj(t);if(!i)return t;var r="styles/";if(0!==i.indexOf(r))throw new Error("unexpected style url: "+t);var e=i.slice(r.length);return Tj+"/styles/v1/"+e+"?&access_token="+n}function Nj(t,n){var i=Aj(t);return i?"https://{a-d}.tiles.mapbox.com/v4/"+i+"/{z}/{x}/{y}.vector.pbf?access_token="+n:t}var zj=function(t){function n(n){var i=t.call(this,z)||this;return i.error=n,i}return kj(n,t),n}(c),Ij="vector",Rj=function(t){function n(n){var i=this,r=!("declutter"in n)||n.declutter,e=new bp({state:Zo,format:new My});return(i=t.call(this,{source:e,declutter:r,className:n.className,opacity:n.opacity,visible:n.visible,zIndex:n.zIndex,minResolution:n.minResolution,maxResolution:n.maxResolution,minZoom:n.minZoom,maxZoom:n.maxZoom,renderOrder:n.renderOrder,renderBuffer:n.renderBuffer,renderMode:n.renderMode,map:n.map,updateWhileAnimating:n.updateWhileAnimating,updateWhileInteracting:n.updateWhileInteracting,preload:n.preload,useInterimTilesOnError:n.useInterimTilesOnError,properties:n.properties})||this).sourceId=n.source,i.layers=n.layers,i.accessToken=n.accessToken,i.fetchStyle(n.styleUrl),i}return kj(n,t),n.prototype.fetchStyle=function(t){var n=this,i=Pj(t,this.accessToken);fetch(i).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: "+t.status);return t.json()})).then((function(t){n.onStyleLoad(t)})).catch((function(t){n.handleError(t)}))},n.prototype.onStyleLoad=function(t){var n,i,r=this;if(this.layers){for(var e={},o=0;o0){this.gl&&(this.gl.clear(),this.gl.addFeatures(f)),this.dispatchEvent(new Uj(Bj,t,f,o));break}}},n.prototype.xl=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this.yl=[H(n,D,this.handleDrop,this),H(n,G,this.handleStop,this),H(n,q,this.handleStop,this),H(n,D,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.xl(),this.getActive()&&!n&&this.jl(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.jl(),t.prototype.setMap.call(this,n),this.getActive()&&this.xl()},n.prototype.bl=function(t,n,i){try{return t.readFeatures(n,i)}catch(t){return null}},n.prototype.jl=function(){this.yl&&(this.yl.forEach(Z),this.yl=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,i=0,r=n.length;i1?1:-1;return n.endInteraction(this.gr,i),this.he=0,!1},n.prototype.handleDownEvent=function(t){return!!xu(t)&&(!!this.Cr(t)&&(t.map.getView().beginInteraction(),this.Nr=void 0,this.Ml=void 0,!0))},n}(uu),Xj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hj=function(t){function n(n,i,r){var e=t.call(this)||this;if(void 0!==r&&void 0===i)e.setFlatCoordinates(r,n);else{var o=i||0;e.setCenterAndRadius(n,o,r)}return e}return Xj(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=t-e[0],s=n-e[1],a=o*o+s*s;if(a=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||_n(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,i=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+i;for(var e=1;e=this.Rl?(this.Ol=n.pixel,this._l=!this.El,i=!0):this.Tl=void 0,this._l&&void 0!==this.kl&&(clearTimeout(this.kl),this.kl=void 0));return this.El&&n.type===Hs.POINTERDRAG&&null!==this.Fl?(this.Xl(n.coordinate),r=!1):this.El&&n.type===Hs.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=n.type===Hs.POINTERMOVE)&&this.El?(this.In(n),this._l&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===Hs.POINTERDRAG&&void 0===this.kl)&&this.In(n):n.type===Hs.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this._l=!this.El,this.El?(this.Ol=t.pixel,this.Ll||this.Hl(t.coordinate),!0):this.Cr(t)?(this.Tl=Date.now(),this.kl=setTimeout(function(){this.In(new Xs(Hs.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Rl),this.Ol=t.pixel,!0):(this.Tl=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.In(t),this._l){var i=!this.Ll;i&&this.Hl(t.coordinate),!i&&this.El?this.finishDrawing():this.El||i&&this.Kr!==$j||(this.Yl(t.pixel)?this.Il(t)&&this.finishDrawing():this.Xl(t.coordinate)),n=!1}else this.El&&this.abortDrawing();return!n&&this.Pl&&t.preventDefault(),n},n.prototype.In=function(t){if(this.Al=t.originalEvent.pointerType,this.Ol&&(!this.El&&this._l||this.El&&!this._l)){var n=this.Ol,i=t.pixel,r=n[0]-i[0],e=n[1]-i[1],o=r*r+e*e;if(this._l=this.El?o>this.Ul:o<=this.Ul,!this._l)return}this.Ll?this.Zl(t.coordinate):this.$l(t)},n.prototype.Yl=function(t){var n=!1;if(this.Fl){var i=!1,r=[this.Ll],e=this.Kr;if(e===$j)n=!0;else if(e===tM)n=2===this.ql.length;else if(e===Kj)i=this.ql.length>this.Nl;else if(e===Qj){var o=this.ql;i=o[0].length>this.Nl,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,u=r.length;a=this.zl&&(this.El?i.pop():n=!0),i.push(t.slice()),this.Ps(i,r,e)):o===Qj&&((i=this.ql[0]).length>=this.zl&&(this.El?i.pop():n=!0),i.push(t.slice()),n&&(this.Ll=i[0]),this.Ps(this.ql,r,e)),this.Kl(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Fl){var t,n=this.Fl.getGeometry(),i=this.getMap().getView().getProjection(),r=this.Kr;if(r===Kj||r===tM){if((t=this.ql).splice(-2,1),t.length>=2){this.Ll=t[t.length-2].slice();var e=this.Ll.slice();t[t.length-1]=e,this.Gl.setGeometry(new ne(e))}this.Ps(t,n,i),n.getType()===gt.POLYGON&&this.Dl&&this.Ql(n)}else if(r===Qj){(t=this.ql[0]).splice(-2,1);var o=this.Dl.getGeometry();if(t.length>=2){e=t[t.length-2].slice();t[t.length-1]=e,this.Gl.setGeometry(new ne(e))}o.setCoordinates(t),this.Ps(this.ql,n,i)}1===t.length&&this.abortDrawing(),this.Kl()}},n.prototype.finishDrawing=function(){var t=this.tv();if(t){var n=this.ql,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.Kr===Kj?(n.pop(),this.Ps(n,i,r)):this.Kr===Qj&&(n[0].pop(),this.Ps(n,i,r),n=i.getCoordinates()),this.Xc===gt.MULTI_POINT?t.setGeometry(new dy([n])):this.Xc===gt.MULTI_LINE_STRING?t.setGeometry(new ly([n])):this.Xc===gt.MULTI_POLYGON&&t.setGeometry(new my([n])),this.dispatchEvent(new eM(iM,t)),this.we&&this.we.push(t),this.gl&&this.gl.addFeature(t)}},n.prototype.tv=function(){this.Ll=null;var t=this.Fl;return this.Fl=null,this.Gl=null,this.Dl=null,this.Wl.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.tv();t&&this.dispatchEvent(new eM(rM,t))},n.prototype.appendCoordinates=function(t){var n,i=this.Kr,r=!this.Fl;if(r&&this.Hl(t[0]),i===Kj||i===tM)n=this.ql;else{if(i!==Qj)return;n=this.ql&&this.ql.length?this.ql[0]:[]}r&&n.shift(),n.pop();for(var e=0;ef?o[1]:o[0]),s}}return null},n.prototype.In=function(t){var n=t.pixel,i=t.map,r=this.uv(n,i);r||(r=i.getCoordinateFromPixelInternal(n)),this.hv(r)},n.prototype.cv=function(t){var n=this.ev;return n?t?n.setGeometry(Se(t)):n.setGeometry(void 0):(n=new vt(t?Se(t):{}),this.ev=n,this.sv.getSource().addFeature(n)),n},n.prototype.hv=function(t){var n=this.ov;n?n.getGeometry().setCoordinates(t):(n=new vt(new ne(t)),this.ov=n,this.av.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Cr(n)||(n.type!=Hs.POINTERMOVE||this.handlingDownUpSequence||this.In(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,i=t.map,r=this.getExtentInternal(),e=this.uv(n,i),o=function(t){var n=null,i=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==n&&null!==i?[n,i]:null};if(e&&r){var s=e[0]==r[0]||e[0]==r[2]?e[0]:null,a=e[1]==r[1]||e[1]==r[3]?e[1]:null;null!==s&&null!==a?this.nv=cM(o(e)):null!==s?this.nv=fM(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.nv=fM(o([r[0],a]),o([r[2],a])))}else e=i.getCoordinateFromPixelInternal(n),this.setExtent([e[0],e[1],e[0],e[1]]),this.nv=cM(e);return!0},n.prototype.handleDragEvent=function(t){if(this.nv){var n=t.coordinate;this.setExtent(this.nv(n)),this.hv(n)}},n.prototype.handleUpEvent=function(t){this.nv=null;var n=this.getExtentInternal();return n&&0!==On(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.sv.setMap(n),this.av.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return vr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.B},n.prototype.setExtent=function(t){this.B=t||null,this.cv(t),this.dispatchEvent(new uM(this.B))},n}(uu),vM=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dM=[0,0,0,0],pM=[],mM="modifystart",yM="modifyend",gM=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.features=i,e.mapBrowserEvent=r,e}return vM(n,t),n}(c);function wM(t,n){return t.index-n.index}function bM(t,n,i){var r=n.geometry;if(r.getType()===gt.CIRCLE){var e=r;if(1===n.index){var o=cr();o&&(e=e.clone().transform(o,i));var s=qi(e.getCenter(),lr(t,i)),a=Math.sqrt(s)-e.getRadius();return a*a}}var u=lr(t,i);return pM[0]=lr(n.segment[0],i),pM[1]=lr(n.segment[1],i),Bi(u,pM)}function xM(t,n,i){var r=n.geometry;if(r.getType()===gt.CIRCLE&&1===n.index){var e=r,o=cr();return o&&(e=e.clone().transform(o,i)),fr(e.getClosestPoint(lr(t,i)),i)}var s=lr(t,i);return pM[0]=lr(n.segment[0],i),pM[1]=lr(n.segment[1],i),fr(zi(s,pM),i)}var jM=function(t){function n(n){var i,r,e=t.call(this,n)||this;if(e.on,e.once,e.un,e.fv=e.eu.bind(e),e.Cr=n.condition?n.condition:ju,e.lv=function(t){return cu(t)&&yu(t)},e.vv=n.deleteCondition?n.deleteCondition:e.lv,e.dv=n.insertVertexCondition?n.insertVertexCondition:du,e.ov=null,e.pv=null,e.mv=[0,0],e.yv=!1,e.gv=null,e.wv=new Vl,e.iv=void 0!==n.pixelTolerance?n.pixelTolerance:10,e.rv=!1,e.bv=!1,e.xv=[],e.Wl=new Hm({source:new kv({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:(i=Ll(),function(t,n){return i[gt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.jv={Point:e.Mv.bind(e),LineString:e.Sv.bind(e),LinearRing:e.Sv.bind(e),Polygon:e._v.bind(e),MultiPoint:e.Ov.bind(e),MultiLineString:e.kv.bind(e),MultiPolygon:e.Tv.bind(e),Circle:e.Av.bind(e),GeometryCollection:e.Ev.bind(e)},e.gl=null,e.Cv=null,n.features?r=n.features:n.source&&(e.gl=n.source,r=new ht(e.gl.getFeatures()),e.gl.addEventListener(gv,e.Pv.bind(e)),e.gl.addEventListener(xv,e.Nv.bind(e))),!r)throw new Error("The modify interaction requires features, a source or a layer");return n.hitDetection&&(e.Cv=n.hitDetection),e.we=r,e.we.forEach(e.zv.bind(e)),e.we.addEventListener(et,e.Iv.bind(e)),e.we.addEventListener(ot,e.Rv.bind(e)),e.Lv=null,e.Sr=[0,0],e.Fv=void 0===n.snapToPointer?!e.Cv:n.snapToPointer,e}return vM(n,t),n.prototype.zv=function(t){var n=t.getGeometry();if(n){var i=this.jv[n.getType()];i&&i(t,n)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.Gv(this.mv,r),t.addEventListener(N,this.fv)},n.prototype.qv=function(t,n){if(!this.gv){this.gv=new ht;for(var i=this.gv.getArray(),r=0,e=n.length;r=0;--r){for(var e=i[r],o=this.xv.length-1;o>=0;--o)this.xv[o][0]===e&&this.xv.splice(o,1);n.remove(e)}},n.prototype.setActive=function(n){this.ov&&!n&&(this.Wl.getSource().removeFeature(this.ov),this.ov=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Wl.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Wl},n.prototype.Pv=function(t){t.feature&&this.we.push(t.feature)},n.prototype.Nv=function(t){t.feature&&this.we.remove(t.feature)},n.prototype.Iv=function(t){this.zv(t.element)},n.prototype.eu=function(t){if(!this.bv){var n=t.target;this.Dv(n),this.zv(n)}},n.prototype.Rv=function(t){var n=t.element;this.Dv(n)},n.prototype.Mv=function(t,n){var i=n.getCoordinates(),r={feature:t,geometry:n,segment:[i,i]};this.wv.insert(n.getExtent(),r)},n.prototype.Ov=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r=0;--m)this.Vv(o[m],s)}return!!this.ov},n.prototype.handleUpEvent=function(t){for(var n=this.xv.length-1;n>=0;--n){var i=this.xv[n][0],r=i.geometry;if(r.getType()===gt.CIRCLE){var e=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=e,o.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.wv.update(pn(e),o);var a=r,u=cr();if(u){var h=t.map.getView().getProjection();a=_e(a=a.clone().transform(u,h)).transform(h,u)}this.wv.update(a.getExtent(),s)}else this.wv.update(en(i.segment),i)}return this.gv&&(this.dispatchEvent(new gM(yM,this.gv,t)),this.gv=null),!1},n.prototype.In=function(t){this.mv=t.pixel,this.Gv(t.pixel,t.map,t.coordinate)},n.prototype.Gv=function(t,n,i){var r,o,s=this,a=i||n.getCoordinateFromPixel(t),u=n.getView().getProjection();if(this.Cv){var h="object"==typeof this.Cv?function(t){return t===s.Cv}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,i){if((i=i||t.getGeometry()).getType()===gt.POINT&&p(s.we.getArray(),t)){o=i;var e=i.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:i,segment:[e,e]}]}return!0}),{layerFilter:h})}if(!r){var c=vr(on(dr(pn(a,dM),u),n.getView().getResolution()*this.iv,dM),u);r=this.wv.getInExtent(c)}if(r&&r.length>0){var f=r.sort((function(t,n){return bM(a,t,u)-bM(a,n,u)}))[0],l=f.segment,v=xM(a,f,u),d=n.getPixelFromCoordinate(v),m=Di(t,d);if(o||m<=this.iv){var y={};if(y[e(l)]=!0,this.Fv||(this.Sr[0]=v[0]-a[0],this.Sr[1]=v[1]-a[1]),f.geometry.getType()===gt.CIRCLE&&1===f.index)this.rv=!0,this.Uv(v,[f.feature],[f.geometry]);else{var g=n.getPixelFromCoordinate(l[0]),w=n.getPixelFromCoordinate(l[1]),b=qi(d,g),x=qi(d,w);m=Math.sqrt(Math.min(b,x)),this.rv=m<=this.iv,this.rv&&(v=b>x?l[1]:l[0]),this.Uv(v,[f.feature],[f.geometry]);var j={};j[e(f.geometry)]=!0;for(var M=1,S=r.length;M=0;--o)f=e((c=(i=l[o])[0]).feature),c.depth&&(f+="-"+c.depth.join("-")),f in v||(v[f]={}),0===i[1]?(v[f].right=c,v[f].index=c.index):1==i[1]&&(v[f].left=c,v[f].index=c.index+1);for(f in v){switch(h=v[f].right,a=v[f].left,(u=(s=v[f].index)-1)<0&&(u=0),t=n=(r=(c=void 0!==a?a:h).geometry).getCoordinates(),d=!1,r.getType()){case gt.MULTI_LINE_STRING:n[c.depth[0]].length>2&&(n[c.depth[0]].splice(s,1),d=!0);break;case gt.LINE_STRING:n.length>2&&(n.splice(s,1),d=!0);break;case gt.MULTI_POLYGON:t=t[c.depth[1]];case gt.POLYGON:(t=t[c.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.Wv(r,n);var p=[];if(void 0!==a&&(this.wv.remove(a),p.push(a.segment[0])),void 0!==h&&(this.wv.remove(h),p.push(h.segment[1])),void 0!==a&&void 0!==h){var m={depth:c.depth,feature:c.feature,geometry:c.geometry,index:u,segment:p};this.wv.insert(en(m.segment),m)}this.Jv(r,s,c.depth,-1),this.ov&&(this.Wl.getSource().removeFeature(this.ov),this.ov=null),l.length=0}}return d},n.prototype.Wv=function(t,n){this.bv=!0,t.setCoordinates(n),this.bv=!1},n.prototype.Jv=function(t,n,i,r){this.wv.forEachInExtent(t.getExtent(),(function(e){e.geometry===t&&(void 0===i||void 0===e.depth||b(e.depth,i))&&e.index>n&&(e.index+=r)}))},n}(uu),MM=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),SM="select",_M=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=e,o}return MM(n,t),n}(c),OM={};var kM=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r,e,o=n||{};if(i.Hv=i.zv.bind(i),i.Yv=i.Dv.bind(i),i.Cr=o.condition?o.condition:yu,i.Zv=o.addCondition?o.addCondition:mu,i.$v=o.removeCondition?o.removeCondition:mu,i.Kv=o.toggleCondition?o.toggleCondition:wu,i.Qv=!!o.multi&&o.multi,i.td=o.filter?o.filter:M,i.rd=o.hitTolerance?o.hitTolerance:0,i.C=void 0!==o.style?o.style:(g((r=Ll())[gt.POLYGON],r[gt.LINE_STRING]),g(r[gt.GEOMETRY_COLLECTION],r[gt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.we=o.features||new ht,o.layers)if("function"==typeof o.layers)e=o.layers;else{var s=o.layers;e=function(t){return p(s,t)}}else e=M;return i.ed=e,i.od={},i}return MM(n,t),n.prototype.sd=function(t,n){this.od[e(t)]=n},n.prototype.getFeatures=function(){return this.we},n.prototype.getHitTolerance=function(){return this.rd},n.prototype.getLayer=function(t){return this.od[e(t)]},n.prototype.setHitTolerance=function(t){this.rd=t},n.prototype.setMap=function(n){this.getMap()&&this.C&&this.we.forEach(this.ad.bind(this)),t.prototype.setMap.call(this,n),n?(this.we.addEventListener(et,this.Hv),this.we.addEventListener(ot,this.Yv),this.C&&this.we.forEach(this.ud.bind(this))):(this.we.removeEventListener(et,this.Hv),this.we.removeEventListener(ot,this.Yv))},n.prototype.zv=function(t){var n=t.element;this.C&&this.ud(n)},n.prototype.Dv=function(t){var n=t.element;this.C&&this.ad(n)},n.prototype.getStyle=function(){return this.C},n.prototype.ud=function(t){var n=e(t);n in OM||(OM[n]=t.getStyle()),t.setStyle(this.C)},n.prototype.ad=function(t){for(var i=this.getMap().getInteractions().getArray(),r=i.length-1;r>=0;--r){var o=i[r];if(o!==this&&o instanceof n&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var s=e(t);t.setStyle(OM[s]),delete OM[s]},n.prototype.hd=function(t){delete this.od[e(t)]},n.prototype.handleEvent=function(t){if(!this.Cr(t))return!0;var n=this.Zv(t),i=this.$v(t),r=this.Kv(t),e=!n&&!i&&!r,o=t.map,s=this.getFeatures(),a=[],u=[];if(e){T(this.od),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.td(t,n))return u.push(t),this.sd(t,n),!this.Qv}.bind(this),{layerFilter:this.ed,hitTolerance:this.rd});for(var h=s.getLength()-1;h>=0;--h){var c=s.item(h),f=u.indexOf(c);f>-1?u.splice(f,1):(s.remove(c),a.push(c))}0!==u.length&&s.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.td(t,e))return!n&&!r||p(s.getArray(),t)?(i||r)&&p(s.getArray(),t)&&(a.push(t),this.hd(t)):(u.push(t),this.sd(t,e)),!this.Qv}.bind(this),{layerFilter:this.ed,hitTolerance:this.rd});for(var l=a.length-1;l>=0;--l)s.remove(a[l]);s.extend(u)}return(u.length>0||a.length>0)&&this.dispatchEvent(new _M(SM,u,a,t)),!0},n}(ru),TM=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function AM(t){return t.feature?t.feature:t.element?t.element:void 0}var EM=[],CM=function(t){function n(n){var i=this,r=n||{},e=r;return e.handleDownEvent||(e.handleDownEvent=M),e.stopDown||(e.stopDown=S),(i=t.call(this,e)||this).gl=r.source?r.source:null,i.fd=void 0===r.vertex||r.vertex,i.ld=void 0===r.edge||r.edge,i.we=r.features?r.features:null,i.vd=[],i.dd={},i.pd={},i.md={},i.iv=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.wv=new Vl,i.jv={Point:i.Mv.bind(i),LineString:i.Sv.bind(i),LinearRing:i.Sv.bind(i),Polygon:i._v.bind(i),MultiPoint:i.Ov.bind(i),MultiLineString:i.kv.bind(i),MultiPolygon:i.Tv.bind(i),GeometryCollection:i.Ev.bind(i),Circle:i.Av.bind(i)},i}return TM(n,t),n.prototype.addFeature=function(t,n){var i=void 0===n||n,r=e(t),o=t.getGeometry();if(o){var s=this.jv[o.getType()];s&&(this.pd[r]=o.getExtent([1/0,1/0,-1/0,-1/0]),s(t,o))}i&&(this.dd[r]=H(t,N,this.eu,this))},n.prototype.yd=function(t){this.addFeature(t)},n.prototype.gd=function(t){this.removeFeature(t)},n.prototype.wd=function(){var t;return this.we?t=this.we:this.gl&&(t=this.gl.getFeatures()),t},n.prototype.handleEvent=function(n){var i=this.snapTo(n.pixel,n.coordinate,n.map);return i.snapped&&(n.coordinate=i.vertex.slice(0,2),n.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.Iv=function(t){var n=AM(t);this.addFeature(n)},n.prototype.Rv=function(t){var n=AM(t);this.removeFeature(n)},n.prototype.eu=function(t){var n=t.target;if(this.handlingDownUpSequence){var i=e(n);i in this.md||(this.md[i]=n)}else this.bd(n)},n.prototype.handleUpEvent=function(t){var n=A(this.md);return n.length&&(n.forEach(this.bd.bind(this)),this.md={}),!1},n.prototype.removeFeature=function(t,n){var i=void 0===n||n,r=e(t),o=this.pd[r];if(o){var s=this.wv,a=[];s.forEachInExtent(o,(function(n){t===n.feature&&a.push(n)}));for(var u=a.length-1;u>=0;--u)s.remove(a[u])}i&&(Z(this.dd[r]),delete this.dd[r])},n.prototype.setMap=function(n){var i=this.getMap(),r=this.vd,e=this.wd();i&&(r.forEach(Z),r.length=0,e.forEach(this.gd.bind(this))),t.prototype.setMap.call(this,n),n&&(this.we?r.push(H(this.we,et,this.Iv,this),H(this.we,ot,this.Rv,this)):this.gl&&r.push(H(this.gl,gv,this.Iv,this),H(this.gl,xv,this.Rv,this)),e.forEach(this.yd.bind(this)))},n.prototype.snapTo=function(t,n,i){var r=en([i.getCoordinateFromPixel([t[0]-this.iv,t[1]+this.iv]),i.getCoordinateFromPixel([t[0]+this.iv,t[1]-this.iv])]),e=this.wv.getInExtent(r);this.fd&&!this.ld&&(e=e.filter((function(t){return t.feature.getGeometry().getType()!==gt.CIRCLE})));var o=!1,s=null,a=null;if(0===e.length)return{snapped:o,vertex:s,vertexPixel:a};for(var u,h=i.getView().getProjection(),c=lr(n,h),f=1/0,l=0;lw?p[1]:p[0],a=i.getPixelFromCoordinate(s))}else if(this.ld){var b=u.feature.getGeometry().getType()===gt.CIRCLE;if(b){var x=u.feature.getGeometry(),j=cr();j&&(x=x.clone().transform(j,h)),s=fr(Ni(c,x),h)}else EM[0]=lr(p[0],h),EM[1]=lr(p[1],h),s=fr(zi(c,EM),h);if(Di(t,a=i.getPixelFromCoordinate(s))<=this.iv&&(o=!0,this.fd&&!b)){m=i.getPixelFromCoordinate(p[0]),y=i.getPixelFromCoordinate(p[1]),g=qi(a,m),w=qi(a,y);Math.sqrt(Math.min(g,w))<=this.iv&&(s=g>w?p[1]:p[0],a=i.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},n.prototype.bd=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},n.prototype.Av=function(t,n){var i=this.getMap().getView().getProjection(),r=n,e=cr();e&&(r=r.clone().transform(e,i));var o=_e(r);e&&o.transform(i,e);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a=0;i--){var h=o[i][0];if(hn(new Qr(h).getExtent(),new Qr(a).getExtent())){o[i].push(a),u=!0;break}}u||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(e=gt.POLYGON,t=k({},t,((i={}).rings=a[0],i))):(e=gt.MULTI_POLYGON,t=k({},t,((r={}).rings=a,r)))}return hy((0,qM[e])(t),!1,n)}function UM(t){var n=dt;return!0===t.hasZ&&!0===t.hasM?n=yt:!0===t.hasZ?n=pt:!0===t.hasM&&(n=mt),n}function WM(t){var n=t.getLayout();return{hasZ:n===pt||n===yt,hasM:n===mt||n===yt}}function VM(t,n){return(0,DM[t.getType()])(hy(t,!0,n),n)}DM[gt.POINT]=function(t,n){var i,r=t.getCoordinates(),e=t.getLayout();e===pt?i={x:r[0],y:r[1],z:r[2]}:e===mt?i={x:r[0],y:r[1],m:r[2]}:e===yt?i={x:r[0],y:r[1],z:r[2],m:r[3]}:e===dt?i={x:r[0],y:r[1]}:ct(!1,34);return i},DM[gt.LINE_STRING]=function(t,n){var i=WM(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},DM[gt.POLYGON]=function(t,n){var i=WM(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},DM[gt.MULTI_POINT]=function(t,n){var i=WM(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},DM[gt.MULTI_LINE_STRING]=function(t,n){var i=WM(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},DM[gt.MULTI_POLYGON]=function(t,n){for(var i=WM(t),r=t.getCoordinates(!1),e=[],o=0;o=0;s--)e.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:e}};var JM=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).A=r.geometryName,i}return GM(n,t),n.prototype.readFeatureFromObject=function(t,n,i){var r=t,e=BM(r.geometry,n),o=new vt;if(this.A&&o.setGeometryName(this.A),o.setGeometry(e),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[i];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var i=n||{};if(t.features){for(var r=[],e=t.features,o=0,s=e.length;o0?i[0]:null},i.prototype.readFeatureFromNode=function(t,n){return null},i.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var i=Jc(t);return this.readFeaturesFromDocument(i,n)}return Wc(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},i.prototype.readFeaturesFromDocument=function(t,n){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&g(i,this.readFeaturesFromNode(r,n));return i},i.prototype.readFeaturesFromNode=function(n,i){return t()},i.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var i=Jc(t);return this.readGeometryFromDocument(i,n)}return Wc(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},i.prototype.readGeometryFromDocument=function(t,n){return null},i.prototype.readGeometryFromNode=function(t,n){return null},i.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=Jc(t);return this.readProjectionFromDocument(n)}return Wc(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},i.prototype.readProjectionFromDocument=function(t){return this.dataProjection},i.prototype.readProjectionFromNode=function(t){return this.dataProjection},i.prototype.writeFeature=function(t,n){var i=this.writeFeatureNode(t,n);return this.Od.serializeToString(i)},i.prototype.writeFeatureNode=function(t,n){return null},i.prototype.writeFeatures=function(t,n){var i=this.writeFeaturesNode(t,n);return this.Od.serializeToString(i)},i.prototype.writeFeaturesNode=function(t,n){return null},i.prototype.writeGeometry=function(t,n){var i=this.writeGeometryNode(t,n);return this.Od.serializeToString(i)},i.prototype.writeGeometryNode=function(t,n){return null},i}(uy),YM=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZM="http://www.opengis.net/gml",$M=/^[\s\xa0]*$/,KM=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.featureType=r.featureType,i.featureNS=r.featureNS,i.srsName=r.srsName,i.schemaLocation="",i.FEATURE_COLLECTION_PARSERS={},i.FEATURE_COLLECTION_PARSERS[i.namespace]={featureMember:Hc(i.readFeaturesInternal),featureMembers:Yc(i.readFeaturesInternal)},i}return YM(n,t),n.prototype.readFeaturesInternal=function(t,n){var i=t.localName,r=null;if("FeatureCollection"==i)r=sf([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){var e=n[0],o=e.featureType,s=e.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,u=t.childNodes.length;a0){e[a]={kd:e[a]};for(var h=0;h0:f===gt.POINT||f===gt.MULTI_POINT}}a&&(u=o.get("name"),(a=a&&!!u)&&u.search(/&[^&]+;/)>-1&&(V_||(V_=document.createElement("textarea")),V_.innerHTML=u,u=V_.value));var l=i;if(t?l=t:n&&(l=Y_(n,i,r)),a){var v=function(t,n){var i=[0,0],r="start",e=t.getImage();if(e){var o=e.getImageSize();if(null===o&&(o=p_),2==o.length){var s=e.getScaleArray();i[0]=s[0]*o[0]/2,i[1]=-s[1]*o[1]/2,r="left"}}var a=t.getText();a?((a=a.clone()).setFont(a.getFont()||U_.getFont()),a.setScale(a.getScale()||U_.getScale()),a.setFill(a.getFill()||U_.getFill()),a.setStroke(a.getStroke()||D_)):a=U_.clone();return a.setText(n),a.setOffsetX(i[0]),a.setOffsetY(i[1]),a.setTextAlign(r),new Gl({image:e,text:a})}(l[0],u);return h.length>0?(v.setGeometry(new Ty(h)),[v,new Gl({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(i.Style,i.styleUrl,this.Hd,this.$d,this.Kd);r.setStyle(a)}return delete i.Style,r.setProperties(i,!0),r}},n.prototype.ip=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=SO.call(this,t,n);if(r){var e=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.$d[e]=r}}},n.prototype.rp=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=iO.call(this,t,n);if(r){var e,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.$d[e]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!p(E_,t.namespaceURI))return null;var i=this.np(t,[this.getReadOptions(t,n)]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){if(!p(E_,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this.tp(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var e=this.np(t,[this.getReadOptions(t,n)]);return e?[e]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&g(i,s)}return i}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=Jc(t);return this.readNameFromDocument(n)}return Wc(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(n);if(i)return i}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(p(E_,n.namespaceURI)&&"name"==n.localName)return aS(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;if(p(E_,n.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var i=Jc(t);g(n,this.readNetworkLinksFromDocument(i))}else Wc(t)?g(n,this.readNetworkLinksFromDocument(t)):g(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readNetworkLinksFromNode(i));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(p(E_,i.namespaceURI)&&"NetworkLink"==i.localName){var r=sf({},N_,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!p(E_,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readNetworkLinksFromNode(i))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var i=Jc(t);g(n,this.readRegionFromDocument(i))}else Wc(t)?g(n,this.readRegionFromDocument(t)):g(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readRegionFromNode(i));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(p(E_,i.namespaceURI)&&"Region"==i.localName){var r=sf({},I_,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!p(E_,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readRegionFromNode(i))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=Dc(E_[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",A_[0]),i.setAttributeNS(r,"xmlns:xsi",qc),i.setAttributeNS(qc,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var e={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=R_[i.namespaceURI],a=rf(o,s);return uf(e,L_,nf,a,[n],s,this),i},n}(HM);function Y_(t,n,i){return Array.isArray(t)?t:"string"==typeof t?Y_(i[t],n,i):n}function Z_(t){var n=Bc(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function $_(t){var n=Bc(t,!1),i=[];n=n.replace(/\s*,\s*/g,",");for(var r,e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=e.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;i.push(o,s,a),n=n.substr(r[0].length)}if(""===n)return i}function K_(t){var n=Bc(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function Q_(t){var n=Bc(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function tO(t){return rS(t)}var nO=ef(E_,{Pair:function(t,n){var i=sf({},EO,t,n,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var e=i.styleUrl;e&&(n[n.length-1]=e);var o=i.Style;o&&(n[n.length-1]=o)}}});function iO(t,n){return sf(void 0,nO,t,n,this)}var rO=ef(E_,{Icon:$c((function(t,n){var i=sf({},lO,t,n);return i||null})),color:$c(Z_),heading:$c(rS),hotSpot:$c((function(t){var n,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==i?"insetPixels"!==r?xl:Ml:"insetPixels"!==r?jl:Sl,{x:parseFloat(t.getAttribute("x")),xunits:C_[i],y:parseFloat(t.getAttribute("y")),yunits:C_[r],origin:n}})),scale:$c(tO)});var eO=ef(E_,{color:$c(Z_),scale:$c(tO)});var oO=ef(E_,{color:$c(Z_),width:$c(rS)});var sO=ef(E_,{color:$c(Z_),fill:$c(tS),outline:$c(tS)});var aO=ef(E_,{coordinates:Yc($_)});function uO(t,n){return sf(null,aO,t,n)}var hO=ef(A_,{Track:Hc(fO)});var cO=ef(E_,{when:function(t,n){var i=n[n.length-1].whens,r=Bc(t,!1),e=Date.parse(r);i.push(isNaN(e)?0:e)}},ef(A_,{coord:function(t,n){var i=n[n.length-1].coordinates,r=Bc(t,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(e){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=parseFloat(e[3]);i.push([o,s,a])}else i.push([])}}));function fO(t,n){var i=sf({coordinates:[],whens:[]},cO,t,n);if(i){for(var r=[],e=i.coordinates,o=i.whens,s=0,a=Math.min(e.length,o.length);s0){var r=n[n.length-1];r.push.apply(r,i)}},outerBoundaryIs:function(t,n){var i=sf(void 0,IO,t,n);if(i){n[n.length-1][0]=i}}});function jO(t,n){var i=sf({},pO,t,n),r=sf([null],xO,t,n);if(r&&r[0]){for(var e=r[0],o=[e.length],s=1,a=r.length;s0,c=u.href;c?r=c:h&&(r=m_);var f,l=xl,v=i.hotSpot;v?(e=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):r===m_?(e=l_,o=v_,s=d_):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(e=[.5,0],o=wl,s=wl);var d,p=u.x,m=u.y;void 0!==p&&void 0!==m&&(f=[p,m]);var y,g=u.w,w=u.h;void 0!==g&&void 0!==w&&(d=[g,w]);var b=i.heading;void 0!==b&&(y=Kn(b));var x=i.scale,j=i.color;if(h){r==m_&&(d=p_,void 0===x&&(x=y_));var M=new Cl({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.zt,offset:f,offsetOrigin:xl,rotation:y,scale:x,size:d,src:this.Qd(r),color:j});a.imageStyle=M}else a.imageStyle=G_}},LabelStyle:function(t,n){var i=sf({},eO,t,n);if(i){var r=n[n.length-1],e=new Bl({fill:new gl({color:"color"in i?i.color:f_}),scale:i.scale});r.textStyle=e}},LineStyle:function(t,n){var i=sf({},oO,t,n);if(i){var r=n[n.length-1],e=new Pl({color:"color"in i?i.color:f_,width:"width"in i?i.width:1});r.strokeStyle=e}},PolyStyle:function(t,n){var i=sf({},sO,t,n);if(i){var r=n[n.length-1],e=new gl({color:"color"in i?i.color:f_});r.fillStyle=e;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function SO(t,n){var i=sf({},MO,t,n,this);if(!i)return null;var r,e="fillStyle"in i?i.fillStyle:F_,o=i.fill;void 0===o||o||(e=null),"imageStyle"in i?i.imageStyle!=G_&&(r=i.imageStyle):r=q_;var s="textStyle"in i?i.textStyle:U_,a="strokeStyle"in i?i.strokeStyle:B_,u=i.outline;return void 0===u||u?[new Gl({fill:e,image:r,stroke:a,text:s,zIndex:void 0})]:[new Gl({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===gt.GEOMETRY_COLLECTION?new Ty(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n!==gt.POLYGON&&n!==gt.MULTI_POLYGON}))):i!==gt.POLYGON&&i!==gt.MULTI_POLYGON?n:void 0},fill:e,image:r,stroke:a,text:s,zIndex:void 0}),new Gl({geometry:function(t){var n=t.getGeometry(),i=n.getType();return i===gt.GEOMETRY_COLLECTION?new Ty(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===gt.POLYGON||n===gt.MULTI_POLYGON}))):i===gt.POLYGON||i===gt.MULTI_POLYGON?n:void 0},fill:e,stroke:null,zIndex:void 0})]}function _O(t,n){var i,r,e,o=n.length,s=new Array(n.length),a=new Array(n.length),u=new Array(n.length);i=!1,r=!1,e=!1;for(var h=0;h0){var y=rf(e,s);uf(r,sk,uk,[{names:s,values:y}],i)}var g=i[0],w=n.getGeometry();w&&(w=hy(w,!0,g)),uf(r,sk,$O,[w],i)}var ck=ef(E_,["extrude","tessellate","altitudeMode","coordinates"]),fk=ef(E_,{extrude:Kc(uS),tessellate:Kc(uS),altitudeMode:Kc(vS),coordinates:Kc((function(t,n,i){var r,e=i[i.length-1],o=e.layout,s=e.stride;o==dt||o==mt?r=2:o==pt||o==yt?r=3:ct(!1,34);var a=n.length,u="";if(a>0){u+=n[0];for(var h=1;h>1):e>>1}return n}function eT(t){for(var n="",i=0,r=t.length;i=32;)n=63+(32|31&t),i+=String.fromCharCode(n),t>>=5;return n=t+63,i+=String.fromCharCode(n)}var aT=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=Zi("EPSG:4326"),i.ep=r.factor?r.factor:1e5,i.op=r.geometryLayout?r.geometryLayout:dt,i}return $k(n,t),n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n);return new vt(i)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var i=_r(this.op),r=Qk(t,i,this.ep);FM(r,0,r.length,i,r);var e=Jr(r,0,r.length,i);return hy(new Jm(e,this.op),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):(ct(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var i=(t=hy(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return FM(i,0,i.length,r,i),Kk(i,r,this.ep)},n}(g_),uT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hT=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.$f=r.layerName,i.Lu=r.layers?r.layers:null,i.dataProjection=Zi(r.dataProjection?r.dataProjection:"EPSG:4326"),i}return uT(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var i=t,r=void 0,e=null,o=null;i.transform&&(e=(r=i.transform).scale,o=r.translate);var s=i.arcs;r&&function(t,n,i){for(var r=0,e=t.length;r0&&e.pop(),r=i>=0?n[i]:n[~i].slice().reverse(),e.push.apply(e,r);for(var a=0,u=e.length;a=2,57),r}return gT(n,t),n}(yT),bT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xT=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return bT(n,t),n}(wT),jT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MT=function(t){function n(n,i,r){var e=t.call(this,"BBOX")||this;if(e.geometryName=n,e.extent=i,4!==i.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return e.srsName=r,e}return jT(n,t),n}(yT),ST=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_T=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.geometryName=i||"the_geom",o.geometry=r,o.srsName=e,o}return ST(n,t),n}(yT),OT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kT=function(t){function n(n,i,r){return t.call(this,"Contains",n,i,r)||this}return OT(n,t),n}(_T),TT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),AT=function(t){function n(n,i,r,e,o){var s=t.call(this,"DWithin",n,i,o)||this;return s.distance=r,s.unit=e,s}return TT(n,t),n}(_T),ET=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),CT=function(t){function n(n,i,r){return t.call(this,"Disjoint",n,i,r)||this}return ET(n,t),n}(_T),PT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),NT=function(t){function n(n,i){var r=t.call(this,n)||this;return r.propertyName=i,r}return PT(n,t),n}(yT),zT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),IT=function(t){function n(n,i,r){var e=t.call(this,"During",n)||this;return e.begin=i,e.end=r,e}return zT(n,t),n}(NT),RT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),LT=function(t){function n(n,i,r,e){var o=t.call(this,n,i)||this;return o.expression=r,o.matchCase=e,o}return RT(n,t),n}(NT),FT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GT=function(t){function n(n,i,r){return t.call(this,"PropertyIsEqualTo",n,i,r)||this}return FT(n,t),n}(LT),qT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),DT=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThan",n,i)||this}return qT(n,t),n}(LT),BT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),UT=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,i)||this}return BT(n,t),n}(LT),WT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),VT=function(t){function n(n,i,r){return t.call(this,"Intersects",n,i,r)||this}return WT(n,t),n}(_T),JT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),XT=function(t){function n(n,i,r){var e=t.call(this,"PropertyIsBetween",n)||this;return e.lowerBoundary=i,e.upperBoundary=r,e}return JT(n,t),n}(NT),HT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),YT=function(t){function n(n,i,r,e,o,s){var a=t.call(this,"PropertyIsLike",n)||this;return a.pattern=i,a.wildCard=void 0!==r?r:"*",a.singleChar=void 0!==e?e:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return HT(n,t),n}(NT),ZT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$T=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return ZT(n,t),n}(NT),KT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QT=function(t){function n(n,i){return t.call(this,"PropertyIsLessThan",n,i)||this}return KT(n,t),n}(LT),tA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nA=function(t){function n(n,i){return t.call(this,"PropertyIsLessThanOrEqualTo",n,i)||this}return tA(n,t),n}(LT),iA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rA=function(t){function n(n){var i=t.call(this,"Not")||this;return i.condition=n,i}return iA(n,t),n}(yT),eA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oA=function(t){function n(n,i,r){return t.call(this,"PropertyIsNotEqualTo",n,i,r)||this}return eA(n,t),n}(LT),sA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),aA=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return sA(n,t),n}(wT),uA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hA=function(t){function n(n){var i=t.call(this,"ResourceId")||this;return i.rid=n,i}return uA(n,t),n}(yT),cA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fA=function(t){function n(n,i,r){return t.call(this,"Within",n,i,r)||this}return cA(n,t),n}(_T);function lA(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(xT,n))}function vA(t,n,i){return new MT(t,n,i)}var dA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pA={"http://www.opengis.net/gml":{boundedBy:$c(QM.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Hc(QM.prototype.readFeaturesInternal)}},mA={"http://www.opengis.net/wfs":{totalInserted:$c(oS),totalUpdated:$c(oS),totalDeleted:$c(oS)},"http://www.opengis.net/wfs/2.0":{totalInserted:$c(oS),totalUpdated:$c(oS),totalDeleted:$c(oS)}},yA={"http://www.opengis.net/wfs":{TransactionSummary:$c(AA,"transactionSummary"),InsertResults:$c(NA,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:$c(AA,"transactionSummary"),InsertResults:$c(NA,"insertIds")}},gA={"http://www.opengis.net/wfs":{PropertyName:Kc(vS)},"http://www.opengis.net/wfs/2.0":{PropertyName:Kc(vS)}},wA={"http://www.opengis.net/wfs":{Insert:Kc(zA),Update:Kc(FA),Delete:Kc(LA),Property:Kc(GA),Native:Kc(qA)},"http://www.opengis.net/wfs/2.0":{Insert:Kc(zA),Update:Kc(FA),Delete:Kc(LA),Property:Kc(GA),Native:Kc(qA)}},bA="feature",xA="http://www.w3.org/2000/xmlns/",jA={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},MA={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},SA={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},_A={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},OA={"2.0.0":OS,"1.1.0":xS,"1.0.0":yS},kA=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.rh=r.version?r.version:"1.1.0",i.ap=r.featureType,i.up=r.featureNS,i.hp=r.gmlFormat?r.gmlFormat:new OA[i.rh],i.cp=r.schemaLocation?r.schemaLocation:_A[i.rh],i}return dA(n,t),n.prototype.getFeatureType=function(){return this.ap},n.prototype.setFeatureType=function(t){this.ap=t},n.prototype.readFeaturesFromNode=function(t,n){var i={node:t};k(i,{featureType:this.ap,featureNS:this.up}),k(i,this.getReadOptions(t,n||{}));var r=[i],e=sf([],"2.0.0"===this.rh?pA:this.hp.FEATURE_COLLECTION_PARSERS,t,r,this.hp);return e||(e=[]),e},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=Jc(t);return this.readTransactionResponseFromDocument(n)}return Wc(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=Jc(t);return this.readFeatureCollectionMetadataFromDocument(n)}return Wc(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},i=sS(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,sf(n,pA,t,[],this.hp)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return sf({},yA,t,[])},n.prototype.writeGetFeature=function(t){var n=this,i=Dc(MA[this.rh],"GetFeature");i.setAttribute("service","WFS"),i.setAttribute("version",this.rh),t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams",t.viewParams),i.setAttributeNS(qc,"xsi:schemaLocation",this.cp);var r={node:i};if(k(r,{version:this.rh,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.up,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),ct(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var e=t.filter;t.bbox&&(ct(t.geometryName,12),e=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,e)),k(r,{geometryName:t.geometryName,filter:e}),eE(i,t.featureTypes,[r])}else t.featureTypes.forEach((function(e){var o=n.combineBboxAndFilter(e.geometryName,e.bbox,t.srsName,t.filter);k(r,{geometryName:e.geometryName,filter:o}),eE(i,[e.name],[r])}));return i},n.prototype.combineBboxAndFilter=function(t,n,i,r){var e=vA(t,n,i);return r?lA(r,e):e},n.prototype.writeTransaction=function(t,n,i,r){var e,o=[],s=r.version?r.version:this.rh,a=Dc(MA[s],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",s),r&&(e=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(qc,"xsi:schemaLocation",_A[s]);var u=function(t,n,i,r){var e,o=r.featurePrefix?r.featurePrefix:bA;"1.0.0"===i?e=2:"1.1.0"===i?e=3:"2.0.0"===i&&(e=3.2);return k({node:t},{version:i,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:e,hasZ:r.hasZ,srsName:r.srsName},n)}(a,e,s,r);return t&&TA("Insert",t,o,u),n&&TA("Update",n,o,u),i&&TA("Delete",i,o,u),r.nativeElements&&TA("Native",r.nativeElements,o,u),a},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var i=[{}];return this.hp.readGeometryElement(n,i),Zi(i.pop().srsName)}return null},n}(HM);function TA(t,n,i,r){uf(r,wA,tf(t),n,i)}function AA(t,n){return sf({},mA,t,n)}var EA={"http://www.opengis.net/ogc":{FeatureId:Hc((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Hc((function(t,n){return t.getAttribute("fid")}))}};function CA(t,n){of(EA,t,n)}var PA={"http://www.opengis.net/wfs":{Feature:CA},"http://www.opengis.net/wfs/2.0":{Feature:CA}};function NA(t,n){return sf([],PA,t,n)}function zA(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s=r.gmlVersion,a=Dc(o,e);t.appendChild(a),2===s?yS.prototype.writeFeatureElement(a,n,i):3===s?xS.prototype.writeFeatureElement(a,n,i):OS.prototype.writeFeatureElement(a,n,i)}function IA(t,n,i){var r=i[i.length-1].version,e=jA[r],o=Dc(e,"Filter"),s=Dc(e,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function RA(t,n){var i=(t=t||bA)+":";return 0===n.indexOf(i)?n:i+n}function LA(t,n,i){var r=i[i.length-1];ct(void 0!==n.getId(),26);var e=r.featureType,o=r.featurePrefix,s=r.featureNS,a=RA(o,e);t.setAttribute("typeName",a),t.setAttributeNS(xA,"xmlns:"+o,s);var u=n.getId();void 0!==u&&IA(t,u,i)}function FA(t,n,i){var r=i[i.length-1];ct(void 0!==n.getId(),27);var e=r.version,o=r.featureType,s=r.featurePrefix,a=r.featureNS,u=RA(s,o),h=n.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(xA,"xmlns:"+s,a);var c=n.getId();if(void 0!==c){for(var f=n.getKeys(),l=[],v=0,d=f.length;v0,i=this.readUint32(n),r=Math.floor((268435455&i)/1e3),e=Boolean(2147483648&i)||1===r||3===r,o=Boolean(1073741824&i)||2===r||3===r,s=Boolean(536870912&i),a=(268435455&i)%1e3,u=["XY",e?"Z":"",o?"M":""].join(""),h=s?this.readUint32(n):null;if(void 0!==t&&t!==a)throw new Error("Unexpected WKB geometry type "+a);if(this.vp){if(this.dp!==n)throw new Error("Inconsistent endian");if(this.gp!==u)throw new Error("Inconsistent geometry layout");if(h&&this.yp!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.dp=n,this.pp=e,this.mp=o,this.gp=u,this.yp=h,this.vp=!0;return a},t.prototype.readWkbPayload=function(t){switch(t){case uE:return this.readPoint();case hE:return this.readLineString();case cE:case yE:return this.readPolygon();case fE:return this.readMultiPoint();case lE:return this.readMultiLineString();case vE:case pE:case mE:return this.readMultiPolygon();case dE:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var i=this.readUint32(),r=[],e=0;e=0&&(t+=this.wp?2147483648:1e3),this.gp.indexOf("M")>=0&&(t+=this.wp?1073741824:2e3),this.wp&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.dp?1:0),this.writeUint32(t),this.wp&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var i=0;i="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.Ep=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.Cp=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.Pp=function(){return this.wkt.charAt(++this.Tp)},t.prototype.nextToken=function(){var t,n=this.Pp(),i=this.Tp,r=n;if("("==n)t=kE;else if(","==n)t=EE;else if(")"==n)t=TE;else if(this.Ep(n)||"-"==n)t=AE,r=this.Np();else if(this.Ap(n))t=OE,r=this.zp();else{if(this.Cp(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=CE}return{position:i,value:r,type:t}},t.prototype.Np=function(){var t,n=this.Tp,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.Pp()}while(this.Ep(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.Tp--))},t.prototype.zp=function(){var t,n=this.Tp;do{t=this.Pp()}while(this.Ap(t));return this.wkt.substring(n,this.Tp--).toUpperCase()},t}(),IE=function(){function t(t){this.Ip=t,this.Rp={position:0,type:_E},this.gp=dt}return t.prototype.Lp=function(){this.Rp=this.Ip.nextToken()},t.prototype.isTokenType=function(t){return this.Rp.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.Lp(),n},t.prototype.parse=function(){return this.Lp(),this.Fp()},t.prototype.Gp=function(){var t=dt,n=this.Rp;if(this.isTokenType(OE)){var i=n.value;"Z"===i?t=pt:"M"===i?t=mt:"ZM"===i&&(t=yt),t!==dt&&this.Lp()}return t},t.prototype.qp=function(){if(this.match(kE)){var t=[];do{t.push(this.Fp())}while(this.match(EE));if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Bp=function(){if(this.match(kE)){var t=this.Up();if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Wp=function(){if(this.match(kE)){var t=this.Vp();if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Jp=function(){if(this.match(kE)){var t=this.Xp();if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Hp=function(){if(this.match(kE)){var t=void 0;if(t=this.Rp.type==kE?this.Yp():this.Vp(),this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Zp=function(){if(this.match(kE)){var t=this.Xp();if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.$p=function(){if(this.match(kE)){var t=this.Kp();if(this.match(TE))return t}throw new Error(this.Dp())},t.prototype.Up=function(){for(var t=[],n=this.gp.length,i=0;i0&&(n+=" "+r)}return 0===i.length?n+" "+SE:n+"("+i+")"}var BE=RE,UE=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),WE=[null,"http://www.opengis.net/wms"],VE=ef(WE,{Service:$c((function(t,n){return sf({},HE,t,n)})),Capability:$c((function(t,n){return sf({},JE,t,n)}))}),JE=ef(WE,{Request:$c((function(t,n){return sf({},iC,t,n)})),Exception:$c((function(t,n){return sf([],KE,t,n)})),Layer:$c((function(t,n){var i=sf({},QE,t,n);if(void 0===i.Layer)return Object.assign(i,hC(t,n));return i}))}),XE=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return UE(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=sf({version:this.version},VE,t,[]);return n||null},n}(Ck),HE=ef(WE,{Name:$c(aS),Title:$c(aS),Abstract:$c(aS),KeywordList:$c(vC),OnlineResource:$c(Pk),ContactInformation:$c((function(t,n){return sf({},YE,t,n)})),Fees:$c(aS),AccessConstraints:$c(aS),LayerLimit:$c(oS),MaxWidth:$c(oS),MaxHeight:$c(oS)}),YE=ef(WE,{ContactPersonPrimary:$c((function(t,n){return sf({},ZE,t,n)})),ContactPosition:$c(aS),ContactAddress:$c((function(t,n){return sf({},$E,t,n)})),ContactVoiceTelephone:$c(aS),ContactFacsimileTelephone:$c(aS),ContactElectronicMailAddress:$c(aS)}),ZE=ef(WE,{ContactPerson:$c(aS),ContactOrganization:$c(aS)}),$E=ef(WE,{AddressType:$c(aS),Address:$c(aS),City:$c(aS),StateOrProvince:$c(aS),PostCode:$c(aS),Country:$c(aS)}),KE=ef(WE,{Format:Hc(aS)}),QE=ef(WE,{Name:$c(aS),Title:$c(aS),Abstract:$c(aS),KeywordList:$c(vC),CRS:Zc(aS),EX_GeographicBoundingBox:$c((function(t,n){var i=sf({},nC,t,n);if(!i)return;var r=i.westBoundLongitude,e=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===e||void 0===o||void 0===s)return;return[r,e,o,s]})),BoundingBox:Zc((function(t,n){var i=[eS(t.getAttribute("minx")),eS(t.getAttribute("miny")),eS(t.getAttribute("maxx")),eS(t.getAttribute("maxy"))],r=[eS(t.getAttribute("resx")),eS(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}})),Dimension:Zc((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:nS(t.getAttribute("multipleValues")),nearestValue:nS(t.getAttribute("nearestValue")),current:nS(t.getAttribute("current")),values:aS(t)}})),Attribution:$c((function(t,n){return sf({},tC,t,n)})),AuthorityURL:Zc((function(t,n){var i=cC(t,n);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Zc(aS),MetadataURL:Zc((function(t,n){var i=cC(t,n);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Zc(cC),FeatureListURL:Zc(cC),Style:Zc((function(t,n){return sf({},sC,t,n)})),MinScaleDenominator:$c(rS),MaxScaleDenominator:$c(rS),Layer:Zc(hC)}),tC=ef(WE,{Title:$c(aS),OnlineResource:$c(Pk),LogoURL:$c(lC)}),nC=ef(WE,{westBoundLongitude:$c(rS),eastBoundLongitude:$c(rS),southBoundLatitude:$c(rS),northBoundLatitude:$c(rS)}),iC=ef(WE,{GetCapabilities:$c(fC),GetMap:$c(fC),GetFeatureInfo:$c(fC)}),rC=ef(WE,{Format:Zc(aS),DCPType:Zc((function(t,n){return sf({},eC,t,n)}))}),eC=ef(WE,{HTTP:$c((function(t,n){return sf({},oC,t,n)}))}),oC=ef(WE,{Get:$c(cC),Post:$c(cC)}),sC=ef(WE,{Name:$c(aS),Title:$c(aS),Abstract:$c(aS),LegendURL:Zc(lC),StyleSheetURL:$c(cC),StyleURL:$c(cC)}),aC=ef(WE,{Format:$c(aS),OnlineResource:$c(Pk)}),uC=ef(WE,{Keyword:Hc(aS)});function hC(t,n){var i=n[n.length-1],r=sf({},QE,t,n);if(r){var e=nS(t.getAttribute("queryable"));void 0===e&&(e=i.queryable),r.queryable=void 0!==e&&e;var o=sS(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded),r.cascaded=o;var s=nS(t.getAttribute("opaque"));void 0===s&&(s=i.opaque),r.opaque=void 0!==s&&s;var a=nS(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets),r.noSubsets=void 0!==a&&a;var u=eS(t.getAttribute("fixedWidth"));u||(u=i.fixedWidth),r.fixedWidth=u;var h=eS(t.getAttribute("fixedHeight"));h||(h=i.fixedHeight),r.fixedHeight=h;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){var n=r[t]||[];r[t]=n.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=i[t];r[t]=n}})),r}}function cC(t,n){return sf({},aC,t,n)}function fC(t,n){return sf({},rC,t,n)}function lC(t,n){var i=cC(t,n);if(i){var r=[sS(t.getAttribute("width")),sS(t.getAttribute("height"))];return i.size=r,i}}function vC(t,n){return sf([],uC,t,n)}var dC=XE,pC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mC=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.up="http://mapserver.gis.umn.edu/mapserver",i.hp=new yS,i.Lu=r.layers?r.layers:null,i}return pC(n,t),n.prototype.getLayers=function(){return this.Lu},n.prototype.setLayers=function(t){this.Lu=t},n.prototype.im=function(t,n){t.setAttribute("namespaceURI",this.up);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var e=0,o=t.childNodes.length;ec*HC||h>f*HC?this.Em():hn(o,r)||this.Nm()}}},n.prototype.Em=function(){var t=this.getMap(),n=this._m,i=t.getSize(),r=t.getView().calculateExtentInternal(i),e=n.getView(),o=Math.log(7.5)/Math.LN2;qn(r,1/(Math.pow(2,o/2)*YC)),e.fitInternal(Se(r))},n.prototype.Nm=function(){var t=this.getMap(),n=this._m,i=t.getView();n.getView().setCenterInternal(i.getCenterInternal())},n.prototype.zm=function(){var t=this.getMap(),n=this._m;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView(),e=n.getView(),o=this.Xo?0:-r.getRotation(),s=this.Om,a=this.Om.getElement(),u=r.getCenterInternal(),h=r.getResolution(),c=e.getResolution(),f=i[0]*h/c,l=i[1]*h/c;if(s.setPosition(u),a){a.style.width=f+"px",a.style.height=l+"px";var v="rotate("+o+"rad)";a.style.transform=v}}},n.prototype.Cm=function(){this.Im||(this.Im=Y(this._m,na,(function(t){delete this.Im,this.zm()}),this))},n.prototype.lr=function(t){t.preventDefault(),this.mr()},n.prototype.mr=function(){this.element.classList.toggle(ls),this.rr?lo(this.ur,this.hr):lo(this.hr,this.ur),this.rr=!this.rr;var t=this._m;if(!this.rr){if(t.isRendered())return this.Mm=void 0,void t.render();t.updateSize(),this.Em(),this.Cm()}},n.prototype.getCollapsible=function(){return this.ar},n.prototype.setCollapsible=function(t){this.ar!==t&&(this.ar=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.rr&&this.mr())},n.prototype.setCollapsed=function(t){this.ar&&this.rr!==t&&this.mr()},n.prototype.getCollapsed=function(){return this.rr},n.prototype.getRotateWithView=function(){return this.Xo},n.prototype.setRotateWithView=function(t){this.Xo!==t&&(this.Xo=t,0!==this.getMap().getView().getRotation()&&(this.Xo?this.jm():this._m.getView().setRotation(0),this.Mm=void 0,this.Pm(),this.zm()))},n.prototype.getOverviewMap=function(){return this._m},n.prototype.render=function(t){this.Pm(),this.zm()},n}(Va),KC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QC="units",tP="degrees",nP="imperial",iP="nautical",rP="metric",eP="us",oP=[1,2,5],sP=25.4/.28,aP=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,i.once,i.un,i.Rm=document.createElement("div"),i.Rm.className=e+"-inner",i.element.className=e+" "+hs,i.element.appendChild(i.Rm),i.Lm=null,i.Fm=void 0!==r.minWidth?r.minWidth:64,i.en=!1,i.Gm=void 0,i.gm="",i.addChangeListener(QC,i.qm),i.setUnits(r.units||rP),i.Dm=r.bar||!1,i.Bm=r.steps||4,i.Um=r.text||!1,i.Wm=r.dpi||void 0,i}return KC(n,t),n.prototype.getUnits=function(){return this.get(QC)},n.prototype.qm=function(){this.pr()},n.prototype.setUnits=function(t){this.set(QC,t)},n.prototype.setDpi=function(t){this.Wm=t},n.prototype.pr=function(){var t=this.Lm;if(t){var n=t.center,i=t.projection,r=this.getUnits(),e=r==tP?jt.DEGREES:jt.METERS,o=$i(i,t.resolution,n,e),s=this.Fm*(this.Wm||sP)/sP,a=s*o,u="";if(r==tP){var h=bt[jt.DEGREES];(a*=h)=s)break;++d}v=this.Dm?this.createScaleBar(f,c,u):c.toFixed(l<0?-l:0)+" "+u,this.gm!=v&&(this.Rm.innerHTML=v,this.gm=v),this.Gm!=f&&(this.Rm.style.width=f+"px",this.Gm=f),this.en||(this.element.style.display="",this.en=!0)}else this.en&&(this.element.style.display="none",this.en=!1)},n.prototype.createScaleBar=function(t,n,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),e=[],o=t/this.Bm,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.Bm?this.createStepText(a,t,!1,n,i):"")+""),a===this.Bm-1&&e.push(this.createStepText(a+1,t,!0,n,i)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.Um?'
'+r+"
":"")+e.join("")+"
"},n.prototype.createMarker=function(t,n){return'
'},n.prototype.createStepText=function(t,n,i,r,e){var o=(0===t?0:Math.round(r/this.Bm*t*100)/100)+(0===t?"":" "+e);return'
'+o+"
"},n.prototype.getScaleForResolution=function(){var t=$i(this.Lm.projection,this.Lm.resolution,this.Lm.center),n=this.Wm||sP,i=this.Lm.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.Lm=n?n.viewState:null,this.pr()},n}(Va),uP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hP=0,cP=1,fP=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render})||this).wn=[],i.Vm=void 0,i.Jm=hP,i.gn,i.Xm=0,i.Hm=0,i.Ym,i.Zm,i.$m=null,i.Km=!1,i.gr=void 0!==r.duration?r.duration:200;var e=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=e+"-thumb "+hs;var s=i.element;return s.className=e+" "+"ol-unselectable "+fs,s.appendChild(o),s.addEventListener(Zs,i.Qm.bind(i),!1),s.addEventListener(Ys,i.ty.bind(i),!1),s.addEventListener($s,i.ny.bind(i),!1),s.addEventListener(L,i.iy.bind(i),!1),o.addEventListener(L,h,!1),i}return uP(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.ey=function(){var t=this.element,n=t.offsetWidth,i=t.offsetHeight;if(0===n&&0===i)return this.Km=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var e=t.firstElementChild,o=getComputedStyle(e),s=e.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=e.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.$m=[s,a],n>i?(this.Jm=cP,this.Hm=n-s):(this.Jm=hP,this.Xm=i-a),this.Km=!0},n.prototype.iy=function(t){var n=this.getMap().getView(),i=this.oy(t.offsetX-this.$m[0]/2,t.offsetY-this.$m[1]/2),r=this.sy(i),e=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:e,duration:this.gr,easing:eo})},n.prototype.Qm=function(t){if(!this.gn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.Ym=t.clientX-parseFloat(n.style.left),this.Zm=t.clientY-parseFloat(n.style.top),this.gn=!0,0===this.wn.length){var i=this.ty,r=this.ny,e=this.getMap().getOwnerDocument();this.wn.push(H(e,Ys,i,this),H(e,$s,r,this))}}},n.prototype.ty=function(t){if(this.gn){var n=t.clientX-this.Ym,i=t.clientY-this.Zm,r=this.oy(n,i);this.Vm=this.sy(r),this.getMap().getView().setResolution(this.Vm)}},n.prototype.ny=function(t){this.gn&&(this.getMap().getView().endInteraction(),this.gn=!1,this.Ym=void 0,this.Zm=void 0,this.wn.forEach(Z),this.wn.length=0)},n.prototype.uy=function(t){var n=this.hy(t),i=this.element.firstElementChild;this.Jm==cP?i.style.left=this.Hm*n+"px":i.style.top=this.Xm*n+"px"},n.prototype.oy=function(t,n){return Vn(this.Jm===cP?t/this.Hm:n/this.Xm,0,1)},n.prototype.sy=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.hy=function(t){return Vn(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.Km||this.ey())){var n=t.frameState.viewState.resolution;this.Vm=n,this.uy(n)}},n}(Va),lP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vP=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var e=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(L,i.lr.bind(i),!1);var u=e+" "+"ol-unselectable "+fs,h=i.element;return h.className=u,h.appendChild(a),i}return lP(n,t),n.prototype.lr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Se(n))},n}(Va),dP={};dP.AssertionError=u,dP.Collection=ht,dP.Collection.CollectionEvent=ut,dP.Disposable=l,dP.Feature=vt,dP.Feature.createStyleFunction=lt,dP.Geolocation=Ge,dP.Image=Ye,dP.Image.listenImage=He,dP.ImageBase=De,dP.ImageCanvas=$e,dP.ImageTile=go,dP.Kinetic=wo,dP.Map=ih,dP.MapBrowserEvent=Xs,dP.MapBrowserEventHandler=ta,dP.MapEvent=Vs,dP.Object=rt,dP.Object.ObjectEvent=it,dP.Observable=tt,dP.Observable.unByKey=Q,dP.Overlay=gh,dP.PluggableMap=Ua,dP.Tile=uo,dP.TileCache=Th,dP.TileQueue=fa,dP.TileQueue.getTilePriority=la,dP.TileRange=Ch,dP.TileRange.createOrUpdate=Eh,dP.VectorRenderTile=zh,dP.VectorTile=Rh,dP.View=La,dP.View.createCenterConstraint=Pa,dP.View.createResolutionConstraint=Na,dP.View.createRotationConstraint=za,dP.View.isNoopAnimation=Ia,dP.array={},dP.array.binarySearch=v,dP.array.equals=b,dP.array.extend=g,dP.array.find=w,dP.array.findIndex=x,dP.array.includes=p,dP.array.isSorted=j,dP.array.linearFindNearest=m,dP.array.numberSafeCompareFunction=d,dP.array.remove=function(t,n){var i=t.indexOf(n),r=i>-1;return r&&t.splice(i,1),r},dP.array.reverseSubArray=y,dP.array.stableSort=function(t,n){var i,r=t.length,e=Array(t.length);for(i=0;i3&&!!Yr(t,n,i,r)},dP.geom.flat.transform={},dP.geom.flat.transform.rotate=gr,dP.geom.flat.transform.scale=wr,dP.geom.flat.transform.transform2D=yr,dP.geom.flat.transform.translate=br,dP.has={},dP.has.DEVICE_PIXEL_RATIO=Tt,dP.has.FIREFOX=St,dP.has.IMAGE_DECODE=Et,dP.has.MAC=kt,dP.has.PASSIVE_EVENT_LISTENERS=Ct,dP.has.SAFARI=_t,dP.has.WEBKIT=Ot,dP.has.WORKER_OFFSCREEN_CANVAS=At,dP.interaction={},dP.interaction.DoubleClickZoom=ou,dP.interaction.DragAndDrop=Wj,dP.interaction.DragAndDrop.DragAndDropEvent=Uj,dP.interaction.DragBox=Iu,dP.interaction.DragBox.DragBoxEvent=zu,dP.interaction.DragPan=Su,dP.interaction.DragRotate=Ou,dP.interaction.DragRotateAndZoom=Jj,dP.interaction.DragZoom=Lu,dP.interaction.Draw=oM,dP.interaction.Draw.DrawEvent=eM,dP.interaction.Draw.createBox=function(){return function(t,n,i){var r=en([t[0],t[t.length-1]].map((function(t){return lr(t,i)}))),e=[[kn(r),Tn(r),In(r),zn(r),kn(r)]],o=n;o?o.setCoordinates(e):o=new je(e);var s=cr();return s&&o.transform(i,s),o}},dP.interaction.Draw.createRegularPolygon=function(t,n){return function(i,r,e){var o=lr(i[0],e),s=lr(i[i.length-1],e),a=Math.sqrt(qi(o,s)),u=r||_e(new Yj(o),t),h=n;if(!n&&0!==n){var c=s[0]-o[0],f=s[1]-o[1];h=Math.atan2(f,c)}Oe(u,o,a,h);var l=cr();return l&&u.transform(e,l),u}},dP.interaction.Extent=lM,dP.interaction.Extent.ExtentEvent=uM,dP.interaction.Interaction=ru,dP.interaction.Interaction.pan=nu,dP.interaction.Interaction.zoomByDelta=iu,dP.interaction.KeyboardPan=Uu,dP.interaction.KeyboardZoom=Vu,dP.interaction.Modify=jM,dP.interaction.Modify.ModifyEvent=gM,dP.interaction.MouseWheelZoom=Yu,dP.interaction.PinchRotate=$u,dP.interaction.PinchZoom=Qu,dP.interaction.Pointer=uu,dP.interaction.Pointer.centroid=au,dP.interaction.Select=kM,dP.interaction.Select.SelectEvent=_M,dP.interaction.Snap=CM,dP.interaction.Translate=LM,dP.interaction.Translate.TranslateEvent=RM,dP.interaction.defaults=th,dP.layer={},dP.layer.Base=Uo,dP.layer.BaseImage=jd,dP.layer.BaseTile=zd,dP.layer.BaseVector=Lp,dP.layer.Graticule=ny,dP.layer.Group=Us,dP.layer.Heatmap=ay,dP.layer.Image=Ed,dP.layer.Layer=ns,dP.layer.Layer.inView=ts,dP.layer.MapboxVector=Rj,dP.layer.MapboxVector.getMapboxPath=Aj,dP.layer.MapboxVector.normalizeGlyphsUrl=Cj,dP.layer.MapboxVector.normalizeSourceUrl=Nj,dP.layer.MapboxVector.normalizeSpriteUrl=Ej,dP.layer.MapboxVector.normalizeStyleUrl=Pj,dP.layer.Tile=Gd,dP.layer.Vector=Hm,dP.layer.VectorImage=Fj,dP.layer.VectorTile=_y,dP.layer.WebGLPoints=qj,dP.loadingstrategy={},dP.loadingstrategy.all=Vh,dP.loadingstrategy.bbox=function(t,n){return[t]},dP.loadingstrategy.tile=function(t){return function(n,i){var r=t.getZForResolution(i),e=t.getTileRangeForExtentAndZ(n,r),o=[],s=[r,0,0];for(s[1]=e.minX;s[1]<=e.maxX;++s[1])for(s[2]=e.minY;s[2]<=e.maxY;++s[2])o.push(t.getTileCoordExtent(s));return o}},dP.math={},dP.math.clamp=Vn,dP.math.cosh=Jn,dP.math.lerp=ti,dP.math.log2=Xn,dP.math.modulo=Qn,dP.math.solveLinearSystem=Zn,dP.math.squaredDistance=Yn,dP.math.squaredSegmentDistance=Hn,dP.math.toDegrees=$n,dP.math.toRadians=Kn,dP.net={},dP.net.jsonp=Jh,dP.obj={},dP.obj.assign=k,dP.obj.clear=T,dP.obj.getValues=A,dP.obj.isEmpty=E,dP.proj={},dP.proj.Projection=Wn,dP.proj.Units={},dP.proj.Units.METERS_PER_UNIT=bt,dP.proj.addCommon=mr,dP.proj.addCoordinateTransforms=ir,dP.proj.addEquivalentProjections=Ki,dP.proj.addEquivalentTransforms=Qi,dP.proj.addProjection=Hi,dP.proj.addProjections=Yi,dP.proj.clearAllProjections=function(){gi(),ji()},dP.proj.clearUserProjection=function(){ur=null},dP.proj.cloneTransform=Ji,dP.proj.createProjection=tr,dP.proj.createSafeCoordinateTransform=pr,dP.proj.createTransformFromCoordinateTransform=nr,dP.proj.epsg3857={},dP.proj.epsg3857.EXTENT=ei,dP.proj.epsg3857.HALF_SIZE=ri,dP.proj.epsg3857.MAX_SAFE_Y=si,dP.proj.epsg3857.PROJECTIONS=ui,dP.proj.epsg3857.RADIUS=ii,dP.proj.epsg3857.WORLD_EXTENT=oi,dP.proj.epsg3857.fromEPSG4326=hi,dP.proj.epsg3857.toEPSG4326=ci,dP.proj.epsg4326={},dP.proj.epsg4326.EXTENT=vi,dP.proj.epsg4326.METERS_PER_UNIT=di,dP.proj.epsg4326.PROJECTIONS=mi,dP.proj.epsg4326.RADIUS=li,dP.proj.equivalent=rr,dP.proj.fromLonLat=function(t,n){return sr(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")},dP.proj.fromUserCoordinate=lr,dP.proj.fromUserExtent=dr,dP.proj.get=Zi,dP.proj.getPointResolution=$i,dP.proj.getTransform=or,dP.proj.getTransformFromProjections=er,dP.proj.getUserProjection=cr,dP.proj.identityTransform=Xi,dP.proj.proj4={},dP.proj.proj4.register=function(t){var n,i,r=Object.keys(t.defs),e=r.length;for(n=0;n180)&&(i[0]=Qn(r+180,360)-180),i},dP.proj.toUserCoordinate=fr,dP.proj.toUserExtent=vr,dP.proj.transform=sr,dP.proj.transformExtent=ar,dP.proj.transformWithProjections=function(t,n,i){return er(n,i)(t)},dP.proj.transforms={},dP.proj.transforms.add=Mi,dP.proj.transforms.clear=ji,dP.proj.transforms.get=Si,dP.proj.transforms.remove=function(t,n){var i=t.getCode(),r=n.getCode(),e=xi[i][r];return delete xi[i][r],E(xi[i])&&delete xi[i],e},dP.proj.useGeographic=function(){hr("EPSG:4326")},dP.render={},dP.render.Box=Tu,dP.render.Event=ss,dP.render.Feature=Wm,dP.render.VectorContext=Xh,dP.render.canvas={},dP.render.canvas.Builder=Yp,dP.render.canvas.BuilderGroup=am,dP.render.canvas.Executor=gm,dP.render.canvas.ExecutorGroup=Mm,dP.render.canvas.ExecutorGroup.getPixelIndexArray=jm,dP.render.canvas.ImageBuilder=$p,dP.render.canvas.Immediate=Yh,dP.render.canvas.Instruction={},dP.render.canvas.Instruction.beginPathInstruction=Vp,dP.render.canvas.Instruction.closePathInstruction=Jp,dP.render.canvas.Instruction.fillInstruction=Up,dP.render.canvas.Instruction.strokeInstruction=Wp,dP.render.canvas.LineStringBuilder=Qp,dP.render.canvas.PolygonBuilder=nm,dP.render.canvas.TextBuilder=om,dP.render.canvas.checkedFonts=Os,dP.render.canvas.defaultFillStyle=ys,dP.render.canvas.defaultFont=ms,dP.render.canvas.defaultLineCap=gs,dP.render.canvas.defaultLineDash=ws,dP.render.canvas.defaultLineDashOffset=0,dP.render.canvas.defaultLineJoin=bs,dP.render.canvas.defaultLineWidth=1,dP.render.canvas.defaultMiterLimit=xs,dP.render.canvas.defaultPadding=_s,dP.render.canvas.defaultStrokeStyle=js,dP.render.canvas.defaultTextAlign=Ms,dP.render.canvas.defaultTextBaseline=Ss,dP.render.canvas.drawImageOrLabel=Fs,dP.render.canvas.hitdetect={},dP.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=Sm,dP.render.canvas.hitdetect.createHitDetectionImageData=_m,dP.render.canvas.hitdetect.hitDetect=Om,dP.render.canvas.labelCache=ks,dP.render.canvas.measureAndCacheTextWidth=Rs,dP.render.canvas.measureTextHeight=Ns,dP.render.canvas.measureTextWidth=Is,dP.render.canvas.measureTextWidths=Ls,dP.render.canvas.registerFont=Ps,dP.render.canvas.rotateAtOffset=function(t,n,i,r){0!==n&&(t.translate(i,r),t.rotate(n),t.translate(-i,-r))},dP.render.canvas.textHeights=Cs,dP.render.getRenderPixel=function(t,n){var i=n.slice(0);return Ft(t.inversePixelTransform.slice(),i),i},dP.render.getVectorContext=uc,dP.render.toContext=function(t,n){var i=t.canvas,r=n||{},e=r.pixelRatio||Tt,o=r.size;o&&(i.width=o[0]*e,i.height=o[1]*e,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=qt([1,0,0,1,0,0],e,e);return new Yh(t,e,s,a,0)},dP.renderer={},dP.renderer.Composite=qs,dP.renderer.Layer=Sd,dP.renderer.Map=es,dP.renderer.canvas={},dP.renderer.canvas.ImageLayer=Td,dP.renderer.canvas.Layer=Od,dP.renderer.canvas.TileLayer=Ld,dP.renderer.canvas.VectorImageLayer=Em,dP.renderer.canvas.VectorLayer=Tm,dP.renderer.canvas.VectorTileLayer=Lm,dP.renderer.vector={},dP.renderer.vector.defaultOrder=rc,dP.renderer.vector.getSquaredTolerance=ec,dP.renderer.vector.getTolerance=oc,dP.renderer.vector.renderFeature=sc,dP.renderer.webgl={},dP.renderer.webgl.Layer=zp,dP.renderer.webgl.Layer.colorDecodeId=Np,dP.renderer.webgl.Layer.colorEncodeId=Pp,dP.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},dP.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,i,r,e,o){var s=3+e,a=t[n+0],u=t[n+1],h=Ap;h.length=e;for(var c=0;c1?x(i.TileMatrixSetLink,"projection"in n?function(t,i,r){var o=w(e,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=Zi(o),a=Zi(n.projection);return s&&a?rr(s,a):o==n.projection}:function(t,i,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,a=i.Format[0];"format"in n&&(a=n.format),(r=x(i.Style,(function(t,i,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var u=i.Style[r].Identifier,h={};"Dimension"in i&&i.Dimension.forEach((function(t,n,i){var r=t.Identifier,e=t.Default;void 0===e&&(e=t.Value[0]),h[r]=e}));var c,f=w(t.Contents.TileMatrixSet,(function(t,n,i){return t.Identifier==o})),l=f.SupportedCRS;if(l&&(c=Zi(l)),"projection"in n){var v=Zi(n.projection);v&&(c&&!rr(v,c)||(c=v))}var d=!1,m="ne"==c.getAxisOrientation().substr(0,2),y=f.TileMatrix[0],g={MinTileCol:0,MinTileRow:0,MaxTileCol:y.MatrixWidth-1,MaxTileRow:y.MatrixHeight-1};if(s){g=s[s.length-1];var b=w(f.TileMatrix,(function(t){return t.Identifier===g.TileMatrix||f.Identifier+":"+t.Identifier===g.TileMatrix}));b&&(y=b)}var j=28e-5*y.ScaleDenominator/c.getMetersPerUnit(),M=m?[y.TopLeftCorner[1],y.TopLeftCorner[0]]:y.TopLeftCorner,S=y.TileWidth*j,_=y.TileHeight*j,O=f.BoundingBox,k=[M[0]+S*g.MinTileCol,M[1]-_*(1+g.MaxTileRow),M[0]+S*(1+g.MaxTileCol),M[1]-_*g.MinTileRow];if(void 0!==O&&!hn(O,k)){var T=i.WGS84BoundingBox,A=Zi("EPSG:4326").getExtent();if(k=O,T)d=T[0]===A[0]&&T[2]===A[2];else{var E=ar(O,f.SupportedCRS,"EPSG:4326");d=E[0]-1e-10<=A[0]&&E[2]+1e-10>=A[2]}}var C=ll(f,k,s),P=[],N=n.requestEncoding;if(N=void 0!==N?N:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var z=t.OperationsMetadata.GetTile.DCP.HTTP.Get,I=0,R=z.length;I=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(t){}}(),n.destroy=(r=!1,function(){r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||function(){},t.exports=e(4701)(n),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},4701:function(t,n,e){function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return i(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e>1,f=-7,h=e?i-1:0,l=e?-1:1,v=t[n+h];for(h+=l,o=v&(1<<-f)-1,v>>=-f,f+=a;f>0;o=256*o+t[n+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[n+h],h+=l,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=c}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,e,r,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,s=f):(s=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-s))<1&&(s--,u*=2),(n+=s+h>=1?l/u:l*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(n*u-1)*Math.pow(2,i),s+=h):(a=n*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[e+v]=255&a,v+=d,a/=256,i-=8);for(s=s<0;t[e+v]=255&s,v+=d,s/=256,c-=8);t[e+v-d]|=128*p}},152:function(t){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return!!t&&("symbol"===n(Symbol.observable)&&"function"==typeof t[Symbol.observable]?t===t[Symbol.observable]():"function"==typeof t["@@observable"]&&t===t["@@observable"]())}},6875:function(t,n,e){"use strict";function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){for(var e=0;ethis[a])return k(this,this[p].get(t)),!1;var o=this[p].get(t).value;return this[l]&&(this[v]||this[l](t,o.value)),o.now=r,o.maxAge=e,o.value=n,this[u]+=i-o.length,o.length=i,this.get(t),x(this),!0}var s=new _(t,n,i,r,e);return s.length>this[a]?(this[l]&&this[l](t,n),!1):(this[u]+=s.length,this[d].unshift(s),this[p].set(t,this[d].head),x(this),!0)}},{key:"has",value:function(t){if(!this[p].has(t))return!1;var n=this[p].get(t).value;return!g(this,n)}},{key:"get",value:function(t){return w(this,t,!0)}},{key:"peek",value:function(t){return w(this,t,!1)}},{key:"pop",value:function(){var t=this[d].tail;return t?(k(this,t),t.value):null}},{key:"del",value:function(t){k(this,this[p].get(t))}},{key:"load",value:function(t){this.reset();for(var n=Date.now(),e=t.length-1;e>=0;e--){var r=t[e],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-n;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var t=this;this[p].forEach((function(n,e){return w(t,e,!1)}))}}]),t}(),w=function(t,n,e){var r=t[p].get(n);if(r){var i=r.value;if(g(t,i)){if(k(t,r),!t[f])return}else e&&(t[y]&&(r.value.now=Date.now()),t[d].unshiftNode(r));return i.value}},g=function(t,n){if(!n||!n.maxAge&&!t[h])return!1;var e=Date.now()-n.now;return n.maxAge?e>n.maxAge:t[h]&&e>t[h]},x=function(t){if(t[u]>t[a])for(var n=t[d].tail;t[u]>t[a]&&null!==n;){var e=n.prev;k(t,n),n=e}},k=function(t,n){if(n){var e=n.value;t[l]&&t[l](e.key,e.value),t[u]-=e.length,t[p].delete(e.key),t[d].removeNode(n)}},_=o((function t(n,e,i,o,s){r(this,t),this.key=n,this.value=e,this.length=i,this.now=o,this.maxAge=s||0})),S=function(t,n,e,r){var i=e.value;g(t,i)&&(k(t,e),t[f]||(i=void 0)),i&&n.call(r,i.value,i.key,t)};t.exports=b},1063:function(t){var n={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},e=" ",r=/(italic|oblique)$/i,i={};t.exports=function(t,o,s){var a=i[t];if(!a){Array.isArray(t)||(t=[t]);for(var u=400,c="normal",f=[],h=0,l=t.length;h=1.5*e;return Math.round(t/e)+" "+r+(i?"s":"")}t.exports=function(t,c){c=c||{};var f=n(t);if("string"===f&&t.length>0)return function(t){if((t=String(t)).length>100)return;var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!n)return;var u=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*s;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===f&&isFinite(t))return c.long?function(t){var n=Math.abs(t);if(n>=o)return u(t,n,o,"day");if(n>=i)return u(t,n,i,"hour");if(n>=r)return u(t,n,r,"minute");if(n>=e)return u(t,n,e,"second");return t+" ms"}(t):function(t){var n=Math.abs(t);if(n>=o)return Math.round(t/o)+"d";if(n>=i)return Math.round(t/i)+"h";if(n>=r)return Math.round(t/r)+"m";if(n>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9694:function(t,n,e){"use strict";function r(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(!t)return;if("string"==typeof t)return i(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i(t,n)}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw s}}}}function i(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}function y(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e1?e-1:0),i=1;i1,o=!1,s=n;return new r((function(n){return e.subscribe({next:function(e){var r=!o;if(o=!0,!r||i)try{s=t(s,e)}catch(t){return n.error(t)}else s=e},error:function(t){n.error(t)},complete:function(){if(!o&&!i)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(s),n.complete()}})}))}},{key:"concat",value:function(){for(var t=this,n=arguments.length,e=new Array(n),r=0;r=0&&i.splice(t,1),s()}});i.push(a)},error:function(t){r.error(t)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(t){return t.unsubscribe()})),o.unsubscribe()}}))}},{key:t,value:function(){return this}}],[{key:"from",value:function(t){var e="function"==typeof this?this:n;if(null==t)throw new TypeError(t+" is not an object");var r=g(t,b);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return k(i)&&i.constructor===e?i:new e((function(t){return i.subscribe(t)}))}if(c("iterator")){var o=g(t,m);if(o)return new e((function(n){S((function(){if(!n.closed){var e,r=p(o.call(t));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(n.next(i),n.closed)return}}catch(t){r.e(t)}finally{r.f()}n.complete()}}))}))}if(Array.isArray(t))return new e((function(n){S((function(){if(!n.closed){var e,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(n.next(i),n.closed)return}}catch(t){r.e(t)}finally{r.f()}n.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}function Z(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e>>0):4294967296*(n>>>0)+(t>>>0)}function f(t,n,e){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));e.realloc(r);for(var i=e.pos-1;i>=t;i--)e.buf[i+r]=e.buf[i]}function h(t,n){for(var e=0;e>>8,t[e+2]=n>>>16,t[e+3]=n>>>24}function k(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,n,e){for(e=e||this.length;this.pos>3,o=this.pos;this.type=7&r,t(i,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=k(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=g(this.buf,this.pos)+g(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=g(this.buf,this.pos)+k(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,e,r=this.buf;return n=127&(e=r[this.pos++]),e<128?n:(n|=(127&(e=r[this.pos++]))<<7,e<128?n:(n|=(127&(e=r[this.pos++]))<<14,e<128?n:(n|=(127&(e=r[this.pos++]))<<21,e<128?n:function(t,n,e){var r,i,o=e.buf;if(i=o[e.pos++],r=(112&i)>>4,i<128)return c(t,r,n);if(i=o[e.pos++],r|=(127&i)<<3,i<128)return c(t,r,n);if(i=o[e.pos++],r|=(127&i)<<10,i<128)return c(t,r,n);if(i=o[e.pos++],r|=(127&i)<<17,i<128)return c(t,r,n);if(i=o[e.pos++],r|=(127&i)<<24,i<128)return c(t,r,n);if(i=o[e.pos++],r|=(1&i)<<31,i<128)return c(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(e=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&a?function(t,n,e){return a.decode(t.subarray(n,e))}(this.buf,n,t):function(t,n,e){var r="",i=n;for(;i239?4:u>223?3:u>191?2:1;if(i+f>e)break;1===f?u<128&&(c=u):2===f?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===f?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((c=(15&u)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===f&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,f=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=f}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==i.Bytes)return t.push(this.readVarint(n));var e=u(this);for(t=t||[];this.pos127;);else if(n===i.Bytes)this.pos=this.readVarint()+this.pos;else if(n===i.Fixed32)this.pos+=4;else{if(n!==i.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n268435455||t<0?function(t,n){var e,r;t>=0?(e=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(e=~(-t%4294967296))?e=e+1|0:(e=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(e,0,n),function(t,n){var e=(7&t)<<4;if(n.buf[n.pos++]|=e|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(t,n,e){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):i=r;continue}if(r<56320){t[e++]=239,t[e++]=191,t[e++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[e++]=239,t[e++]=191,t[e++]=189,i=null);r<128?t[e++]=r:(r<2048?t[e++]=r>>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}(this.buf,t,this.pos);var e=this.pos-n;e>=128&&f(n,e,this),this.pos=n-1,this.writeVarint(e),this.pos+=e},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var e=0;e=128&&f(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,e){this.writeTag(t,i.Bytes),this.writeRawMessage(n,e)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,h,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,b,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writeBytesField:function(t,n){this.writeTag(t,i.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,i.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,i.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,i.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,i.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,i.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,i.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,i.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,i.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,i.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},7072:function(t,n,e){var r,i,o;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,r,i,o,s){!function t(e,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,c=Math.log(a),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(a-f)/a)*(u-a/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-u*f/a+h)),Math.min(o,Math.floor(r+(a-u)*f/a+h)),s)}var l=e[r],v=i,d=o;for(n(e,i,r),s(e[o],l)>0&&n(e,i,o);v0;)d--}0===s(e[i],l)?n(e,i,d):n(e,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,r,i||0,o||t.length-1,s||e)}function n(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function e(t,n){return tn?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,n,e){if(!e)return n.indexOf(t);for(var r=0;r=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,e,r,i,o){for(var s=[e,r];s.length;)if(!((r=s.pop())-(e=s.pop())<=i)){var a=e+Math.ceil((r-e)/i/2)*i;t(n,a,e,r,o),s.push(e,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,e=[];if(!v(t,n))return e;for(var r=this.toBBox,i=[];n;){for(var o=0;o=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(r,i,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,r);var s=this._chooseSplitIndex(e,i,r),a=d(e.children.splice(s,e.children.length-s));a.height=e.height,a.leaf=e.leaf,o(e,this.toBBox),o(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(e,a)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,i,o,a,u,c,h,l=1/0,v=1/0,d=n;d<=e-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,e,this.toBBox),m=(i=p,o=y,a=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,h-u)),b=f(p)+f(y);m=n;v--){var d=t.children[v];a(u,t.leaf?i(d):d),c+=h(u)}return c},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)a(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r},"object"==s(n)?t.exports=o():void 0===(i="function"==typeof(r=o)?r.call(n,e,n,t):r)||(t.exports=i)},6760:function(t,n,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(t){"use strict";var n,e=Object.prototype,i=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,e){return t[n]=e}}function f(t,n,e,r){var i=n&&n.prototype instanceof m?n:m,o=Object.create(i.prototype),s=new E(r||[]);return o._invoke=function(t,n,e){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return C()}for(e.method=i,e.arg=o;;){var s=e.delegate;if(s){var a=j(s,e);if(a){if(a===y)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===l)throw r=p,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=d;var u=h(t,n,e);if("normal"===u.type){if(r=e.done?p:v,u.arg===y)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(r=p,e.method="throw",e.arg=u.arg)}}}(t,e,s),o}function h(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l="suspendedStart",v="suspendedYield",d="executing",p="completed",y={};function m(){}function b(){}function w(){}var g={};c(g,s,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(A([])));k&&k!==e&&i.call(k,s)&&(g=k);var _=w.prototype=m.prototype=Object.create(g);function S(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function M(t,n){function e(o,s,a,u){var c=h(t[o],t,s);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"===r(l)&&i.call(l,"__await")?n.resolve(l.__await).then((function(t){e("next",t,a,u)}),(function(t){e("throw",t,a,u)})):n.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function i(){return new n((function(n,i){e(t,r,n,i)}))}return o=o?o.then(i,i):i()}}function j(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,j(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=h(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,y;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,y):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),c=i.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--e){var r=this.tryEntries[e];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var i=r.arg;T(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),y}},t}("object"===r(t=e.nmd(t))?t.exports:{});try{regeneratorRuntime=i}catch(t){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},2335:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.serialize=n.deserialize=n.registerSerializer=void 0;var r=e(9713),i=r.DefaultSerializer;n.registerSerializer=function(t){i=r.extendSerializer(i,t)},n.deserialize=function(t){return i.deserialize(t)},n.serialize=function(t){return i.serialize(t)}},769:function(t,n,e){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),i=this&&this.__exportStar||function(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||r(n,t,e)};Object.defineProperty(n,"__esModule",{value:!0}),n.Transfer=n.DefaultSerializer=n.expose=n.registerSerializer=void 0;var o=e(2335);Object.defineProperty(n,"registerSerializer",{enumerable:!0,get:function(){return o.registerSerializer}}),i(e(2305),n);var s=e(1459);Object.defineProperty(n,"expose",{enumerable:!0,get:function(){return s.expose}});var a=e(9713);Object.defineProperty(n,"DefaultSerializer",{enumerable:!0,get:function(){return a.DefaultSerializer}});var u=e(6126);Object.defineProperty(n,"Transfer",{enumerable:!0,get:function(){return u.Transfer}})},406:function(t,n){"use strict";var e;function r(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(n,"__esModule",{value:!0}),n.getBundleURL=n.getBaseURL=void 0,n.getBundleURL=function(){return e||(e=function(){try{throw new Error}catch(n){var t=(""+n.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}()),e},n.getBaseURL=r},4002:function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&f(t,n)}function o(t){var n=c();return function(){var e,r=h(t);if(n){var i=h(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return s(this,e)}}function s(t,n){if(n&&("object"===r(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var n="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return u(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,t)})(t)}function u(t,n,e){return(u=c()?Reflect.construct:function(t,n,e){var r=[null];r.push.apply(r,n);var i=new(Function.bind.apply(t,r));return e&&f(i,e.prototype),i}).apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,n){return(f=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,n){for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw s}}}}function o(t,n){if(t){if("string"==typeof t)return s(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,n):void 0}}function s(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]&&arguments[0];return s(this,void 0,void 0,regeneratorRuntime.mark((function n(){var e,r,i,o=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=function(){return y(o.workers,(function(t){return t.runningTasks}))},r=[],i=this.eventObservable.subscribe((function(t){t.type===l.PoolEventType.taskFailed&&r.push(t.error)})),!(this.initErrors.length>0)){n.next=5;break}return n.abrupt("return",Promise.reject(this.initErrors[0]));case 5:if(!t||0!==this.taskQueue.length){n.next=9;break}return n.next=8,f.allSettled(e());case 8:return n.abrupt("return",r);case 9:return n.next=11,new Promise((function(t,n){var e=o.eventObservable.subscribe({next:function(n){n.type===l.PoolEventType.taskQueueDrained&&(e.unsubscribe(),t(void 0))},error:n})}));case 11:return n.next=13,f.allSettled(e());case 13:return i.unsubscribe(),n.abrupt("return",r);case 15:case"end":return n.stop()}}),n,this)})))}},{key:"completed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s(this,void 0,void 0,regeneratorRuntime.mark((function n(){var e,r,i,o=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=this.settled(t),r=new Promise((function(t,n){var r=o.eventObservable.subscribe({next:function(i){i.type===l.PoolEventType.taskQueueDrained?(r.unsubscribe(),t(e)):i.type===l.PoolEventType.taskFailed&&(r.unsubscribe(),n(i.error))},error:n})})),n.next=4,Promise.race([e,r]);case 4:if(!((i=n.sent).length>0)){n.next=7;break}throw i[0];case 7:case"end":return n.stop()}}),n,this)})))}},{key:"events",value:function(){return this.eventObservable}},{key:"queue",value:function(t){var n=this,e=this.options.maxQueuedJobs,r=void 0===e?1/0:e;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];var i=this.nextTaskID++,o=this.taskCompletion(i);o.catch((function(t){n.debug("Task #".concat(i," errored:"),t)}));var s={id:i,run:t,cancel:function(){-1!==n.taskQueue.indexOf(s)&&(n.taskQueue=n.taskQueue.filter((function(t){return t!==s})),n.eventSubject.next({type:l.PoolEventType.taskCanceled,taskID:s.id}))},then:o.then.bind(o)};if(this.taskQueue.length>=r)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug("Queueing task #".concat(s.id,"...")),this.taskQueue.push(s),this.eventSubject.next({type:l.PoolEventType.taskQueued,taskID:s.id}),this.scheduleWork(),s}},{key:"terminate",value:function(t){return s(this,void 0,void 0,regeneratorRuntime.mark((function n(){var e=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.isClosing=!0,t){n.next=4;break}return n.next=4,this.completed(!0);case 4:return this.eventSubject.next({type:l.PoolEventType.terminated,remainingQueue:i(this.taskQueue)}),this.eventSubject.complete(),n.next=8,Promise.all(this.workers.map((function(t){return s(e,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=v.Thread,n.next=3,t.init;case 3:return n.t1=n.sent,n.abrupt("return",n.t0.terminate.call(n.t0,n.t1));case 5:case"end":return n.stop()}}),n)})))})));case 8:case"end":return n.stop()}}),n,this)})))}}])&&r(n.prototype,e),o&&r(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}();function b(t,n){return new m(t,n)}m.EventType=l.PoolEventType,b.EventType=l.PoolEventType,n.Pool=b},5441:function(t,n,e){"use strict";function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,i,o=[],s=!0,a=!1;try{for(e=e.call(t);!(s=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==e.return||e.return()}finally{if(a)throw i}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return o(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return o(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw s}}}}function o(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e]"),o);if(i&&console.log("start:",s),-1!==s){var a=t.slice(s+n.length),u=r(a,"[ /]"+n+">",0),c=-1===u;c&&(u=r(a,"[ /]>",0));var f=s+n.length+u+1+(c?0:n.length)+1;if(i&&console.log("end:",f),-1!==f){var h=t.slice(s,f);return{inner:c?null:h.slice(h.indexOf(">")+1,h.lastIndexOf("<")),outer:h,start:s,end:f}}}}},5051:function(t,n,e){var r=e(617);t.exports=function(t,n,e){for(var i,o=[],s=e&&e.debug||!1,a=e&&e.startIndex||0;i=r(t,n,{debug:s,startIndex:a});)a=i.end,o.push(i);return s&&console.log("findTagsByName found",o.length,"tags"),o}},5802:function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t,e,r){var i=r&&r.debug||!1;i&&console.log("getting "+e+" in "+t);var o="object"===n(t)?t.outer:t,s="".concat(e,'\\="([^"]*)"');i&&console.log("pattern:",s);var a=new RegExp(s).exec(o);if(i&&console.log("match:",a),a)return a[1]}},9279:function(t){t.exports=function(t,n,e){var r=new RegExp(n).exec(t.slice(e));return r?e+r.index:-1}},8518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.head;case 1:if(!n){t.next=7;break}return t.next=4,n.value;case 4:n=n.next,t.next=1;break;case 7:case"end":return t.stop()}}),t,this)}))}},8692:function(t,n,e){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var e=0,i=arguments.length;e1)e=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,e=this.head.value}for(var i=0;null!==r;i++)e=t(e,r.value,i),r=r.next;return e},r.prototype.reduceReverse=function(t,n){var e,r=this.tail;if(arguments.length>1)e=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,e=this.tail.value}for(var i=this.length-1;null!==r;i--)e=t(e,r.value,i),r=r.prev;return e},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,e=this.head;null!==e;n++)t[n]=e.value,e=e.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,e=this.tail;null!==e;n++)t[n]=e.value,e=e.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var e=new r;if(nthis.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)e.push(o.value);return e},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var e=0,r=this.head;null!==r&&e>1)],n))<0?s=r+1:(a=r,u=!i);return u?s:~s}function p(t,n){return t>n?1:t=0}function m(t,n,e){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var i=void 0;if(e>0){for(i=1;i0?i-1:i:t[i-1]-n>>0,i=0;i0||e&&0===o)}))}function S(){return!0}function M(){return!1}function j(){}function O(t){var n,e,r,i=!1;return function(){var o=Array.prototype.slice.call(arguments);return i&&this===r&&x(o,e)||(i=!0,r=this,e=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var E="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1,i=arguments.length;r0)},n.prototype.removeEventListener=function(t,n){var e=this.O&&this.O[t];if(e){var r=e.indexOf(n);-1!==r&&(this._&&t in this._?(e[r]=j,++this._[t]):(e.splice(r,1),0===e.length&&delete this.O[t]))}},n}(v),D="change",N="error",z="clear",L="contextmenu",F="click",G="dblclick",U="dragenter",B="dragover",q="drop",$="keydown",V="keypress",Z="load",W="resize",H="touchmove",K="wheel";function X(t,n,e,r,i){if(r&&r!==t&&(e=e.bind(r)),i){var o=e;e=function(){t.removeEventListener(n,e),o.apply(this,arguments)}}var s={target:t,type:n,listener:e};return t.addEventListener(n,e),s}function Y(t,n,e,r){return X(t,n,e,r,!0)}function J(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),A(t))}var Q=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tt=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return Q(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(D)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var e=t.length,r=new Array(e),i=0;i0;)this.pop()},n.prototype.extend=function(t){for(var n=0,e=t.length;nt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.G)return 1;var e=this.U[t];if(e){if(-1===e)return 1}else e=n,this.U[t]=e;var r=n-e+1e3/60;return r>=this.G?1:mt(r/this.G)},n.prototype.inTransition=function(t){return!!this.G&&-1!==this.U[t]},n.prototype.endTransition=function(t){this.G&&(this.U[t]=-1)},n}(P),_t=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),St=function(t){function n(n){var e=this,r=lt;return(e=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).B=n.loader,e.q=null,e.V=null,e}return _t(n,t),n.prototype.getData=function(){return this.q},n.prototype.getError=function(){return this.V},n.prototype.load=function(){this.state=vt,this.changed();var t=this;this.B().then((function(n){t.q=n,t.state=dt,t.changed()})).catch((function(n){t.V=n,t.state=pt,t.changed()}))},n}(kt);function Mt(t,n){if(!t)throw new c(n)}var jt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function Ot(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(Mt("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Tt=function(t){function n(n){var e=t.call(this)||this;if(e.on,e.once,e.un,e.W=void 0,e.H="geometry",e.K=null,e.tt=void 0,e.nt=null,e.addChangeListener(e.H,e.et),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;e.setGeometry(r)}else{var i=n;e.setProperties(i)}return e}return jt(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var e=this.getGeometry();e&&t.setGeometry(e.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.H)},n.prototype.getId=function(){return this.W},n.prototype.getGeometryName=function(){return this.H},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.et=function(){this.nt&&(J(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=X(t,D,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.H,t)},n.prototype.setStyle=function(t){this.K=t,this.tt=t?Ot(t):void 0,this.changed()},n.prototype.setId=function(t){this.W=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.H,this.et),this.H=t,this.addChangeListener(this.H,this.et),this.et()},n}(ot),Et="XY",At="XYZ",Ct="XYM",Rt="XYZM",It={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Pt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Dt={9001:Pt.METERS,9002:Pt.FEET,9003:Pt.USFEET,9101:Pt.RADIANS,9102:Pt.DEGREES};function Nt(t){return Dt[t]}var zt={};zt[Pt.RADIANS]=6370997/(2*Math.PI),zt[Pt.DEGREES]=2*Math.PI*6370997/360,zt[Pt.FEET]=.3048,zt[Pt.METERS]=1,zt[Pt.USFEET]=1200/3937;var Lt,Ft=Pt,Gt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ut=-1!==Gt.indexOf("firefox"),Bt=-1!==Gt.indexOf("safari")&&-1==Gt.indexOf("chrom"),qt=-1!==Gt.indexOf("webkit")&&-1==Gt.indexOf("edge"),$t=-1!==Gt.indexOf("macintosh"),Vt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Zt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Wt="undefined"!=typeof Image&&Image.prototype.decode,Ht=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Kt=new Array(6);function Xt(){return[1,0,0,1,0,0]}function Yt(t){return Qt(t,1,0,0,1,0,0)}function Jt(t,n){var e=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],u=n[0],c=n[1],f=n[2],h=n[3],l=n[4],v=n[5];return t[0]=e*u+i*c,t[1]=r*u+o*c,t[2]=e*f+i*h,t[3]=r*f+o*h,t[4]=e*l+i*v+s,t[5]=r*l+o*v+a,t}function Qt(t,n,e,r,i,o,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function tn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function nn(t,n){var e=n[0],r=n[1];return n[0]=t[0]*e+t[2]*r+t[4],n[1]=t[1]*e+t[3]*r+t[5],n}function en(t,n){var e=Math.cos(n),r=Math.sin(n);return Jt(t,Qt(Kt,e,r,-r,e,0,0))}function rn(t,n,e){return Jt(t,Qt(Kt,n,0,0,e,0,0))}function on(t,n,e){return Qt(t,n,0,0,e,0,0)}function sn(t,n,e){return Jt(t,Qt(Kt,1,0,0,1,n,e))}function an(t,n,e,r,i,o,s,a){var u=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*u,t[2]=-r*u,t[3]=i*c,t[4]=s*r*c-a*r*u+n,t[5]=s*i*u+a*i*c+e,t}function un(t,n){var e=cn(n);Mt(0!==e,32);var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5];return t[0]=s/e,t[1]=-i/e,t[2]=-o/e,t[3]=r/e,t[4]=(o*u-s*a)/e,t[5]=-(r*u-i*a)/e,t}function cn(t){return t[0]*t[3]-t[1]*t[2]}function fn(t){var n="matrix("+t.join(", ")+")";if(Zt)return n;var e=Lt||(Lt=document.createElement("div"));return e.style.transform=n,e.style.transform}var hn="bottom-left",ln="bottom-right",vn="top-left",dn="top-right",pn=0,yn=1,mn=2,bn=4,wn=8,gn=16;function xn(t){for(var n=En(),e=0,r=t.length;ei&&(u|=bn),ao&&(u|=mn),u===pn&&(u=yn),u}function En(){return[1/0,1/0,-1/0,-1/0]}function An(t,n,e,r,i){return i?(i[0]=t,i[1]=n,i[2]=e,i[3]=r,i):[t,n,e,r]}function Cn(t){return An(1/0,1/0,-1/0,-1/0,t)}function Rn(t,n){var e=t[0],r=t[1];return An(e,r,e,r,n)}function In(t,n,e,r,i){return Fn(Cn(i),t,n,e,r)}function Pn(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function Dn(t,n,e){return Math.abs(t[0]-n[0])t[2]&&(t[2]=n[2]),n[1]t[3]&&(t[3]=n[3]),t}function zn(t,n){n[0]t[2]&&(t[2]=n[0]),n[1]t[3]&&(t[3]=n[1])}function Ln(t,n){for(var e=0,r=n.length;en[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function ne(t){return t[2]=s&&p<=u),r||!(o&bn)||i&bn||(r=(y=v-(l-u)*d)>=a&&y<=c),r||!(o&wn)||i&wn||(r=(p=l-(v-a)/d)>=s&&p<=u),r||!(o&gn)||i&gn||(r=(y=v-(l-s)*d)>=a&&y<=c)}return r}function oe(t,n,e,r){var i=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=e[2])){var i=Qn(e),o=Math.floor((r[0]-e[0])/i)*i;t[0]-=o,t[2]-=o}return t}var ae=function(){function t(t){this.it=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ct=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ft=void 0!==t.global&&t.global,this.ht=!(!this.ft||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ht},t.prototype.getCode=function(){return this.it},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||zt[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ct},t.prototype.isGlobal=function(){return this.ft},t.prototype.setGlobal=function(t){this.ft=t,this.ht=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ht=!(!this.ft||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function ue(t,n,e){return Math.min(Math.max(t,n),e)}var ce="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},fe="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function he(t,n,e,r,i,o){var s=i-e,a=o-r;if(0!==s||0!==a){var u=((t-e)*s+(n-r)*a)/(s*s+a*a);u>1?(e=i,r=o):u>0&&(e+=s*u,r+=a*u)}return le(t,n,e,r)}function le(t,n,e,r){var i=e-t,o=r-n;return i*i+o*o}function ve(t){for(var n=t.length,e=0;ei&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[e],t[e]=a;for(var u=e+1;u=0;l--){h[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*h[l]}return h}function de(t){return 180*t/Math.PI}function pe(t){return t*Math.PI/180}function ye(t,n){var e=t%n;return e*n<0?e+n:e}function me(t,n,e){return t+e*(n-t)}function be(t,n){var e=Math.pow(10,n);return Math.round(t*e)/e}function we(t,n){return Math.round(be(t,n))}function ge(t,n){return Math.floor(be(t,n))}function xe(t,n){return Math.ceil(be(t,n))}var ke=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),_e=6378137,Se=Math.PI*_e,Me=[-Se,-Se,Se,Se],je=[-180,-85,180,85],Oe=_e*Math.log(Math.tan(Math.PI/2)),Te=function(t){function n(n){return t.call(this,{code:n,units:Ft.METERS,extent:Me,global:!0,worldExtent:je,getPointResolution:function(t,n){return t/ce(n[1]/_e)}})||this}return ke(n,t),n}(ae),Ee=[new Te("EPSG:3857"),new Te("EPSG:102100"),new Te("EPSG:102113"),new Te("EPSG:900913"),new Te("http://www.opengis.net/def/crs/EPSG/0/3857"),new Te("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ae(t,n,e){var r=t.length,i=e>1?e:2,o=n;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;sOe?a=Oe:a<-Oe&&(a=-Oe),o[s+1]=a}return o}function Ce(t,n,e){var r=t.length,i=e>1?e:2,o=n;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;sn?r:new Array(1+n-i).join("0")+r}function Je(t,n){for(var e=(""+t).split("."),r=(""+n).split("."),i=0;is)return 1;if(s>o)return-1}return 0}function Qe(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function tr(t,n){var e=n.getRadius(),r=n.getCenter(),i=r[0],o=r[1],s=t[0]-i,a=t[1]-o;0===s&&0===a&&(s=1);var u=Math.sqrt(s*s+a*a);return[i+e*s/u,o+e*a/u]}function nr(t,n){var e,r,i=t[0],o=t[1],s=n[0],a=n[1],u=s[0],c=s[1],f=a[0],h=a[1],l=f-u,v=h-c,d=0===l&&0===v?0:(l*(i-u)+v*(o-c))/(l*l+v*v||0);return d<=0?(e=u,r=c):d>=1?(e=f,r=h):(e=u+d*l,r=c+d*v),[e,r]}function er(t,n,e){var r=ye(n+180,360)-180,i=Math.abs(3600*r),o=e||0,s=Math.pow(10,o),a=Math.floor(i/3600),u=Math.floor((i-3600*a)/60),c=i-3600*a-60*u;return(c=Math.ceil(c*s)/s)>=60&&(c=0,u+=1),u>=60&&(u=0,a+=1),a+"° "+Ye(u,2)+"′ "+Ye(c,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function rr(t,n,e){return t?n.replace("{x}",t[0].toFixed(e)).replace("{y}",t[1].toFixed(e)):""}function ir(t,n){for(var e=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){e=!1;break}return e}function or(t,n){var e=Math.cos(n),r=Math.sin(n),i=t[0]*e-t[1]*r,o=t[1]*e+t[0]*r;return t[0]=i,t[1]=o,t}function sr(t,n){return t[0]*=n,t[1]*=n,t}function ar(t,n){var e=t[0]-n[0],r=t[1]-n[1];return e*e+r*r}function ur(t,n){return Math.sqrt(ar(t,n))}function cr(t,n){return ar(t,nr(t,n))}function fr(t,n){return rr(t,"{x}, {y}",n)}function hr(t,n){if(n.canWrapX()){var e=Qn(n.getExtent()),r=lr(t,n,e);r&&(t[0]-=r*e)}return t}function lr(t,n,e){var r=n.getExtent(),i=0;if(n.canWrapX()&&(t[0]r[2])){var o=e||Qn(r);i=Math.floor((t[0]-r[0])/o)}return i}function vr(t,n,e){var r;if(void 0!==n){for(var i=0,o=t.length;i=2;--c)s[a+c]=n[a+c]}return s}}function _r(t,n,e,r){var i=mr(t),o=mr(n);$e(i,o,kr(e)),$e(o,i,kr(r))}function Sr(t,n){return Tr(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")}function Mr(t,n){if(t===n)return!0;var e=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||jr(t,n)===vr)&&e}function jr(t,n){var e=Ve(t.getCode(),n.getCode());return e||(e=dr),e}function Or(t,n){return jr(mr(t),mr(n))}function Tr(t,n,e){return Or(n,e)(t,void 0,t.length)}function Er(t,n,e,r){return oe(t,Or(n,e),void 0,r)}var Ar=null;function Cr(t){Ar=mr(t)}function Rr(){return Ar}function Ir(t,n){return Ar?Tr(t,n,Ar):t}function Pr(t,n){return Ar?Tr(t,Ar,n):t}function Dr(t,n){return Ar?Er(t,n,Ar):t}function Nr(t,n){return Ar?Er(t,Ar,n):t}function zr(t,n){if(!Ar)return t;var e=mr(n).getUnits(),r=Ar.getUnits();return e&&r?t*zt[e]/zt[r]:t}function Lr(t,n){if(!Ar)return t;var e=mr(n).getUnits(),r=Ar.getUnits();return e&&r?t*zt[r]/zt[e]:t}function Fr(t,n,e){return function(r){var i,o,s=r[0],a=r[1];if(t.canWrapX()){var u=t.getExtent(),c=Qn(u);(o=lr(r,t,c))&&(s-=o*c),s=ue(s,u[0],u[2]),a=ue(a,u[1],u[3]),i=e([s,a])}else i=e(r);return o&&n.canWrapX()&&(i[0]+=o*Qn(n.getExtent())),i}}function Gr(){wr(Ee),wr(ze),gr(ze,Ee,Ae,Ce)}function Ur(t,n,e,r,i,o){for(var s=o||[],a=0,u=n;u1)a=e;else{if(l>0){for(var v=0;vi&&(i=c),o=a,s=u}return i}function ti(t,n,e,r,i){for(var o=0,s=e.length;o0;){for(var h=c.pop(),l=c.pop(),v=0,d=t[l],p=t[l+1],y=t[h],m=t[h+1],b=l+r;bv&&(f=b,v=w)}v>i&&(u[(f-n)/r]=1,l+ri&&(o[s++]=c,o[s++]=f,a=c,u=f);return c==a&&f==u||(o[s++]=c,o[s++]=f),s}function li(t,n){return n*Math.round(t/n)}function vi(t,n,e,r,i,o,s){if(n==e)return s;var a,u,c=li(t[n],i),f=li(t[n+1],i);n+=r,o[s++]=c,o[s++]=f;do{if(a=li(t[n],i),u=li(t[n+1],i),(n+=r)==e)return o[s++]=a,o[s++]=u,s}while(a==c&&u==f);for(;n0&&p>v)&&(d<0&&y0&&y>d)?(a=h,u=l):(o[s++]=a,o[s++]=u,c=a,f=u,a=h,u=l)}}return o[s++]=a,o[s++]=u,s}function di(t,n,e,r,i,o,s,a){for(var u=0,c=e.length;uo&&(c-a)*(o-u)-(i-a)*(f-u)>0&&s++:f<=o&&(c-a)*(o-u)-(i-a)*(f-u)<0&&s--,a=c,u=f}return 0!==s}function Ti(t,n,e,r,i,o){if(0===e.length)return!1;if(!Oi(t,n,e[0],r,i,o))return!1;for(var s=1,a=e.length;sx&&Ti(t,n,e,r,c=(f+h)/2,d)&&(g=c,x=k),f=h}return isNaN(g)&&(g=i[o]),s?(s.push(g,d,x),s):[g,d,x]}function Ci(t,n,e,r,i){for(var o=[],s=0,a=e.length;s=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||Ri(t,n,e,r,(function(t,n){return ie(i,t,n)})))))}function Pi(t,n,e,r,i){for(var o=0,s=e.length;o0}function Gi(t,n,e,r,i){for(var o=void 0!==i&&i,s=0,a=e.length;s0&&this.Ht[e+2]>t;)e-=3;var r=this.Ht[n+2]-this.Ht[e+2];if(r<1e3/60)return!1;var i=this.Ht[n]-this.Ht[e],o=this.Ht[n+1]-this.Ht[e+1];return this.Kt=Math.atan2(o,i),this.Xt=Math.sqrt(i*i+o*o)/r,this.Xt>this.Zt},t.prototype.getDistance=function(){return(this.Zt-this.Xt)/this.Vt},t.prototype.getAngle=function(){return this.Kt},t}(),Io=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Po=/^([a-z]*)$|^hsla?\(.*\)$/i;function Do(t){return"string"==typeof t?t:Go(t)}function No(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var e=getComputedStyle(n).color;return document.body.removeChild(n),e}return""}var zo=function(){var t={},n=0;return function(e){var r;if(t.hasOwnProperty(e))r=t[e];else{if(n>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--n)}r=function(t){var n,e,r,i,o;Po.exec(t)&&(t=No(t));if(Io.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var u=4===s||8===s;n=parseInt(t.substr(1+0*a,a),16),e=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),i=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(n=(n<<4)+n,e=(e<<4)+e,r=(r<<4)+r,u&&(i=(i<<4)+i)),o=[n,e,r,i/255]}else 0==t.indexOf("rgba(")?Fo(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Fo(o)):Mt(!1,14);return o}(e),t[e]=r,++n}return r}}();function Lo(t){return Array.isArray(t)?t:zo(t)}function Fo(t){return t[0]=ue(t[0]+.5|0,0,255),t[1]=ue(t[1]+.5|0,0,255),t[2]=ue(t[2]+.5|0,0,255),t[3]=ue(t[3],0,1),t}function Go(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var e=t[1];e!=(0|e)&&(e=e+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+e+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Uo(t){return Po.test(t)&&(t=No(t)),Io.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Bo=function(){function t(){this.Yt={},this.Jt=0,this.Qt=32}return t.prototype.clear=function(){this.Yt={},this.Jt=0},t.prototype.canExpireCache=function(){return this.Jt>this.Qt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Yt){var e=this.Yt[n];0!=(3&t++)||e.hasListener()||(delete this.Yt[n],--this.Jt)}}},t.prototype.get=function(t,n,e){var r=qo(t,n,e);return r in this.Yt?this.Yt[r]:null},t.prototype.set=function(t,n,e,r){var i=qo(t,n,e);this.Yt[i]=r,++this.Jt},t.prototype.setSize=function(t){this.Qt=t,this.expire()},t}();function qo(t,n,e){return n+":"+t+":"+(e?Do(e):"null")}var $o=Bo,Vo=new Bo,Zo="opacity",Wo="visible",Ho="extent",Ko="zIndex",Xo="maxResolution",Yo="minResolution",Jo="maxZoom",Qo="minZoom",ts="source",ns="map";function es(t){return(es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var rs=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),is=function(t){function n(n){var e=t.call(this)||this;e.on,e.once,e.un,e.tn=n.background;var r=E({},n);return"object"===es(n.properties)&&(delete r.properties,E(r,n.properties)),r[Zo]=void 0!==n.opacity?n.opacity:1,Mt("number"==typeof r[Zo],64),r[Wo]=void 0===n.visible||n.visible,r[Ko]=n.zIndex,r[Xo]=void 0!==n.maxResolution?n.maxResolution:1/0,r[Yo]=void 0!==n.minResolution?n.minResolution:0,r[Qo]=void 0!==n.minZoom?n.minZoom:-1/0,r[Jo]=void 0!==n.maxZoom?n.maxZoom:1/0,e.nn=void 0!==r.className?n.className:"ol-layer",delete r.className,e.setProperties(r),e.en=null,e}return rs(n,t),n.prototype.getBackground=function(){return this.tn},n.prototype.getClassName=function(){return this.nn},n.prototype.getLayerState=function(t){var n=this.en||{layer:this,managed:void 0===t||t},e=this.getZIndex();return n.opacity=ue(Math.round(100*this.getOpacity())/100,0,1),n.sourceState=this.getSourceState(),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==e||n.managed?e:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.en=n,n},n.prototype.getLayersArray=function(t){return r()},n.prototype.getLayerStatesArray=function(t){return r()},n.prototype.getExtent=function(){return this.get(Ho)},n.prototype.getMaxResolution=function(){return this.get(Xo)},n.prototype.getMinResolution=function(){return this.get(Yo)},n.prototype.getMinZoom=function(){return this.get(Qo)},n.prototype.getMaxZoom=function(){return this.get(Jo)},n.prototype.getOpacity=function(){return this.get(Zo)},n.prototype.getSourceState=function(){return r()},n.prototype.getVisible=function(){return this.get(Wo)},n.prototype.getZIndex=function(){return this.get(Ko)},n.prototype.setBackground=function(t){this.tn=t,this.changed()},n.prototype.setExtent=function(t){this.set(Ho,t)},n.prototype.setMaxResolution=function(t){this.set(Xo,t)},n.prototype.setMinResolution=function(t){this.set(Yo,t)},n.prototype.setMaxZoom=function(t){this.set(Jo,t)},n.prototype.setMinZoom=function(t){this.set(Qo,t)},n.prototype.setOpacity=function(t){Mt("number"==typeof t,64),this.set(Zo,t)},n.prototype.setVisible=function(t){this.set(Wo,t)},n.prototype.setZIndex=function(t){this.set(Ko,t)},n.prototype.disposeInternal=function(){this.en&&(this.en.layer=null,this.en=null),t.prototype.disposeInternal.call(this)},n}(ot),os="prerender",ss="postrender",as="precompose",us="postcompose",cs="rendercomplete",fs="undefined",hs="loading",ls="ready",vs="error",ds=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function ps(t,n){if(!t.visible)return!1;var e=n.resolution;if(e=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var ys=function(t){function n(n){var e=this,r=E({},n);delete r.source,(e=t.call(this,r)||this).on,e.once,e.un,e.rn=null,e.sn=null,e.an=null,e.cn=null,n.render&&(e.render=n.render),n.map&&e.setMap(n.map),e.addChangeListener(ts,e.fn);var i=n.source?n.source:null;return e.setSource(i),e}return ds(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(ts)||null},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():fs},n.prototype.hn=function(){this.changed()},n.prototype.fn=function(){this.an&&(J(this.an),this.an=null);var t=this.getSource();t&&(this.an=X(t,D,this.hn,this)),this.changed()},n.prototype.getFeatures=function(t){return this.cn?this.cn.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.render=function(t,n){var e=this.getRenderer();if(e.prepareFrame(t))return e.renderFrame(t,n)},n.prototype.setMapInternal=function(t){this.set(ns,t)},n.prototype.getMapInternal=function(){return this.get(ns)},n.prototype.setMap=function(t){this.rn&&(J(this.rn),this.rn=null),t||this.changed(),this.sn&&(J(this.sn),this.sn=null),t&&(this.rn=X(t,as,(function(t){var n=t.frameState.layerStatesArray,e=this.getLayerState(!1);Mt(!n.some((function(t){return t.layer===e.layer})),67),n.push(e)}),this),this.sn=X(this,D,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(ts,t)},n.prototype.getRenderer=function(){return this.cn||(this.cn=this.createRenderer()),this.cn},n.prototype.hasRenderer=function(){return!!this.cn},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.cn&&(this.cn.dispose(),delete this.cn),this.setSource(null),t.prototype.disposeInternal.call(this)},n}(is),ms=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function bs(t,n){Vo.expire()}var ws=function(t){function n(n){var e=t.call(this)||this;return e.vn=n,e}return ms(n,t),n.prototype.dispatchRenderEvent=function(t,n){r()},n.prototype.calculateMatrices2D=function(t){var n=t.viewState,e=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;an(e,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),un(r,e)},n.prototype.forEachFeatureAtCoordinate=function(t,n,e,r,i,o,s,a){var u,c=n.viewState;function f(t,n,e,r){return i.call(o,n,t?e:null,r)}var h=c.projection,l=hr(t.slice(),h),v=[[0,0]];if(h.canWrapX()&&r){var d=Qn(h.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,y=p.length,m=[],b=[],w=0;w=0;--g){var x=p[g],k=x.layer;if(k.hasRenderer()&&ps(x,c)&&s.call(a,k)){var _=k.getRenderer(),S=k.getSource();if(_&&S){var M=S.getWrapX()?l:t,j=f.bind(null,x.managed);b[0]=M[0]+v[w][0],b[1]=M[1]+v[w][1],u=_.forEachFeatureAtCoordinate(b,n,e,j,m)}if(u)return u}}if(0!==m.length){var O=1/m.length;return m.forEach((function(t,n){return t.distanceSq+=n*O})),m.sort((function(t,n){return t.distanceSq-n.distanceSq})),m.some((function(t){return u=t.callback(t.feature,t.layer,t.geometry)})),u}},n.prototype.forEachLayerAtPixel=function(t,n,e,i,o){return r()},n.prototype.hasFeatureAtCoordinate=function(t,n,e,r,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,e,r,S,this,i,o)},n.prototype.getMap=function(){return this.vn},n.prototype.renderFrame=function(t){r()},n.prototype.scheduleExpireIconCache=function(t){Vo.canExpireCache()&&t.postRenderFunctions.push(bs)},n}(v),gs=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),xs=function(t){function n(n,e,r,i){var o=t.call(this,n)||this;return o.inversePixelTransform=e,o.frameState=r,o.context=i,o}return gs(n,t),n}(h),ks="ol-hidden",_s="ol-selectable",Ss="ol-unselectable",Ms="ol-unsupported",js="ol-control",Os="ol-collapsed",Ts=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Es=["style","variant","weight","size","lineHeight","family"],As=function(t){var n=t.match(Ts);if(!n)return null;for(var e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=Es.length;r=0;--o)r[o].renderDeclutter(t);Eo(this.pn,this.yn),this.dispatchRenderEvent(us,t),this.mn||(this.pn.style.display="",this.mn=!0),this.scheduleExpireIconCache(t)}else this.mn&&(this.pn.style.display="none",this.mn=!1)},n.prototype.forEachLayerAtPixel=function(t,n,e,r,i){for(var o=n.viewState,s=n.layerStatesArray,a=s.length-1;a>=0;--a){var u=s[a],c=u.layer;if(c.hasRenderer()&&ps(u,o)&&i(c)){var f=c.getRenderer().getDataAtPixel(t,n,e);if(f){var h=r(c,f);if(h)return h}}}},n}(ws),ra=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ia=function(t){function n(n,e){var r=t.call(this,n)||this;return r.layer=e,r}return ra(n,t),n}(h),oa="layers",sa=function(t){function n(n){var e=this,r=n||{},i=E({},r);delete i.layers;var o=r.layers;return(e=t.call(this,i)||this).on,e.once,e.un,e.bn=[],e.wn={},e.addChangeListener(oa,e.gn),o?Array.isArray(o)?o=new ht(o.slice(),{unique:!0}):Mt("function"==typeof o.getArray,43):o=new ht(void 0,{unique:!0}),e.setLayers(o),e}return ra(n,t),n.prototype.xn=function(){this.changed()},n.prototype.gn=function(){this.bn.forEach(J),this.bn.length=0;var t=this.getLayers();for(var n in this.bn.push(X(t,st,this.kn,this),X(t,at,this._n,this)),this.wn)this.wn[n].forEach(J);A(this.wn);for(var e=t.getArray(),r=0,i=e.length;rthis.In||Math.abs(t.clientY-this.Pn.clientY)>this.In},n.prototype.disposeInternal=function(){this.Gn&&(J(this.Gn),this.Gn=null),this.pn.removeEventListener(H,this.Bn),this.zn&&(J(this.zn),this.zn=null),this.Rn.forEach(J),this.Rn.length=0,this.pn=null,t.prototype.disposeInternal.call(this)},n}(P),ba="postrender",wa="movestart",ga="moveend",xa="layergroup",ka="size",_a="target",Sa="view",Ma=1/0,ja=function(){function t(t,n){this.Xn=t,this.Yn=n,this.Jn=[],this.Qn=[],this.te={}}return t.prototype.clear=function(){this.Jn.length=0,this.Qn.length=0,A(this.te)},t.prototype.dequeue=function(){var t=this.Jn,n=this.Qn,e=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.ne(0));var r=this.Yn(e);return delete this.te[r],e},t.prototype.enqueue=function(t){Mt(!(this.Yn(t)in this.te),31);var n=this.Xn(t);return n!=Ma&&(this.Jn.push(t),this.Qn.push(n),this.te[this.Yn(t)]=!0,this.ee(0,this.Jn.length-1),!0)},t.prototype.getCount=function(){return this.Jn.length},t.prototype.re=function(t){return 2*t+1},t.prototype.ie=function(t){return 2*t+2},t.prototype.oe=function(t){return t-1>>1},t.prototype.se=function(){var t;for(t=(this.Jn.length>>1)-1;t>=0;t--)this.ne(t)},t.prototype.isEmpty=function(){return 0===this.Jn.length},t.prototype.isKeyQueued=function(t){return t in this.te},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Yn(t))},t.prototype.ne=function(t){for(var n=this.Jn,e=this.Qn,r=n.length,i=n[t],o=e[t],s=t;t>1;){var a=this.re(t),u=this.ie(t),c=ut;){var s=this.oe(n);if(!(r[s]>o))break;e[n]=e[s],r[n]=r[s],n=s}e[n]=i,r[n]=o},t.prototype.reprioritize=function(){var t,n,e,r=this.Xn,i=this.Jn,o=this.Qn,s=0,a=i.length;for(n=0;n0;)r=(e=this.dequeue()[0]).getKey(),e.getState()!==lt||r in this.fe||(this.fe[r]=!0,++this.ce,++i,e.load())},n}(ja);function Ea(t,n,e,r,i){if(!t||!(e in t.wantedTiles))return Ma;if(!t.wantedTiles[e][n.getKey()])return Ma;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}var Aa=0,Ca=1,Ra={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ia=256;function Pa(t,n,e){return function(r,i,o,s,a){if(r){var u=n?0:o[0]*i,c=n?0:o[1]*i,f=a?a[0]:0,h=a?a[1]:0,l=t[0]+u/2+f,v=t[2]-u/2+f,d=t[1]+c/2+h,p=t[3]-c/2+h;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var y=ue(r[0],l,v),m=ue(r[1],d,p),b=30*i;return s&&e&&(y+=-b*Math.log(1+Math.max(0,l-r[0])/b)+b*Math.log(1+Math.max(0,r[0]-v)/b),m+=-b*Math.log(1+Math.max(0,d-r[1])/b)+b*Math.log(1+Math.max(0,r[1]-p)/b)),[y,m]}}}function Da(t){return t}function Na(t,n,e,r){var i=Qn(n)/e[0],o=Kn(n)/e[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function za(t,n,e){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,e&&(r=Math.max(r,e),r/=Math.log(1+50*Math.max(0,e/t-1))/50+1),ue(r,e/2,2*n)}function La(t,n,e,r){return function(i,o,s,a){if(void 0!==i){var u=t[0],c=t[t.length-1],f=e?Na(u,e,s,r):u;if(a)return void 0===n||n?za(i,f,c):ue(i,c,f);var h=Math.min(f,i),l=Math.floor(m(t,h,o));return t[l]>f&&l1&&"function"==typeof arguments[e-1]&&(n=arguments[e-1],--e);for(var r=0;r0},n.prototype.getInteracting=function(){return this.he[Ca]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(Aa,-this.he[Aa]);for(var n=0,e=this.le.length;n=0;--e){for(var r=this.le[e],i=!0,o=0,s=r.length;o0?u/a.duration:1;c>=1?(a.complete=!0,c=1):i=!1;var f=a.easing(c);if(a.sourceCenter){var h=a.sourceCenter[0],l=a.sourceCenter[1],v=a.targetCenter[0],d=a.targetCenter[1];this.we=a.targetCenter;var p=h+f*(v-h),y=l+f*(d-l);this.ye=[p,y]}if(a.sourceResolution&&a.targetResolution){var m=1===f?a.targetResolution:a.sourceResolution+f*(a.targetResolution-a.sourceResolution);if(a.anchor){var b=this.Pe(this.getRotation()),w=this.Ae.resolution(m,0,b,!0);this.ye=this.calculateCenterZoom(w,a.anchor)}this.ge=a.targetResolution,this.me=m,this.De(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===f?ye(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+f*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.Ae.rotation(g,!0);this.ye=this.calculateCenterRotate(x,a.anchor)}this.xe=a.targetRotation,this.be=g}if(this.De(!0),n=!0,!a.complete)break}}if(i){this.le[e]=null,this.setHint(Aa,-1),this.we=null,this.ge=NaN,this.xe=NaN;var k=r[0].callback;k&&Za(k,!0)}}this.le=this.le.filter(Boolean),n&&void 0===this.ve&&(this.ve=requestAnimationFrame(this.Re.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var e,r=this.getCenterInternal();return void 0!==r&&(or(e=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Qe(e,n)),e},n.prototype.calculateCenterZoom=function(t,n){var e,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(e=[n[0]-t*(n[0]-r[0])/i,n[1]-t*(n[1]-r[1])/i]);return e},n.prototype.Pe=function(t){var n=this.pe;if(t){var e=n[0],r=n[1];return[Math.abs(e*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(e*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.pe=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Ir(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(Ra.CENTER)},n.prototype.getConstraints=function(){return this.Ae},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.he[0],t[1]=this.he[1],t):this.he.slice()},n.prototype.calculateExtent=function(t){return Dr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.Ne(),e=this.getCenterInternal();Mt(e,1);var r=this.getResolution();Mt(void 0!==r,2);var i=this.getRotation();return Mt(void 0!==i,3),Hn(e,r,i,n)},n.prototype.getMaxResolution=function(){return this.Se},n.prototype.getMinResolution=function(){return this.Me},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.Me)},n.prototype.setMaxZoom=function(t){this._e(this.Ce({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.Se)},n.prototype.setMinZoom=function(t){this._e(this.Ce({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this._e(this.Ce({constrainResolution:t}))},n.prototype.getProjection=function(){return this.de},n.prototype.getResolution=function(){return this.get(Ra.RESOLUTION)},n.prototype.getResolutions=function(){return this.Oe},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(Nr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var e=n||this.Ne(),r=Qn(t)/e[0],i=Kn(t)/e[1];return Math.max(r,i)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,e=this.getConstrainedResolution(this.Se),r=this.Me,i=Math.log(e/r)/Math.log(n);return function(t){return e/Math.pow(n,t*i)}},n.prototype.getRotation=function(){return this.get(Ra.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),e=this.getConstrainedResolution(this.Se),r=this.Me,i=Math.log(e/r)/n;return function(t){return Math.log(e/t)/n/i}},n.prototype.Ne=function(t){var n=this.Pe(t),e=this.Te;return e&&(n=[n[0]-e[1]-e[3],n[1]-e[0]-e[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),e=this.getRotation(),r=this.getCenterInternal(),i=this.Te;if(i){var o=this.Ne();r=Ya(r,this.Pe(),[o[0]/2+i[3],o[1]/2+i[0]],n,e)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,nextCenter:this.we,nextResolution:this.ge,nextRotation:this.xe,rotation:e,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,e,r=this.Ee||0;if(this.Oe){var i=m(this.Oe,t,1);r=i,n=this.Oe[i],e=i==this.Oe.length-1?2:n/this.Oe[i+1]}else n=this.Se,e=this.je;return r+Math.log(n/t)/Math.log(e)},n.prototype.getResolutionForZoom=function(t){if(this.Oe){if(this.Oe.length<=1)return 0;var n=ue(Math.floor(t),0,this.Oe.length-2),e=this.Oe[n]/this.Oe[n+1];return this.Oe[n]/Math.pow(e,ue(t-n,0,1))}return this.Se/Math.pow(this.je,t-this.Ee)},n.prototype.fit=function(t,n){var e;if(Mt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Mt(!ne(t),25),e=Hi(r=Nr(t,this.getProjection()));else if(t.getType()===It.CIRCLE){var r;(e=Hi(r=Nr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Zn(r))}else{var i=Rr();e=i?t.clone().transform(i,this.getProjection()):t}this.fitInternal(e,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),e=Math.cos(n),r=Math.sin(-n),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,u=-1/0,c=-1/0,f=0,h=i.length;f0&&t[1]>0}function nu(t,n,e){return void 0===e&&(e=[0,0]),e[0]=t[0]*n+.5|0,e[1]=t[1]*n+.5|0,e}function eu(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var ru=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function iu(t){t instanceof ys?t.setMapInternal(null):t instanceof sa&&t.getLayers().forEach(iu)}function ou(t,n){if(t instanceof ys)t.setMapInternal(n);else if(t instanceof sa)for(var e=t.getLayers().getArray(),r=0,i=e.length;r=0;a--){var u=s[a];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.We,n=this.ur;if(!n.isEmpty()){var e=this.Fe,r=e;if(t){var i=t.viewHints;if(i[Aa]||i[Ca]){var o=Date.now()-t.time>8;e=o?0:8,r=o?0:2}}n.getTilesLoading()0;if(this.mn!=e&&(this.element.style.display=e?"":"none",this.mn=e),!x(n,this.Rr)){To(this.kr);for(var r=0,i=n.length;r0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.zr,easing:bt}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var e=n.viewState.rotation;if(e!=this.Fr){var r="rotate("+e+"rad)";if(this.Lr){var i=this.element.classList.contains(ks);i||0!==e?i&&0!==e&&this.element.classList.remove(ks):this.element.classList.add(ks)}this.Er.style.transform=r}this.Fr=e}},n}(uu),vu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),du=function(t){function n(n){var e=this,r=n||{};e=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",u=void 0!==r.zoomInLabel?r.zoomInLabel:"+",c=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",h=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=f,l.appendChild("string"==typeof u?document.createTextNode(u):u),l.addEventListener(F,e.Cr.bind(e,o),!1);var v=document.createElement("button");v.className=a,v.setAttribute("type","button"),v.title=h,v.appendChild("string"==typeof c?document.createTextNode(c):c),v.addEventListener(F,e.Cr.bind(e,-o),!1);var d=i+" "+"ol-unselectable "+js,p=e.element;return p.className=d,p.appendChild(l),p.appendChild(v),e.zr=void 0!==r.duration?r.duration:250,e}return vu(n,t),n.prototype.Cr=function(t,n){n.preventDefault(),this.Ur(t)},n.prototype.Ur=function(t){var n=this.getMap().getView();if(n){var e=n.getZoom();if(void 0!==e){var r=n.getConstrainedZoom(e+t);this.zr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.zr,easing:bt})):n.setZoom(r)}}},n}(uu);function pu(t){var n=t||{},e=new ht;return(void 0===n.zoom||n.zoom)&&e.push(new du(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&e.push(new lu(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&e.push(new fu(n.attributionOptions)),e}var yu="active",mu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function bu(t,n,e){var r=t.getCenterInternal();if(r){var i=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==e?e:250,easing:gt,center:t.getConstrainedCenter(i)})}}function wu(t,n,e,r){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:e,duration:void 0!==r?r:250,easing:bt})}}var gu=function(t){function n(n){var e=t.call(this)||this;return e.on,e.once,e.un,n&&n.handleEvent&&(e.handleEvent=n.handleEvent),e.vn=null,e.setActive(!0),e}return mu(n,t),n.prototype.getActive=function(){return this.get(yu)},n.prototype.getMap=function(){return this.vn},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(yu,t)},n.prototype.setMap=function(t){this.vn=t},n}(ot),xu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ku=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.Br=r.delta?r.delta:1,e.zr=void 0!==r.duration?r.duration:250,e}return xu(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==ha.DBLCLICK){var e=t.originalEvent,r=t.map,i=t.coordinate,o=e.shiftKey?-this.Br:this.Br;wu(r.getView(),o,i,this.zr),e.preventDefault(),n=!0}return!n},n}(gu),_u=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function Su(t){for(var n=t.length,e=0,r=0,i=0;i0}}else if(t.type==ha.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==ha.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.$r=function(t){if(function(t){var n=t.type;return n===ha.POINTERDOWN||n===ha.POINTERDRAG||n===ha.POINTERUP}(t)){var n=t.originalEvent,e=n.pointerId.toString();t.type==ha.POINTERUP?delete this.qr[e]:(t.type==ha.POINTERDOWN||e in this.qr)&&(this.qr[e]=n),this.targetPointers=C(this.qr)}},n}(gu);function ju(t){var n=arguments;return function(t){for(var e=!0,r=0,i=n.length;r0&&this.Hr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Vr&&this.Vr.begin(),this.Kr=this.targetPointers.length>1,!0}return!1},n}(Mu),Bu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),qu=function(t){function n(n){var e=this,r=n||{};return(e=t.call(this,{stopDown:M})||this).Hr=r.condition?r.condition:Tu,e.Xr=void 0,e.zr=void 0!==r.duration?r.duration:250,e}return Bu(n,t),n.prototype.handleDragEvent=function(t){if(Lu(t)){var n=t.map,e=n.getView();if(e.getConstraints().rotation!==Ua){var r=n.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.Xr){var s=o-this.Xr;e.adjustRotationInternal(-s)}this.Xr=o}}},n.prototype.handleUpEvent=function(t){return!Lu(t)||(t.map.getView().endInteraction(this.zr),!1)},n.prototype.handleDownEvent=function(t){return!!Lu(t)&&(!(!Ru(t)||!this.Hr(t))&&(t.map.getView().beginInteraction(),this.Xr=void 0,!0))},n}(Mu),$u=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Vu=function(t){function n(n){var e=t.call(this)||this;return e.Yr=null,e.pn=document.createElement("div"),e.pn.style.position="absolute",e.pn.style.pointerEvents="auto",e.pn.className="ol-box "+n,e.vn=null,e.Jr=null,e.Qr=null,e}return $u(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.ti=function(){var t=this.Jr,n=this.Qr,e="px",r=this.pn.style;r.left=Math.min(t[0],n[0])+e,r.top=Math.min(t[1],n[1])+e,r.width=Math.abs(n[0]-t[0])+e,r.height=Math.abs(n[1]-t[1])+e},n.prototype.setMap=function(t){if(this.vn){this.vn.getOverlayContainer().removeChild(this.pn);var n=this.pn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.vn=t,this.vn&&this.vn.getOverlayContainer().appendChild(this.pn)},n.prototype.setPixels=function(t,n){this.Jr=t,this.Qr=n,this.createOrUpdateGeometry(),this.ti()},n.prototype.createOrUpdateGeometry=function(){var t=this.Jr,n=this.Qr,e=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.vn.getCoordinateFromPixelInternal,this.vn);e[4]=e[0].slice(),this.Yr?this.Yr.setCoordinates([e]):this.Yr=new Zi([e])},n.prototype.getGeometry=function(){return this.Yr},n}(v),Zu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Wu="boxstart",Hu="boxdrag",Ku="boxend",Xu="boxcancel",Yu=function(t){function n(n,e,r){var i=t.call(this,n)||this;return i.coordinate=e,i.mapBrowserEvent=r,i}return Zu(n,t),n}(h),Ju=function(t){function n(n){var e=t.call(this)||this;e.on,e.once,e.un;var r=n||{};return e.ni=new Vu(r.className||"ol-dragbox"),e.ei=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(e.onBoxEnd=r.onBoxEnd),e.Jr=null,e.Hr=r.condition?r.condition:Ru,e.ri=r.boxEndCondition?r.boxEndCondition:e.defaultBoxEndCondition,e}return Zu(n,t),n.prototype.defaultBoxEndCondition=function(t,n,e){var r=e[0]-n[0],i=e[1]-n[1];return r*r+i*i>=this.ei},n.prototype.getGeometry=function(){return this.ni.getGeometry()},n.prototype.handleDragEvent=function(t){this.ni.setPixels(this.Jr,t.pixel),this.dispatchEvent(new Yu(Hu,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.ni.setMap(null);var n=this.ri(t,this.Jr,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new Yu(n?Ku:Xu,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Hr(t)&&(this.Jr=t.pixel,this.ni.setMap(t.map),this.ni.setPixels(this.Jr,this.Jr),this.dispatchEvent(new Yu(Wu,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(Mu),Qu=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tc=function(t){function n(n){var e=this,r=n||{},i=r.condition?r.condition:Nu;return(e=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).zr=void 0!==r.duration?r.duration:200,e.ii=void 0!==r.out&&r.out,e}return Qu(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),e=this.getGeometry();if(this.ii){var r=n.rotatedExtentForGeometry(e),i=n.getResolutionForExtentInternal(r),o=n.getResolution()/i;(e=e.clone()).scale(o*o)}n.fitInternal(e,{duration:this.zr,easing:bt})},n}(Ju),nc=37,ec=38,rc=39,ic=40,oc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),sc=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.oi=function(t){return Du(t)&&zu(t)},e.Hr=void 0!==r.condition?r.condition:e.oi,e.zr=void 0!==r.duration?r.duration:100,e.si=void 0!==r.pixelDelta?r.pixelDelta:128,e}return oc(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==$){var e=t.originalEvent,r=e.keyCode;if(this.Hr(t)&&(r==ic||r==nc||r==rc||r==ec)){var i=t.map.getView(),o=i.getResolution()*this.si,s=0,a=0;r==ic?a=-o:r==nc?s=-o:r==rc?s=o:a=o;var u=[s,a];or(u,i.getRotation()),bu(i,u,this.zr),e.preventDefault(),n=!0}}return!n},n}(gu),ac=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),uc=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.Hr=r.condition?r.condition:zu,e.Br=r.delta?r.delta:1,e.zr=void 0!==r.duration?r.duration:100,e}return ac(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==$||t.type==V){var e=t.originalEvent,r=e.charCode;if(this.Hr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,o=r=="+".charCodeAt(0)?this.Br:-this.Br;wu(i.getView(),o,void 0,this.zr),e.preventDefault(),n=!0}}return!n},n}(gu),cc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),fc="trackpad",hc="wheel",lc=function(t){function n(n){var e=this,r=n||{};(e=t.call(this,r)||this).ai=0,e.ui=0,e.bt=void 0!==r.maxDelta?r.maxDelta:1,e.zr=void 0!==r.duration?r.duration:250,e.ci=void 0!==r.timeout?r.timeout:80,e.fi=void 0===r.useAnchor||r.useAnchor,e.hi=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:Cu;return e.Hr=r.onFocusOnly?ju(Au,i):i,e.li=null,e.vi=void 0,e.di,e.yi=void 0,e.mi=400,e.bi,e.wi=300,e}return cc(n,t),n.prototype.gi=function(){this.bi=void 0,this.getMap().getView().endInteraction(void 0,this.ui?this.ui>0?1:-1:0,this.li)},n.prototype.handleEvent=function(t){if(!this.Hr(t))return!0;if(t.type!==K)return!0;var n,e=t.map,r=t.originalEvent;if(r.preventDefault(),this.fi&&(this.li=t.coordinate),t.type==K&&(n=r.deltaY,Ut&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Vt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.ui=n;var i=Date.now();void 0===this.vi&&(this.vi=i),(!this.yi||i-this.vi>this.mi)&&(this.yi=Math.abs(n)<4?fc:hc);var o=e.getView();if(this.yi===fc&&!o.getConstrainResolution()&&!this.hi)return this.bi?clearTimeout(this.bi):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.bi=setTimeout(this.gi.bind(this),this.ci),o.adjustZoom(-n/this.wi,this.li),this.vi=i,!1;this.ai+=n;var s=Math.max(this.ci-(i-this.vi),0);return clearTimeout(this.di),this.di=setTimeout(this.xi.bind(this,e),s),!1},n.prototype.xi=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var e=-ue(this.ai,-this.bt*this.wi,this.bt*this.wi)/this.wi;(n.getConstrainResolution()||this.hi)&&(e=e?e>0?1:-1:0),wu(n,e,this.li,this.zr),this.yi=void 0,this.ai=0,this.li=null,this.vi=void 0,this.di=void 0},n.prototype.setMouseAnchor=function(t){this.fi=t,t||(this.li=null)},n}(gu),vc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),dc=function(t){function n(n){var e=this,r=n||{},i=r;return i.stopDown||(i.stopDown=M),(e=t.call(this,i)||this).ki=null,e.Xr=void 0,e._i=!1,e.Si=0,e.Mi=void 0!==r.threshold?r.threshold:.3,e.zr=void 0!==r.duration?r.duration:250,e}return vc(n,t),n.prototype.handleDragEvent=function(t){var n=0,e=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-e.clientY,r.clientX-e.clientX);if(void 0!==this.Xr){var o=i-this.Xr;this.Si+=o,!this._i&&Math.abs(this.Si)>this.Mi&&(this._i=!0),n=o}this.Xr=i;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Ua){var u=s.getViewport().getBoundingClientRect(),c=Su(this.targetPointers);c[0]-=u.left,c[1]-=u.top,this.ki=s.getCoordinateFromPixelInternal(c),this._i&&(s.render(),a.adjustRotationInternal(n,this.ki))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.zr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.ki=null,this.Xr=void 0,this._i=!1,this.Si=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Mu),pc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),yc=function(t){function n(n){var e=this,r=n||{},i=r;return i.stopDown||(i.stopDown=M),(e=t.call(this,i)||this).ki=null,e.zr=void 0!==r.duration?r.duration:400,e.ji=void 0,e.Oi=1,e}return pc(n,t),n.prototype.handleDragEvent=function(t){var n=1,e=this.targetPointers[0],r=this.targetPointers[1],i=e.clientX-r.clientX,o=e.clientY-r.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.ji&&(n=this.ji/s),this.ji=s;var a=t.map,u=a.getView();1!=n&&(this.Oi=n);var c=a.getViewport().getBoundingClientRect(),f=Su(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.ki=a.getCoordinateFromPixelInternal(f),a.render(),u.adjustResolutionInternal(n,this.ki)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),e=this.Oi>1?1:-1;return n.endInteraction(this.zr,e),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.ki=null,this.ji=void 0,this.Oi=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Mu);function mc(t){var n=t||{},e=new ht,r=new Ro(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&e.push(new qu),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&e.push(new ku({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&e.push(new Uu({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&e.push(new dc),(void 0===n.pinchZoom||n.pinchZoom)&&e.push(new yc({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(e.push(new sc),e.push(new uc({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&e.push(new lc({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&e.push(new tc({duration:n.zoomDuration})),e}var bc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),wc=function(t){function n(n){return(n=E({},n)).controls||(n.controls=pu()),n.interactions||(n.interactions=mc({onFocusOnly:!0})),t.call(this,n)||this}return bc(n,t),n.prototype.createRenderer=function(){return new ea(this)},n}(su),gc="bottom-left",xc="bottom-center",kc="bottom-right",_c="center-left",Sc="center-center",Mc="center-right",jc="top-left",Oc="top-center",Tc="top-right";function Ec(t){return(Ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ac=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Cc="element",Rc="map",Ic="offset",Pc="position",Dc="positioning",Nc=function(t){function n(n){var e=t.call(this)||this;e.on,e.once,e.un,e.options=n,e.id=n.id,e.insertFirst=void 0===n.insertFirst||n.insertFirst,e.stopEvent=void 0===n.stopEvent||n.stopEvent,e.element=document.createElement("div"),e.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",e.element.style.position="absolute",e.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!==Ec(r)&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),e.autoPan=r||!1,e.rendered={jt:"",visible:!0},e.mapPostrenderListenerKey=null,e.addChangeListener(Cc,e.handleElementChanged),e.addChangeListener(Rc,e.handleMapChanged),e.addChangeListener(Ic,e.handleOffsetChanged),e.addChangeListener(Pc,e.handlePositionChanged),e.addChangeListener(Dc,e.handlePositioningChanged),void 0!==n.element&&e.setElement(n.element),e.setOffset(void 0!==n.offset?n.offset:[0,0]),e.setPositioning(void 0!==n.positioning?n.positioning:jc),void 0!==n.position&&e.setPosition(n.position),e}return Ac(n,t),n.prototype.getElement=function(){return this.get(Cc)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(Rc)},n.prototype.getOffset=function(){return this.get(Ic)},n.prototype.getPosition=function(){return this.get(Pc)},n.prototype.getPositioning=function(){return this.get(Dc)},n.prototype.handleElementChanged=function(){To(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Oo(this.element),J(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=X(t,ba,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(Cc,t)},n.prototype.setMap=function(t){this.set(Rc,t)},n.prototype.setOffset=function(t){this.set(Ic,t)},n.prototype.setPosition=function(t){this.set(Pc,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(Pc)){var e=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),i=this.getRect(r,[So(r),Mo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!jn(e,i)){var a=i[0]-e[0],u=e[2]-i[2],c=i[1]-e[1],f=e[3]-i[3],h=[0,0];if(a<0?h[0]=a-s:u<0&&(h[0]=Math.abs(u)+s),c<0?h[1]=c-s:f<0&&(h[1]=Math.abs(f)+s),0!==h[0]||0!==h[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+h[0],v[1]+h[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var e=t.getBoundingClientRect(),r=e.left+window.pageXOffset,i=e.top+window.pageYOffset;return[r,i,r+n[0],i+n[1]]},n.prototype.setPositioning=function(t){this.set(Dc,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var e=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(e,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var e=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",a="0%",u="0%";i==kc||i==Mc||i==Tc?a="-100%":i!=xc&&i!=Sc&&i!=Oc||(a="-50%"),i==gc||i==xc||i==kc?u="-100%":i!=_c&&i!=Sc&&i!=Mc||(u="-50%");var c="translate("+a+", "+u+") translate("+o+", "+s+")";this.rendered.jt!=c&&(this.rendered.jt=c,e.transform=c,e.msTransform=c)},n.prototype.getOptions=function(){return this.options},n}(ot),zc=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.Ti=0,this.Ei={},this.Ai=null,this.Ci=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.Ti=0,this.Ei={},this.Ai=null,this.Ci=null},t.prototype.containsKey=function(t){return this.Ei.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.Ai;n;)t(n.Ri,n.Ii,this),n=n.newer},t.prototype.get=function(t,n){var e=this.Ei[t];return Mt(void 0!==e,15),e===this.Ci||(e===this.Ai?(this.Ai=this.Ai.newer,this.Ai.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.Ci,this.Ci.newer=e,this.Ci=e),e.Ri},t.prototype.remove=function(t){var n=this.Ei[t];return Mt(void 0!==n,15),n===this.Ci?(this.Ci=n.older,this.Ci&&(this.Ci.newer=null)):n===this.Ai?(this.Ai=n.newer,this.Ai&&(this.Ai.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.Ei[t],--this.Ti,n.Ri},t.prototype.getCount=function(){return this.Ti},t.prototype.getKeys=function(){var t,n=new Array(this.Ti),e=0;for(t=this.Ci;t;t=t.older)n[e++]=t.Ii;return n},t.prototype.getValues=function(){var t,n=new Array(this.Ti),e=0;for(t=this.Ci;t;t=t.older)n[e++]=t.Ri;return n},t.prototype.peekLast=function(){return this.Ai.Ri},t.prototype.peekLastKey=function(){return this.Ai.Ii},t.prototype.peekFirstKey=function(){return this.Ci.Ii},t.prototype.pop=function(){var t=this.Ai;return delete this.Ei[t.Ii],t.newer&&(t.newer.older=null),this.Ai=t.newer,this.Ai||(this.Ci=null),--this.Ti,t.Ri},t.prototype.replace=function(t,n){this.get(t),this.Ei[t].Ri=n},t.prototype.set=function(t,n){Mt(!(t in this.Ei),16);var e={Ii:t,newer:null,older:this.Ci,Ri:n};this.Ci?this.Ci.newer=e:this.Ai=e,this.Ci=e,this.Ei[t]=e,++this.Ti},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Lc(t,n,e,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=e,r):[t,n,e]}function Fc(t,n,e){return t+"/"+n+"/"+e}function Gc(t){return Fc(t[0],t[1],t[2])}function Uc(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return Fc(n[0],n[1],n[2])}function Bc(t){return t.split("/").map(Number)}function qc(t){return(t[1]<e||e>n.getMaxZoom())return!1;var o=n.getFullTileRange(e);return!o||o.containsXY(r,i)}var Vc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Zc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Vc(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Bc(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(Gc(n.tileCoord)),n.release())}.bind(this))}},n}(zc),Wc=function(){function t(t,n,e,r){this.minX=t,this.maxX=n,this.minY=e,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Hc(t,n,e,r,i){return void 0!==i?(i.minX=t,i.maxX=n,i.minY=e,i.maxY=r,i):new Wc(t,n,e,r)}var Kc=Wc,Xc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Yc=[],Jc=function(t){function n(n,e,r,i){var o=t.call(this,n,e,{transition:0})||this;return o.Pi={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.Di={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=r,o}return Xc(n,t),n.prototype.getContext=function(t){var n=o(t);return n in this.Pi||(this.Pi[n]=_o(1,1,Yc)),this.Pi[n]},n.prototype.hasContext=function(t){return o(t)in this.Pi},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=o(t);return n in this.Di||(this.Di[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.Di[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.Pi)Yc.push(this.Pi[n].canvas),delete this.Pi[n];t.prototype.release.call(this)},n}(kt),Qc=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tf=function(t){function n(n,e,r,i,o,s){var a=t.call(this,n,e,s)||this;return a.extent=null,a.Ni=i,a.zi=null,a.B,a.projection=null,a.resolution,a.$t=o,a.Li=r,a.key=r,a}return Qc(n,t),n.prototype.getFormat=function(){return this.Ni},n.prototype.getFeatures=function(){return this.zi},n.prototype.load=function(){this.state==lt&&(this.setState(vt),this.$t(this,this.Li),this.B&&this.B(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(pt)},n.prototype.setFeatures=function(t){this.zi=t,this.setState(dt)},n.prototype.setLoader=function(t){this.B=t},n}(kt);function nf(t){return Array.isArray(t)?Go(t):t}var ef="arraybuffer",rf="json",of="text",sf="xml",af=!1;function uf(t,n,e,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(e,r,i):t,!0),n.getType()==ef&&(a.responseType="arraybuffer"),a.withCredentials=af,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=n.getType(),u=void 0;r==rf||r==of?u=a.responseText:r==sf?(u=a.responseXML)||(u=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==ef&&(u=a.response),u?o(n.readFeatures(u,{extent:e,featureProjection:i}),n.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function cf(t,n){return function(e,r,i,o,s){var a=this;uf(t,n,e,r,i,(function(t,n){a.addFeatures(t),void 0!==o&&o(t)}),s||j)}}function ff(t,n){return[[-1/0,-1/0,1/0,1/0]]}var hf=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function lf(t,n,e,r){var i=document.createElement("script"),s="olc_"+o(n);function a(){delete window[s],i.parentNode.removeChild(i)}i.async=!0,i.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var u=setTimeout((function(){a(),e&&e()}),1e4);window[s]=function(t){clearTimeout(u),a(),n(t)},document.getElementsByTagName("head")[0].appendChild(i)}var vf,df=function(t){function n(n){var e=this,r="Unexpected response status: "+n.status;return(e=t.call(this,r)||this).name="ResponseError",e.response=n,e}return hf(n,t),n}(Error),pf=function(t){function n(n){var e=t.call(this,"Failed to issue request")||this;return e.name="ClientError",e.client=n,e}return hf(n,t),n}(Error);function yf(t){return new Promise((function(n,e){var r=new XMLHttpRequest;r.addEventListener("load",(function(t){var r=t.target;if(!r.status||r.status>=200&&r.status<300){var i=void 0;try{i=JSON.parse(r.responseText)}catch(t){var o="Error parsing response text as JSON: "+t.message;return void e(new Error(o))}n(i)}else e(new df(r))})),r.addEventListener("error",(function(t){e(new pf(t.target))})),r.open("GET",t),r.setRequestHeader("Accept","application/json"),r.send()}))}function mf(t,n){return n.indexOf("://")>=0?n:new URL(n,t).href}var bf=function(){function t(){}return t.prototype.drawCustom=function(t,n,e,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),wf=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),gf=function(t){function n(n,e,r,i,o,s,a){var u=t.call(this)||this;return u.Pi=n,u.Rt=e,u.st=r,u.jt=i,u.Fi=o,u.Gi=s,u.Ui=a,u.Bi=null,u.qi=null,u.$i=null,u.Vi=null,u.Zi=null,u.Dt=null,u.Wi=0,u.Hi=0,u.Ki=0,u.Xi=0,u.Yi=0,u.Ji=0,u.Qi=!1,u.no=0,u.eo=[0,0],u.ro=0,u.io="",u.oo=0,u.so=0,u.ao=!1,u.uo=0,u.co=[0,0],u.fo=null,u.ho=null,u.lo=null,u.vo=[],u.do=[1,0,0,1,0,0],u}return wf(n,t),n.prototype.po=function(t,n,e,r){if(this.Dt){var i=Ur(t,n,e,r,this.jt,this.vo),o=this.Pi,s=this.do,a=o.globalAlpha;1!=this.Xi&&(o.globalAlpha=a*this.Xi);var u=this.no;this.Qi&&(u+=this.Fi);for(var c=0,f=i.length;c2||Math.abs(t[4*n+3]-191.25)>2}function Ff(t,n,e,r){var i=Tr(e,n,t),o=br(n,r,e),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var u=t.getExtent();if(!u||Mn(u,i)){var c=br(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function Gf(t,n,e,r){var i=Zn(e),o=Ff(t,n,i,r);return(!isFinite(o)||o<=0)&&Bn(e,(function(e){return o=Ff(t,n,e,r),isFinite(o)&&o>0})),o}function Uf(t,n,e,r,i,o,s,a,u,c,f,h){var l=_o(Math.round(e*t),Math.round(e*n));if(h||E(l,Df),0===u.length)return l.canvas;function v(t){return Math.round(t*e)/e}l.scale(e,e),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,n,e){Nn(d,t.extent)}));var p=Qn(d),y=Kn(d),m=_o(Math.round(e*p/r),Math.round(e*y/r));h||E(m,Df);var b=e/r;u.forEach((function(t,n,e){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=Qn(t.extent),s=Kn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,c,c,t.image.width-2*c,t.image.height-2*c,r*b,i*b,o*b,s*b)}));var w=Yn(s);return a.getTriangles().forEach((function(t,n,i){var s=t.source,a=t.target,u=s[0][0],c=s[0][1],f=s[1][0],p=s[1][1],y=s[2][0],b=s[2][1],g=v((a[0][0]-w[0])/o),x=v(-(a[0][1]-w[1])/o),k=v((a[1][0]-w[0])/o),_=v(-(a[1][1]-w[1])/o),S=v((a[2][0]-w[0])/o),M=v(-(a[2][1]-w[1])/o),j=u,O=c;u=0,c=0;var T=ve([[f-=j,p-=O,0,0,k-g],[y-=j,b-=O,0,0,S-g],[0,0,f,p,_-x],[0,0,y,b,M-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===Pf){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",zf(t,4,5,4,0),zf(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;Pf=Lf(n,0)||Lf(n,4)||Lf(n,8)}return Pf}()||!h){l.moveTo(k,_);for(var E=g-k,A=x-_,C=0;C<4;C++)l.lineTo(k+v((C+1)*E/4),_+v(C*A/3)),3!=C&&l.lineTo(k+v((C+1)*E/4),_+v((C+1)*A/3));l.lineTo(S,M)}else l.moveTo(k,_),l.lineTo(g,x),l.lineTo(S,M);l.clip(),l.transform(T[0],T[2],T[1],T[3],g,x),l.translate(d[0]-j,d[3]-O),l.scale(r/e,-r/e),l.drawImage(m.canvas,0,0),l.restore()}})),f&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t,n,e){var r=t.target,i=(r[0][0]-w[0])/o,s=-(r[0][1]-w[1])/o,a=(r[1][0]-w[0])/o,u=-(r[1][1]-w[1])/o,c=(r[2][0]-w[0])/o,f=-(r[2][1]-w[1])/o;l.beginPath(),l.moveTo(a,u),l.lineTo(i,s),l.lineTo(c,f),l.closePath(),l.stroke()})),l.restore()),l.canvas}var Bf=[0,0,0],qf=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.Oe=t.resolutions,Mt(_(this.Oe,(function(t,n){return n-t}),!0),17),!t.origins)for(var e=0,r=this.Oe.length-1;e=this.minZoom;){if(n(a,2===this.je?Hc(i=Math.floor(i/2),i,o=Math.floor(o/2),o,e):this.getTileRangeForExtentAndZ(s,a,e)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.st},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this._o?this._o:this.So[t]},t.prototype.getResolution=function(t){return this.Oe[t]},t.prototype.getResolutions=function(){return this.Oe},t.prototype.getTileCoordChildTileRange=function(t,n,e){if(t[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=i+1,f=new Array(c),h=0;h0))){var e=fh(n.canvas).getExtension("WEBGL_lose_context");e&&e.loseContext(),delete Qh[t]}}(this.Wo),delete this.Io,delete this.Ut},n.prototype.prepareDraw=function(t,n){var e=this.getGL(),r=this.getCanvas(),i=t.size,o=t.pixelRatio;r.width=i[0]*o,r.height=i[1]*o,r.style.width=i[0]+"px",r.style.height=i[1]+"px",e.useProgram(this.Xo);for(var s=this.es.length-1;s>=0;s--)this.es[s].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,n?e.ZERO:e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.Xo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,e){var r=this.getGL(),i=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,i[0],i[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Xo),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var e=this.getGL();this.getExtension("OES_element_index_uint");var r=e.UNSIGNED_INT,i=n-t,o=4*t;e.drawElements(e.TRIANGLES,i,r,o)},n.prototype.finalizeDraw=function(t,n,e){for(var r=0,i=this.es.length;rthis.fs[0]||n>=this.fs[1])return sl[0]=0,sl[1]=0,sl[2]=0,sl[3]=0,sl;this.readAll();var e=Math.floor(t)+(this.fs[1]-Math.floor(n)-1)*this.fs[0];return sl[0]=this.q[4*e],sl[1]=this.q[4*e+1],sl[2]=this.q[4*e+2],sl[3]=this.q[4*e+3],sl},t.prototype.getTexture=function(){return this.ss},t.prototype.getFramebuffer=function(){return this.cs},t.prototype.ls=function(){var t=this.fs,n=this.us.getGL();this.ss=this.us.createTexture(t,null,this.ss),n.bindFramebuffer(n.FRAMEBUFFER,this.cs),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.ss,0),this.q=new Uint8Array(t[0]*t[1]*4)},t}(),ul=!0,cl=function(){function t(t,n,e,r,i,o){this.vs=t,this.ds=n;var s={},a=Or(this.ds,this.vs);this.ps=function(t){var n=t[0]+"/"+t[1];return s[n]||(s[n]=a(t)),s[n]},this.ys=r,this.bs=i*i,this.ws=[],this.gs=!1,this.xs=this.vs.canWrapX()&&!!r&&!!this.vs.getExtent()&&Qn(r)==Qn(this.vs.getExtent()),this.ks=this.vs.getExtent()?Qn(this.vs.getExtent()):null,this._s=this.ds.getExtent()?Qn(this.ds.getExtent()):null;var u=Yn(e),c=Jn(e),f=Vn(e),h=$n(e),l=this.ps(u),v=this.ps(c),d=this.ps(f),p=this.ps(h),y=10+(o?Math.max(0,Math.ceil(fe(qn(e)/(o*o*256*256)))):0);if(this.Ss(u,c,f,h,l,v,d,p,y),this.gs){var m=1/0;this.ws.forEach((function(t,n,e){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.ws.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.ks/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-m>this.ks/2&&(n[0][0]-=this.ks),n[1][0]-m>this.ks/2&&(n[1][0]-=this.ks),n[2][0]-m>this.ks/2&&(n[2][0]-=this.ks);var e=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-e.5&&f<1,v=!1;if(u>0){if(this.ds.isGlobal()&&this._s)v=Qn(xn([t,n,e,r]))/this._s>.25||v;!l&&this.vs.isGlobal()&&f&&(v=f>.25||v)}if(!(!v&&this.ys&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3]))||te(c,this.ys)){var d=0;if(!(v||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(u>0)v=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(u>0){if(!v){var p=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.ps(p),m=void 0;if(l)m=(ye(i[0],h)+ye(s[0],h))/2-ye(y[0],h);else m=(i[0]+s[0])/2-y[0];var b=(i[1]+s[1])/2-y[1];v=m*m+b*b>this.bs}if(v){if(Math.abs(t[0]-e[0])<=Math.abs(t[1]-e[1])){var w=[(n[0]+e[0])/2,(n[1]+e[1])/2],g=this.ps(w),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],k=this.ps(x);this.Ss(t,n,w,x,i,o,g,k,u-1),this.Ss(x,w,e,r,k,g,s,a,u-1)}else{var _=[(t[0]+n[0])/2,(t[1]+n[1])/2],S=this.ps(_),M=[(e[0]+r[0])/2,(e[1]+r[1])/2],j=this.ps(M);this.Ss(t,_,M,r,i,S,j,a,u-1),this.Ss(_,n,e,M,S,o,s,j,u-1)}return}}if(l){if(!this.xs)return;this.gs=!0}0==(11&d)&&this.Ms(t,e,r,i,s,a),0==(14&d)&&this.Ms(t,e,n,i,s,o),d&&(0==(13&d)&&this.Ms(n,r,t,o,a,i),0==(7&d)&&this.Ms(n,r,e,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.ws.forEach((function(n,e,r){var i=n.source;zn(t,i[0]),zn(t,i[1]),zn(t,i[2])})),t},t.prototype.getTriangles=function(){return this.ws},t}(),fl=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),hl=function(t){function n(n,e,r,i,o,s,a,u,c,f,h,l){var v=t.call(this,o,lt,{interpolate:!!l})||this;v.Os=void 0!==h&&h,v.Rt=a,v.Ts=u,v.Ut=null,v.Es=e,v.As=i,v.Cs=s||o,v.Rs=[],v.Is=null,v.Ps=0;var d=i.getTileCoordExtent(v.Cs),p=v.As.getExtent(),y=v.Es.getExtent(),m=p?Xn(d,p):d;if(0===qn(m))return v.state=yt,v;var b=n.getExtent();b&&(y=y?Xn(y,b):b);var w=i.getResolution(v.Cs[0]),g=Gf(n,r,m,w);if(!isFinite(g)||g<=0)return v.state=yt,v;var x=void 0!==f?f:.5;if(v.Ds=new cl(n,r,m,y,g*x,w),0===v.Ds.getTriangles().length)return v.state=yt,v;v.Ps=e.getZForResolution(g);var k=v.Ds.calculateSourceExtent();if(y&&(n.canWrapX()?(k[1]=ue(k[1],y[1],y[3]),k[3]=ue(k[3],y[1],y[3])):k=Xn(k,y)),qn(k)){for(var _=e.getTileRangeForExtentAndZ(k,v.Ps),S=_.minX;S<=_.maxX;S++)for(var M=_.minY;M<=_.maxY;M++){var j=c(v.Ps,S,M,a);j&&v.Rs.push(j)}0===v.Rs.length&&(v.state=yt)}else v.state=yt;return v}return fl(n,t),n.prototype.getImage=function(){return this.Ut},n.prototype.Ns=function(){var t=[];if(this.Rs.forEach(function(n,e,r){n&&n.getState()==dt&&t.push({extent:this.Es.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.Rs.length=0,0===t.length)this.state=pt;else{var n=this.Cs[0],e=this.As.getTileSize(n),r="number"==typeof e?e:e[0],i="number"==typeof e?e:e[1],o=this.As.getResolution(n),s=this.Es.getResolution(this.Ps),a=this.As.getTileCoordExtent(this.Cs);this.Ut=Uf(r,i,this.Rt,s,this.Es.getExtent(),o,a,this.Ds,t,this.Ts,this.Os,this.interpolate),this.state=dt}this.changed()},n.prototype.load=function(){if(this.state==lt){this.state=vt,this.changed();var t=0;this.Is=[],this.Rs.forEach(function(n,e,r){var i=n.getState();if(i==lt||i==vt){t++;var o=X(n,D,(function(e){var r=n.getState();r!=dt&&r!=pt&&r!=yt||(J(o),0===--t&&(this.zs(),this.Ns()))}),this);this.Is.push(o)}}.bind(this)),0===t?setTimeout(this.Ns.bind(this),0):this.Rs.forEach((function(t,n,e){t.getState()==lt&&t.load()}))}},n.prototype.zs=function(){this.Is.forEach(J),this.Is=null},n}(kt),ll=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function vl(t,n,e){var r=e?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}function dl(t,n,e,r,i,o){var s=t.getGL();vl(s,n,o);var a,u,c=e.byteLength/r[1],f=1;switch(c%8==0?f=8:c%4==0?f=4:c%2==0&&(f=2),i){case 1:a=s.LUMINANCE;break;case 2:a=s.LUMINANCE_ALPHA;break;case 3:a=s.RGB;break;case 4:a=s.RGBA;break;default:throw new Error("Unsupported number of bands: "+i)}e instanceof Float32Array?(u=s.FLOAT,t.getExtension("OES_texture_float"),t.getExtension("OES_texture_float_linear")):u=s.UNSIGNED_BYTE;var h=s.getParameter(s.UNPACK_ALIGNMENT);s.pixelStorei(s.UNPACK_ALIGNMENT,f),s.texImage2D(s.TEXTURE_2D,0,a,r[0],r[1],0,a,u,e),s.pixelStorei(s.UNPACK_ALIGNMENT,h)}var pl=function(t){function n(n,e,r){var i=t.call(this)||this;i.tile,i.textures=[],i.cr=i.cr.bind(i),i.size=eu(e.getTileSize(n.tileCoord[0])),i.bandCount=NaN,i.us=r;var o=new Fh(ih,sh);return o.fromArray([0,1,1,1,1,0,0,0]),r.flushBufferData(o),i.coords=o,i.setTile(n),i}return ll(n,t),n.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(D,this.cr),this.tile=t,this.textures.length=0,this.loaded=t.getState()===dt,this.loaded)this.Ls();else{if(t instanceof Co){var n=t.getImage();n instanceof Image&&!n.crossOrigin&&(n.crossOrigin="anonymous")}t.addEventListener(D,this.cr)}},n.prototype.Ls=function(){var t=this.us,n=t.getGL(),e=this.tile;if(e instanceof Co||e instanceof hl){var r=n.createTexture();return this.textures.push(r),this.bandCount=4,void function(t,n,e,r){vl(t,n,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e)}(n,r,e.getImage(),e.interpolate)}var i=e.getData(),o=i instanceof Float32Array,s=this.size[0]*this.size[1],a=o?Float32Array:Uint8Array,u=a.BYTES_PER_ELEMENT,c=i.byteLength/this.size[1];this.bandCount=Math.floor(c/u/this.size[0]);var f=Math.ceil(this.bandCount/4);if(1===f){r=n.createTexture();return this.textures.push(r),void dl(t,r,i,this.size,this.bandCount,e.interpolate)}for(var h=new Array(f),l=0;l=g;--x){if(this.oa(i,w,x,u))break}}this.helper.useProgram(this.Js),this.helper.prepareDraw(t,!d);for(var k=Object.keys(u).map(Number).sort(p),_=e.center[0],S=e.center[1],M=0,j=k.length;M4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(Wl).join(", ")+")"}function Kl(t){var n=Lo(t).slice();return n.length<4&&n.push(1),Hl(n.map((function(t,n){return n<3?t/255:t})))}function Xl(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function Yl(t,n){return Wl(Xl(t,n))}function Jl(t,n,e){if(Array.isArray(n)&&"string"==typeof n[0]){var r=$l[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(n));return r.toGlsl(t,n.slice(1),e)}var i=Vl(n);if((i&zl)>0)return Wl(n);if((i&Gl)>0)return n.toString();if((i&Ll)>0&&(void 0===e||e==Ll))return Yl(t,n.toString());if((i&Fl)>0&&(void 0===e||e==Fl))return Kl(n);if((i&Ul)>0)return Hl(n);throw new Error("Unexpected expression "+n+" (expected type "+e+")")}function Ql(t){if(!(Vl(t)&zl))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function tv(t){for(var n=0;nn)throw new Error("At most "+n+" arguments were expected, got "+t.length+" instead")}function sv(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function av(t,n){if(!Zl(n))throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t))}function uv(t){return"u_var_"+t}$l.get={getReturnType:function(t){return Bl},toGlsl:function(t,n){rv(n,1),nv(n[0]);var e=n[0].toString();return-1===t.attributes.indexOf(e)&&t.attributes.push(e),(t.inFragmentShader?"v_":"a_")+e}},$l.var={getReturnType:function(t){return Bl},toGlsl:function(t,n){rv(n,1),nv(n[0]);var e=n[0].toString();return-1===t.variables.indexOf(e)&&t.variables.push(e),uv(e)}};var cv="u_paletteTextures";$l.palette={getReturnType:function(t){return Fl},toGlsl:function(t,n){rv(n,2),Ql(n[0]);var e=Jl(t,n[0]),r=n[1];if(!Array.isArray(r))throw new Error("The second argument of palette must be an array");for(var i=r.length,o=new Uint8Array(4*i),s=0;s"]={getReturnType:function(t){return Gl},toGlsl:function(t,n){return rv(n,2),tv(n),"("+Jl(t,n[0])+" > "+Jl(t,n[1])+")"}},$l[">="]={getReturnType:function(t){return Gl},toGlsl:function(t,n){return rv(n,2),tv(n),"("+Jl(t,n[0])+" >= "+Jl(t,n[1])+")"}},$l["<"]={getReturnType:function(t){return Gl},toGlsl:function(t,n){return rv(n,2),tv(n),"("+Jl(t,n[0])+" < "+Jl(t,n[1])+")"}},$l["<="]={getReturnType:function(t){return Gl},toGlsl:function(t,n){return rv(n,2),tv(n),"("+Jl(t,n[0])+" <= "+Jl(t,n[1])+")"}},$l["=="]=hv("=="),$l["!="]=hv("!="),$l["!"]={getReturnType:function(t){return Gl},toGlsl:function(t,n){return rv(n,1),ev(n[0]),"(!"+Jl(t,n[0])+")"}},$l.all=lv("&&"),$l.any=lv("||"),$l.between={getReturnType:function(t){return Gl},toGlsl:function(t,n){rv(n,3),tv(n);var e=Jl(t,n[1]),r=Jl(t,n[2]),i=Jl(t,n[0]);return"("+i+" >= "+e+" && "+i+" <= "+r+")"}},$l.array={getReturnType:function(t){return Ul},toGlsl:function(t,n){iv(n,2),ov(n,4),tv(n);var e=n.map((function(n){return Jl(t,n,zl)}));return"vec"+n.length+"("+e.join(", ")+")"}},$l.color={getReturnType:function(t){return Fl},toGlsl:function(t,n){iv(n,3),ov(n,4),tv(n);var e=n;3===n.length&&e.push(1);var r=n.map((function(n,e){return Jl(t,n,zl)+(e<3?" / 255.0":"")}));return"vec"+n.length+"("+r.join(", ")+")"}},$l.interpolate={getReturnType:function(t){for(var n=Fl|zl,e=3;e=1;u-=2){a="("+o+" == "+Jl(t,n[u])+" ? "+Jl(t,n[u+1],i)+" : "+(a||s)+")"}return a}},$l.case={getReturnType:function(t){for(var n=Bl,e=1;e=0;o-=2){a="("+Jl(t,n[o])+" ? "+Jl(t,n[o+1],i)+" : "+(a||s)+")"}return a}};var vv=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,e){return this.varyings.push({name:t,type:n,expression:e}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",e=this.attributes,r=this.varyings;return t&&(e=e.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+e.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+n+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",e=this.varyings;return t&&(e=e.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+e.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+n+"\n}"},t}();function dv(t){var n=t.symbol,e=void 0!==n.size?n.size:1,r=n.color||"white",i=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,u={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},c=Jl(u,e,Ul|zl),f=Jl(u,o,Ul),h=Jl(u,i,Ul),l=Jl(u,a,zl),v={inFragmentShader:!0,variables:u.variables,attributes:[],stringLiteralsMap:u.stringLiteralsMap,functions:{}},d=Jl(v,r,Fl),p=Jl(v,s,zl),y="1.0",m="vec2("+Jl(v,e,Ul|zl)+").x";switch(n.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./"+m+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var b="(v_quadCoord*2.-1.)",w="(atan("+b+".x,"+b+".y))";y="(1.0-smoothstep(.5-3./"+m+",.5,cos(floor(.5+"+w+"/2.094395102)*2.094395102-"+w+")*length("+b+")))";break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var g=(new vv).setSizeExpression("vec2("+c+")").setRotationExpression(l).setSymbolOffsetExpression(f).setTextureCoordinateExpression(h).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+p+" * "+y+")");if(t.filter){var x=Jl(v,t.filter,Gl);g.setFragmentDiscardExpression("!"+x)}var k={};if(v.variables.forEach((function(n){var e=uv(n);g.addUniform("float "+e),k[e]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: "+n);var e=t.variables[n];return"string"==typeof e&&(e=Xl(u,e)),void 0!==e?e:-9999999}})),"image"===n.symbolType&&n.src){var _=new Image;_.src=n.src,g.addUniform("sampler2D u_texture").setColorExpression(g.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),k.u_texture=_}return v.attributes.forEach((function(t){-1===u.attributes.indexOf(t)&&u.attributes.push(t),g.addVarying("v_"+t,"float","a_"+t)})),u.attributes.forEach((function(t){g.addAttribute("float a_"+t)})),{builder:g,attributes:u.attributes.map((function(t){return{name:t,callback:function(n,e){var r=e[t];return"string"==typeof r&&(r=Xl(u,r)),void 0!==r?r:-9999999}}})),uniforms:k}}var pv=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),yv=function(t){function n(n){var e=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return e.sa=n.matrixIds,e}return pv(n,t),n.prototype.getMatrixId=function(t){return this.sa[t]},n.prototype.getMatrixIds=function(){return this.sa},n}(qf),mv=yv;function bv(t,n,e){var r=[],i=[],o=[],s=[],a=[],u=void 0!==e?e:[],c=mr(t.SupportedCRS),f=c.getMetersPerUnit(),h="ne"==c.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(u.length>0)||g(u,(function(e){return n.Identifier==e.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===e.TileMatrix}))){i.push(n.Identifier);var e=28e-5*n.ScaleDenominator/f,c=n.TileWidth,l=n.TileHeight;h?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(e),s.push(c==l?c:[c,l]),a.push([n.MatrixWidth,n.MatrixHeight])}})),new yv({extent:n,origins:o,resolutions:r,matrixIds:i,tileSizes:s,sizes:a})}var wv=function(){function t(t){this.aa=t.opacity,this.ua=t.rotateWithView,this.Fr=t.rotation,this.ca=t.scale,this.fa=eu(t.scale),this.ha=t.displacement}return t.prototype.clone=function(){var n=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.aa},t.prototype.getRotateWithView=function(){return this.ua},t.prototype.getRotation=function(){return this.Fr},t.prototype.getScale=function(){return this.ca},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getDisplacement=function(){return this.ha},t.prototype.getAnchor=function(){return r()},t.prototype.getImage=function(t){return r()},t.prototype.getHitDetectionImage=function(){return r()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return r()},t.prototype.getImageSize=function(){return r()},t.prototype.getOrigin=function(){return r()},t.prototype.getSize=function(){return r()},t.prototype.setDisplacement=function(t){this.ha=t},t.prototype.setOpacity=function(t){this.aa=t},t.prototype.setRotateWithView=function(t){this.ua=t},t.prototype.setRotation=function(t){this.Fr=t},t.prototype.setScale=function(t){this.ca=t,this.fa=eu(t)},t.prototype.listenImageChange=function(t){r()},t.prototype.load=function(){r()},t.prototype.unlistenImageChange=function(t){r()},t}(),gv=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),xv=function(t){function n(n){var e=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(e=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this).Ut=void 0,e.la=null,e.va=void 0!==n.fill?n.fill:null,e._o=[0,0],e.Ht=n.points,e.da=void 0!==n.radius?n.radius:n.radius1,e.pa=n.radius2,e.Kt=void 0!==n.angle?n.angle:0,e.ya=void 0!==n.stroke?n.stroke:null,e.fs=null,e.ma=null,e.render(),e}return gv(n,t),n.prototype.clone=function(){var t=this.getScale(),e=new n({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return e.setOpacity(this.getOpacity()),e},n.prototype.getAnchor=function(){var t=this.fs;if(!t)return null;var n=this.getDisplacement();return[t[0]/2-n[0],t[1]/2+n[1]]},n.prototype.getAngle=function(){return this.Kt},n.prototype.getFill=function(){return this.va},n.prototype.getHitDetectionImage=function(){return this.la||this.ba(this.ma),this.la},n.prototype.getImage=function(t){var n=this.Ut[t];if(!n){var e=this.ma,r=_o(e.size*t,e.size*t);this.wa(e,r,t),n=r.canvas,this.Ut[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.fs},n.prototype.getImageState=function(){return po},n.prototype.getOrigin=function(){return this._o},n.prototype.getPoints=function(){return this.Ht},n.prototype.getRadius=function(){return this.da},n.prototype.getRadius2=function(){return this.pa},n.prototype.getSize=function(){return this.fs},n.prototype.getStroke=function(){return this.ya},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.ga=function(t,n,e){if(0===n||this.Ht===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.da,i=void 0===this.pa?r:this.pa;if(r0,6);var l=void 0!==r.src?lo:po;return e._a=void 0!==r.color?Lo(r.color):null,e.Pa=Pv(c,h,f,e.qt,l,e._a),e.Da=void 0!==r.offset?r.offset:[0,0],e.Na=void 0!==r.offsetOrigin?r.offsetOrigin:Ev,e._o=null,e.fs=void 0!==r.size?r.size:null,e}return Nv(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.ki.slice(),anchorOrigin:this.Ca,anchorXUnits:this.Ra,anchorYUnits:this.Ia,crossOrigin:this.qt,color:this._a&&this._a.slice?this._a.slice():this._a||void 0,src:this.getSrc(),offset:this.Da.slice(),offsetOrigin:this.Na,size:null!==this.fs?this.fs.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},n.prototype.getAnchor=function(){var t=this.Aa;if(!t){t=this.ki;var n=this.getSize();if(this.Ra==Mv||this.Ia==Mv){if(!n)return null;t=this.ki.slice(),this.Ra==Mv&&(t[0]*=n[0]),this.Ia==Mv&&(t[1]*=n[1])}if(this.Ca!=Ev){if(!n)return null;t===this.ki&&(t=this.ki.slice()),this.Ca!=Av&&this.Ca!=Tv||(t[0]=-t[0]+n[0]),this.Ca!=Ov&&this.Ca!=Tv||(t[1]=-t[1]+n[1])}this.Aa=t}var e=this.getDisplacement();return[t[0]-e[0],t[1]+e[1]]},n.prototype.setAnchor=function(t){this.ki=t,this.Aa=null},n.prototype.getColor=function(){return this._a},n.prototype.getImage=function(t){return this.Pa.getImage(t)},n.prototype.getPixelRatio=function(t){return this.Pa.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.Pa.getSize()},n.prototype.getImageState=function(){return this.Pa.getImageState()},n.prototype.getHitDetectionImage=function(){return this.Pa.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this._o)return this._o;var t=this.Da;if(this.Na!=Ev){var n=this.getSize(),e=this.Pa.getSize();if(!n||!e)return null;t=t.slice(),this.Na!=Av&&this.Na!=Tv||(t[0]=e[0]-n[0]-t[0]),this.Na!=Ov&&this.Na!=Tv||(t[1]=e[1]-n[1]-t[1])}return this._o=t,this._o},n.prototype.getSrc=function(){return this.Pa.getSrc()},n.prototype.getSize=function(){return this.fs?this.fs:this.Pa.getSize()},n.prototype.listenImageChange=function(t){this.Pa.addEventListener(D,t)},n.prototype.load=function(){this.Pa.load()},n.prototype.unlistenImageChange=function(t){this.Pa.removeEventListener(D,t)},n}(wv),Lv=function(){function t(t){var n=t||{};this._a=void 0!==n.color?n.color:null,this.za=n.lineCap,this.La=void 0!==n.lineDash?n.lineDash:null,this.Fa=n.lineDashOffset,this.Ga=n.lineJoin,this.Ua=n.miterLimit,this.Ba=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this._a},t.prototype.getLineCap=function(){return this.za},t.prototype.getLineDash=function(){return this.La},t.prototype.getLineDashOffset=function(){return this.Fa},t.prototype.getLineJoin=function(){return this.Ga},t.prototype.getMiterLimit=function(){return this.Ua},t.prototype.getWidth=function(){return this.Ba},t.prototype.setColor=function(t){this._a=t},t.prototype.setLineCap=function(t){this.za=t},t.prototype.setLineDash=function(t){this.La=t},t.prototype.setLineDashOffset=function(t){this.Fa=t},t.prototype.setLineJoin=function(t){this.Ga=t},t.prototype.setMiterLimit=function(t){this.Ua=t},t.prototype.setWidth=function(t){this.Ba=t},t}();function Fv(t){return(Fv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Gv=function(){function t(t){var n=t||{};this.Yr=null,this.qa=Vv,void 0!==n.geometry&&this.setGeometry(n.geometry),this.va=void 0!==n.fill?n.fill:null,this.Dt=void 0!==n.image?n.image:null,this.cn=void 0!==n.renderer?n.renderer:null,this.$a=void 0!==n.hitDetectionRenderer?n.hitDetectionRenderer:null,this.ya=void 0!==n.stroke?n.stroke:null,this.io=void 0!==n.text?n.text:null,this.Va=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"===Fv(n)&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.cn},t.prototype.setRenderer=function(t){this.cn=t},t.prototype.setHitDetectionRenderer=function(t){this.$a=t},t.prototype.getHitDetectionRenderer=function(){return this.$a},t.prototype.getGeometry=function(){return this.Yr},t.prototype.getGeometryFunction=function(){return this.qa},t.prototype.getFill=function(){return this.va},t.prototype.setFill=function(t){this.va=t},t.prototype.getImage=function(){return this.Dt},t.prototype.setImage=function(t){this.Dt=t},t.prototype.getStroke=function(){return this.ya},t.prototype.setStroke=function(t){this.ya=t},t.prototype.getText=function(){return this.io},t.prototype.setText=function(t){this.io=t},t.prototype.getZIndex=function(){return this.Va},t.prototype.setGeometry=function(t){"function"==typeof t?this.qa=t:"string"==typeof t?this.qa=function(n){return n.get(t)}:t?void 0!==t&&(this.qa=function(){return t}):this.qa=Vv,this.Yr=t},t.prototype.setZIndex=function(t){this.Va=t},t}();function Uv(t){var n;if("function"==typeof t)n=t;else{var e;if(Array.isArray(t))e=t;else Mt("function"==typeof t.getZIndex,41),e=[t];n=function(){return e}}return n}var Bv=null;function qv(t,n){if(!Bv){var e=new Sv({color:"rgba(255,255,255,0.4)"}),r=new Lv({color:"#3399CC",width:1.25});Bv=[new Gv({image:new _v({fill:e,stroke:r,radius:5}),fill:e,stroke:r})]}return Bv}function $v(){var t={},n=[255,255,255,1],e=[0,153,255,1];return t[It.POLYGON]=[new Gv({fill:new Sv({color:[255,255,255,.5]})})],t[It.MULTI_POLYGON]=t[It.POLYGON],t[It.LINE_STRING]=[new Gv({stroke:new Lv({color:n,width:5})}),new Gv({stroke:new Lv({color:e,width:3})})],t[It.MULTI_LINE_STRING]=t[It.LINE_STRING],t[It.CIRCLE]=t[It.POLYGON].concat(t[It.LINE_STRING]),t[It.POINT]=[new Gv({image:new _v({radius:6,fill:new Sv({color:e}),stroke:new Lv({color:n,width:1.5})}),zIndex:1/0})],t[It.MULTI_POINT]=t[It.POINT],t[It.GEOMETRY_COLLECTION]=t[It.POLYGON].concat(t[It.LINE_STRING],t[It.POINT]),t}function Vv(t){return t.getGeometry()}var Zv=Gv,Wv="point",Hv="line",Kv=function(){function t(t){var n=t||{};this.Za=n.font,this.Fr=n.rotation,this.ua=n.rotateWithView,this.ca=n.scale,this.fa=eu(void 0!==n.scale?n.scale:1),this.io=n.text,this.Wa=n.textAlign,this.Ha=n.textBaseline,this.va=void 0!==n.fill?n.fill:new Sv({color:"#333"}),this.Ka=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.Xa=void 0!==n.placement?n.placement:Wv,this.Ya=!!n.overflow,this.ya=void 0!==n.stroke?n.stroke:null,this.Ja=void 0!==n.offsetX?n.offsetX:0,this.Qa=void 0!==n.offsetY?n.offsetY:0,this.tu=n.backgroundFill?n.backgroundFill:null,this.nu=n.backgroundStroke?n.backgroundStroke:null,this.Te=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.Ya},t.prototype.getFont=function(){return this.Za},t.prototype.getMaxAngle=function(){return this.Ka},t.prototype.getPlacement=function(){return this.Xa},t.prototype.getOffsetX=function(){return this.Ja},t.prototype.getOffsetY=function(){return this.Qa},t.prototype.getFill=function(){return this.va},t.prototype.getRotateWithView=function(){return this.ua},t.prototype.getRotation=function(){return this.Fr},t.prototype.getScale=function(){return this.ca},t.prototype.getScaleArray=function(){return this.fa},t.prototype.getStroke=function(){return this.ya},t.prototype.getText=function(){return this.io},t.prototype.getTextAlign=function(){return this.Wa},t.prototype.getTextBaseline=function(){return this.Ha},t.prototype.getBackgroundFill=function(){return this.tu},t.prototype.getBackgroundStroke=function(){return this.nu},t.prototype.getPadding=function(){return this.Te},t.prototype.setOverflow=function(t){this.Ya=t},t.prototype.setFont=function(t){this.Za=t},t.prototype.setMaxAngle=function(t){this.Ka=t},t.prototype.setOffsetX=function(t){this.Ja=t},t.prototype.setOffsetY=function(t){this.Qa=t},t.prototype.setPlacement=function(t){this.Xa=t},t.prototype.setRotateWithView=function(t){this.ua=t},t.prototype.setFill=function(t){this.va=t},t.prototype.setRotation=function(t){this.Fr=t},t.prototype.setScale=function(t){this.ca=t,this.fa=eu(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.ya=t},t.prototype.setText=function(t){this.io=t},t.prototype.setTextAlign=function(t){this.Wa=t},t.prototype.setTextBaseline=function(t){this.Ha=t},t.prototype.setBackgroundFill=function(t){this.tu=t},t.prototype.setBackgroundStroke=function(t){this.nu=t},t.prototype.setPadding=function(t){this.Te=t},t}(),Xv=function(){function t(t){this.eu,this.ru,this.iu,this.ou=void 0===t||t,this.su=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},e=this.iu;if(e){var r=e.next;n.prev=e,n.next=r,e.next=n,r&&(r.prev=n),e===this.ru&&(this.ru=n)}else this.eu=n,this.ru=n,this.ou&&(n.next=n,n.prev=n);this.iu=n,this.su++},t.prototype.removeItem=function(){var t=this.iu;if(t){var n=t.next,e=t.prev;n&&(n.prev=e),e&&(e.next=n),this.iu=n||e,this.eu===this.ru?(this.iu=void 0,this.eu=void 0,this.ru=void 0):this.eu===t?this.eu=this.iu:this.ru===t&&(this.ru=e?this.iu.prev:this.iu),this.su--}},t.prototype.firstItem=function(){if(this.iu=this.eu,this.iu)return this.iu.data},t.prototype.lastItem=function(){if(this.iu=this.ru,this.iu)return this.iu.data},t.prototype.nextItem=function(){if(this.iu&&this.iu.next)return this.iu=this.iu.next,this.iu.data},t.prototype.getNextItem=function(){if(this.iu&&this.iu.next)return this.iu.next.data},t.prototype.prevItem=function(){if(this.iu&&this.iu.prev)return this.iu=this.iu.prev,this.iu.data},t.prototype.getPrevItem=function(){if(this.iu&&this.iu.prev)return this.iu.prev.data},t.prototype.getCurrItem=function(){if(this.iu)return this.iu.data},t.prototype.setFirstItem=function(){this.ou&&this.iu&&(this.eu=this.iu,this.ru=this.iu.prev)},t.prototype.concat=function(t){if(t.iu){if(this.iu){var n=this.iu.next;this.iu.next=t.eu,t.eu.prev=this.iu,n.prev=t.ru,t.ru.next=n,this.su+=t.su}else this.iu=t.iu,this.eu=t.eu,this.ru=t.ru,this.su=t.su;t.iu=void 0,t.eu=void 0,t.ru=void 0,t.su=0}},t.prototype.getLength=function(){return this.su},t}(),Yv=e(7072),Jv=function(){function t(t){this.au=new Yv(t),this.uu={}}return t.prototype.insert=function(t,n){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.au.insert(e),this.uu[o(n)]=e},t.prototype.load=function(t,n){for(var e=new Array(n.length),r=0,i=n.length;re.highWaterMark&&(e.highWaterMark=t)},n.prototype.useTile=function(t,n,e,r){},n}(id),ad=function(t){function n(n,e){var r=t.call(this,n)||this;return r.tile=e,r}return od(n,t),n}(h),ud=sd,cd=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),fd=function(t){function n(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.mu=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(r.tileUrlFunction=e.tileUrlFunction),r.urls=null,e.urls?r.setUrls(e.urls):e.url&&r.setUrl(e.url),r.bu={},r}return cd(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,e=t.target,r=o(e),i=e.getState();i==vt?(this.bu[r]=!0,n=Qv):r in this.bu&&(delete this.bu[r],n=i==pt?nd:i==dt?td:void 0),null!=n&&this.dispatchEvent(new ad(n,e))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=nh(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.mu?this.setTileUrlFunction(Jf(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,e){},n.prototype.useTile=function(t,n,e){var r=Fc(t,n,e);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(ud),hd=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function ld(t,n){t.getImage().src=n}var vd=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(e=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:ld,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:r,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,e.tileClass=void 0!==n.tileClass?n.tileClass:Co,e.tileCacheForProjection={},e.tileGridForProjection={},e.wu=n.reprojectionErrorThreshold,e.gu=!1,e}return hd(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var e=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==e?n:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==e?n:{})}},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Mr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!Mr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!Mr(n,t)){var e=o(t);return e in this.tileGridForProjection||(this.tileGridForProjection[e]=$f(t)),this.tileGridForProjection[e]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||Mr(n,t))return this.tileCache;var e=o(t);return e in this.tileCacheForProjection||(this.tileCacheForProjection[e]=new Zc(this.tileCache.highWaterMark)),this.tileCacheForProjection[e]},n.prototype.xu=function(t,n,e,r,i,o){var s=[t,n,e],a=this.getTileCoordForTileUrlFunction(s,i),u=a?this.tileUrlFunction(a,r,i):void 0,c=new this.tileClass(s,void 0!==u?lt:yt,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(D,this.handleTileChange.bind(this)),c},n.prototype.getTile=function(t,n,e,r,i){var o=this.getProjection();if(o&&i&&!Mr(o,i)){var s=this.getTileCacheForProjection(i),a=[t,n,e],u=void 0,c=Gc(a);s.containsKey(c)&&(u=s.get(c));var f=this.getKey();if(u&&u.key==f)return u;var h=this.getTileGridForProjection(o),l=this.getTileGridForProjection(i),v=this.getTileCoordForTileUrlFunction(a,i),d=new hl(o,h,i,l,a,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,e,r){return this.getTileInternal(t,n,e,r,o)}.bind(this),this.wu,this.gu,this.getInterpolate());return d.key=f,u?(d.interimTile=u,d.refreshInterimChain(),s.replace(c,d)):s.set(c,d),d}return this.getTileInternal(t,n,e,r,o||i)},n.prototype.getTileInternal=function(t,n,e,r,i){var o=null,s=Fc(t,n,e),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var u=o;o=this.xu(t,n,e,r,i,a),u.getState()==lt?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.xu(t,n,e,r,i,a),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.gu!=t){for(var n in this.gu=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var e=mr(t);if(e){var r=o(e);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(fd),dd=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function pd(t){var n,e,r=t[0],i=new Array(r),o=1<>=1;return i.join("")}for(var yd=function(t){function n(n){var e=this,r=void 0!==n.hidpi&&n.hidpi,i=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(i=n.interpolate),(e=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:i,opaque:!0,projection:mr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:hs,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).ku=r,e._u=void 0!==n.culture?n.culture:"en-us",e.Su=void 0!==n.maxZoom?n.maxZoom:-1,e.Mu=n.key,e.ju=n.imagerySet,lf("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+e.ju+"?uriScheme=https&include=ImageryProviders&key="+e.Mu+"&c="+e._u,e.handleImageryMetadataResponse.bind(e),void 0,"jsonp"),e}return dd(n,t),n.prototype.getApiKey=function(){return this.Mu},n.prototype.getImagerySet=function(){return this.ju},n.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var n=t.resourceSets[0].resources[0],e=-1==this.Su?n.zoomMax:this.Su,r=Xf(this.getProjection()),i=this.ku?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/i:[n.imageWidth/i,n.imageHeight/i],s=Wf({extent:r,minZoom:n.zoomMin,maxZoom:e,tileSize:o});this.tileGrid=s;var a=this._u,u=this.ku;if(this.tileUrlFunction=Qf(n.imageUrlSubdomains.map((function(t){var e=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,n,i){if(t){Lc(t[0],t[1],t[2],e);var o=r;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",pd(e))}}}))),n.imageryProviders){var c=jr(mr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var e=[],r=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(r.resolution,this.zDirection),s=i.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,i=n.coverageAreas,o=0,a=i.length;o=u.zoomMin&&s<=u.zoomMax){var f=u.bbox;if(te(oe([f[1],f[0],f[3],f[2]],c),t.extent)){r=!0;break}}}r&&e.push(n.attribution)})),e.push('Terms of Use'),e}.bind(this))}this.setState(ls)}else this.setState(vs)},n}(vd),md=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),bd=function(t){function n(n){var e=n||{},r=void 0===e.imageSmoothing||e.imageSmoothing;void 0!==e.interpolate&&(r=e.interpolate);var i=void 0!==e.projection?e.projection:"EPSG:3857",o=void 0!==e.tileGrid?e.tileGrid:Wf({extent:Xf(i),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});return t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:r,opaque:e.opaque,projection:i,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this}return md(n,t),n}(vd),wd=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),gd=function(t){function n(n){var e=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return e.Ou=n.account,e.Tu=n.map||"",e.Eu=n.config||{},e.Au={},e.Cu(),e}return wd(n,t),n.prototype.getConfig=function(){return this.Eu},n.prototype.updateConfig=function(t){E(this.Eu,t),this.Cu()},n.prototype.setConfig=function(t){this.Eu=t||{},this.Cu()},n.prototype.Cu=function(){var t=JSON.stringify(this.Eu);if(this.Au[t])this.Ru(this.Au[t]);else{var n="https://"+this.Ou+".carto.com/api/v1/map";this.Tu&&(n+="/named/"+this.Tu);var e=new XMLHttpRequest;e.addEventListener("load",this.Iu.bind(this,t)),e.addEventListener("error",this.Pu.bind(this)),e.open("POST",n),e.setRequestHeader("Content-type","application/json"),e.send(JSON.stringify(this.Eu))}},n.prototype.Iu=function(t,n){var e=n.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.setState(vs)}this.Ru(r),this.Au[t]=r,this.setState(ls)}else this.setState(vs)},n.prototype.Pu=function(t){this.setState(vs)},n.prototype.Ru=function(t){var n="https://"+t.cdn_url.https+"/"+this.Ou+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(bd),xd="addfeature",kd="changefeature",_d="clear",Sd="removefeature",Md="featuresloadstart",jd="featuresloadend",Od="featuresloaderror",Td=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ed=function(t){function n(n,e,r){var i=t.call(this,n)||this;return i.feature=e,i.features=r,i}return Td(n,t),n}(h),Ad=function(t){function n(n){var e=this,r=n||{};(e=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:ls,wrapX:void 0===r.wrapX||r.wrapX})||this).on,e.once,e.un,e.B=j,e.Ni=r.format,e.Du=void 0===r.overlaps||r.overlaps,e.Li=r.url,void 0!==r.loader?e.B=r.loader:void 0!==e.Li&&(Mt(e.Ni,7),e.B=cf(e.Li,e.Ni)),e.Nu=void 0!==r.strategy?r.strategy:ff;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return e.zu=s?new Jv:null,e.Lu=new Jv,e.Fu=0,e.Gu={},e.Uu={},e.Bu={},e.qu={},e.$u=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new ht(o)),void 0!==o&&e.addFeaturesInternal(o),void 0!==i&&e.Vu(i),e}return Td(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=o(t);if(this.Zu(n,t)){this.Wu(n,t);var e=t.getGeometry();if(e){var r=e.getExtent();this.zu&&this.zu.insert(r,t)}else this.Gu[n]=t;this.dispatchEvent(new Ed(xd,t))}else this.$u&&this.$u.remove(t)},n.prototype.Wu=function(t,n){this.qu[t]=[X(n,D,this.Hu,this),X(n,l,this.Hu,this)]},n.prototype.Zu=function(t,n){var e=!0,r=n.getId();return void 0!==r&&(r.toString()in this.Uu?e=!1:this.Uu[r.toString()]=n),e&&(Mt(!(t in this.Bu),30),this.Bu[t]=n),e},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],e=[],r=[],i=0,s=t.length;i0},n.prototype.refresh=function(){this.clear(!0),this.Lu.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,e=this.Lu;e.forEachInExtent(t,(function(e){if(Pn(e.extent,t))return n=e,!0})),n&&e.remove(n)},n.prototype.removeFeature=function(t){if(t){var n=o(t);n in this.Gu?delete this.Gu[n]:this.zu&&this.zu.remove(t),this.removeFeatureInternal(t)&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var n=o(t),e=this.qu[n];if(e){e.forEach(J),delete this.qu[n];var r=t.getId();return void 0!==r&&delete this.Uu[r.toString()],delete this.Bu[n],this.dispatchEvent(new Ed(Sd,t)),t}},n.prototype.Ku=function(t){var n=!1;for(var e in this.Uu)if(this.Uu[e]===t){delete this.Uu[e],n=!0;break}return n},n.prototype.setLoader=function(t){this.B=t},n.prototype.setUrl=function(t){Mt(this.Ni,7),this.Li=t,this.setLoader(cf(t,this.Ni))},n}(id),Cd=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Rd=function(t){function n(n){var e=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return e.resolution=void 0,e.distance=void 0!==n.distance?n.distance:20,e.minDistance=n.minDistance||0,e.interpolationRatio=0,e.features=[],e.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return Mt(n.getType()==It.POINT,10),n},e.Xu=n.createCluster,e.source=null,e.Yu=e.refresh.bind(e),e.updateDistance(e.distance,e.minDistance),e.setSource(n.source||null),e}return Cd(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,e){this.source.loadFeatures(t,n,e),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(D,this.Yu),this.source=t,t&&t.addEventListener(D,this.Yu),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var e=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==e;this.distance=t,this.minDistance=n,this.interpolationRatio=e,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,e=this.source.getFeatures(),r={},i=0,s=e.length;i=0;--r){var i=this.geometryFunction(t[r]);i?Qe(e,i.getCoordinates()):t.splice(r,1)}sr(e,1/t.length);var o=Zn(n),s=this.interpolationRatio,a=new Mi([e[0]*(1-s)+o[0]*s,e[1]*(1-s)+o[1]*s]);return this.Xu?this.Xu(a,t):new Tt({geometry:a,features:t})},n}(Ad),Id=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Pd=function(t){function n(n){var e=this,r=void 0===n.projection?"EPSG:3857":n.projection,i=n.tileGrid;return void 0===i&&r&&(i=Wf({extent:Xf(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize})),(e=t.call(this,{cacheSize:.1,attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:r,tileGrid:i,opaque:n.opaque,state:n.state,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate})||this).bu={},e.B=n.loader,e.cr=e.cr.bind(e),e.bandCount=void 0===n.bandCount?4:n.bandCount,e}return Id(n,t),n.prototype.setLoader=function(t){this.B=t},n.prototype.getTile=function(t,n,e,r,i){var o=Fc(t,n,e);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=this.B;var a=new St(E({tileCoord:[t,n,e],loader:function(){return T((function(){return s(t,n,e)}))}},this.tileOptions));return a.key=this.getKey(),a.addEventListener(D,this.cr),this.tileCache.set(o,a),a},n.prototype.cr=function(t){var n,e=t.target,r=o(e),i=e.getState();i==vt?(this.bu[r]=!0,n=Qv):r in this.bu&&(delete this.bu[r],n=i==pt?nd:i==dt?td:void 0),n&&this.dispatchEvent(new ad(n,e))},n}(ud),Dd=new ArrayBuffer(4),Nd=new Float32Array(Dd),zd=new Uint32Array(Dd),Ld=new Uint32Array(512),Fd=new Uint32Array(512),Gd=0;Gd<256;++Gd){var Ud=Gd-127;Ud<-27?(Ld[Gd]=0,Ld[256|Gd]=32768,Fd[Gd]=24,Fd[256|Gd]=24):Ud<-14?(Ld[Gd]=1024>>-Ud-14,Ld[256|Gd]=1024>>-Ud-14|32768,Fd[Gd]=-Ud-1,Fd[256|Gd]=-Ud-1):Ud<=15?(Ld[Gd]=Ud+15<<10,Ld[256|Gd]=Ud+15<<10|32768,Fd[Gd]=13,Fd[256|Gd]=13):Ud<128?(Ld[Gd]=31744,Ld[256|Gd]=64512,Fd[Gd]=24,Fd[256|Gd]=24):(Ld[Gd]=31744,Ld[256|Gd]=64512,Fd[Gd]=13,Fd[256|Gd]=13)}var Bd=new Uint32Array(2048),qd=new Uint32Array(64),$d=new Uint32Array(64);Bd[0]=0;for(var Vd=1;Vd<1024;++Vd){for(var Zd=Vd<<13,Wd=0;0==(8388608&Zd);)Wd-=8388608,Zd<<=1;Zd&=-8388609,Wd+=947912704,Bd[Vd]=Zd|Wd}for(var Hd=1024;Hd<2048;++Hd)Bd[Hd]=939524096+(Hd-1024<<13);qd[0]=0;for(var Kd=1;Kd<31;++Kd)qd[Kd]=Kd<<23;qd[31]=1199570944,qd[32]=2147483648;for(var Xd=33;Xd<63;++Xd)qd[Xd]=2147483648+(Xd-32<<23);qd[63]=3347054592,$d[0]=0;for(var Yd=1;Yd<64;++Yd)$d[Yd]=32===Yd?0:1024;function Jd(t){var n=t>>10;return zd[0]=Bd[$d[n]+(1023&t)]+qd[n],Nd[0]}var Qd=Reflect.getPrototypeOf(Uint8Array).prototype,tp=Reflect.getOwnPropertyDescriptor(Qd,Symbol.toStringTag).get;function np(t){return void 0!==tp.call(t)}var ep=Object.prototype.toString;function rp(t){return!!ArrayBuffer.isView(t)&&(!np(t)&&"[object DataView]"===ep.call(t))}function ip(t,n){if(!rp(t))throw new TypeError("First argument to getFloat16 function must be a DataView");for(var e=arguments.length,r=new Array(e>2?e-2:0),i=2;i>24)/500+s,u=s-(t[i+2]<<24>>24)/200,c=void 0,f=void 0,h=void 0;f=-.9689*(a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787))+1.8758*(s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787))+.0415*(u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787)),h=.0557*a+-.204*s+1.057*u,c=(c=3.2406*a+-1.5372*s+-.4986*u)>.0031308?1.055*Math.pow(c,1/2.4)-.055:12.92*c,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:12.92*f,h=h>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,r[o]=255*Math.max(0,Math.min(1,c)),r[o+1]=255*Math.max(0,Math.min(1,f)),r[o+2]=255*Math.max(0,Math.min(1,h))}return r}function yp(t,n,e,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(r,i)}function mp(t){return function(){var n=this,e=arguments;return new Promise((function(r,i){var o=t.apply(n,e);function s(t){yp(o,r,i,s,a,"next",t)}function a(t){yp(o,r,i,s,a,"throw",t)}s(void 0)}))}}var bp=new Map;function wp(t,n){Array.isArray(t)||(t=[t]),t.forEach((function(t){return bp.set(t,n)}))}function gp(t){return xp.apply(this,arguments)}function xp(){return(xp=mp(regeneratorRuntime.mark((function t(n){var e,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=bp.get(n.Compression)){t.next=3;break}throw new Error("Unknown compression method identifier: ".concat(n.Compression));case 3:return t.next=5,e();case 5:return r=t.sent,t.abrupt("return",new r(n));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kp(t,n,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(n*e*r)}function _p(t,n,e,r,i){var o=n/r,s=e/i;return t.map((function(t){for(var a=kp(t,r,i),u=0;u5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return _p(t,n,e,r,i);case"bilinear":case"linear":return Mp(t,n,e,r,i);default:throw new Error("Unsupported resampling method: '".concat(o,"'"))}}function Op(t,n,e,r,i,o){for(var s=n/r,a=e/i,u=kp(t,r,i,o),c=0;c6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return Op(t,n,e,r,i,o);case"bilinear":case"linear":return Tp(t,n,e,r,i,o);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}}function Ap(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,i,o=[],s=!0,a=!1;try{for(e=e.call(t);!(s=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==e.return||e.return()}finally{if(a)throw i}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return Cp(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Cp(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cp(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e>8-i-g&f;else if(g+i<=16)c[b]=a.getUint16(w)>>16-i-g&f;else if(g+i<=24){var x=a.getUint16(w)<<8|a.getUint8(w+2);c[b]=x>>24-i-g&f}else c[b]=a.getUint32(w)>>32-i-g&f}}return c.buffer}wp([void 0,1],(function(){return e.e(947).then(e.bind(e,6947)).then((function(t){return t.default}))})),wp(5,(function(){return e.e(25).then(e.bind(e,4025)).then((function(t){return t.default}))})),wp(6,(function(){throw new Error("old style JPEG compression is not supported.")})),wp(7,(function(){return e.e(410).then(e.bind(e,2410)).then((function(t){return t.default}))})),wp([8,32946],(function(){return Promise.all([e.e(760),e.e(998)]).then(e.bind(e,5998)).then((function(t){return t.default}))})),wp(32773,(function(){return e.e(949).then(e.bind(e,4949)).then((function(t){return t.default}))})),wp(34887,(function(){return Promise.all([e.e(760),e.e(830)]).then(e.bind(e,9830)).then((function(t){return t.default}))}));var Fp=function(){function t(n,e,r,i,o,s){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.fileDirectory=n,this.geoKeys=e,this.dataView=r,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!n.StripOffsets;var a=n.PlanarConfiguration;if(this.planarConfiguration=void 0===a?1:a,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=s}var n,e,r,i,o,s,a;return n=t,(e=[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBlockWidth",value:function(){return this.getTileWidth()}},{key:"getBlockHeight",value:function(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}},{key:"getBytesPerPixel",value:function(){for(var t=0,n=0;n=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(t," is out of range."));return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}},{key:"getReaderForSample",value:function(t){var n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,e=this.fileDirectory.BitsPerSample[t];switch(n){case 1:if(e<=8)return DataView.prototype.getUint8;if(e<=16)return DataView.prototype.getUint16;if(e<=32)return DataView.prototype.getUint32;break;case 2:if(e<=8)return DataView.prototype.getInt8;if(e<=16)return DataView.prototype.getInt16;if(e<=32)return DataView.prototype.getInt32;break;case 3:switch(e){case 16:return function(t,n){return ip(this,t,n)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getSampleFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}},{key:"getBitsPerSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}},{key:"getArrayForSample",value:function(t,n){return Np(this.getSampleFormat(t),this.getBitsPerSample(t),n)}},{key:"getTileOrStrip",value:(a=Ip(regeneratorRuntime.mark((function t(n,e,r,i,o){var s,a,u,c,f,h,l,v,d=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight()),c=this.tiles,1===this.planarConfiguration?u=e*s+n:2===this.planarConfiguration&&(u=r*s*a+e*s+n),this.isTiled?(f=this.fileDirectory.TileOffsets[u],h=this.fileDirectory.TileByteCounts[u]):(f=this.fileDirectory.StripOffsets[u],h=this.fileDirectory.StripByteCounts[u]),t.next=7,this.source.fetch([{offset:f,length:h}],o);case 7:return l=t.sent[0],null!==c&&c[u]?v=c[u]:(v=Ip(regeneratorRuntime.mark((function t(){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.decode(d.fileDirectory,l);case 2:return n=t.sent,r=d.getSampleFormat(),o=d.getBitsPerSample(),zp(r,o)&&(n=Lp(n,r,d.planarConfiguration,d.getSamplesPerPixel(),o,d.getTileWidth(),d.getBlockHeight(e))),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)})))(),null!==c&&(c[u]=v)),t.t0=n,t.t1=e,t.t2=r,t.next=14,v;case 14:return t.t3=t.sent,t.abrupt("return",{x:t.t0,y:t.t1,sample:t.t2,data:t.t3});case 16:case"end":return t.stop()}}),t,this)}))),function(t,n,e,r,i){return a.apply(this,arguments)})},{key:"_readRaster",value:(s=Ip(regeneratorRuntime.mark((function t(n,e,r,i,o,s,a,u,c){var f,h,l,v,d,p,y,m,b,w,g,x,k,_,S,M,j,O,T,E,A=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(f=this.getTileWidth(),h=this.getTileHeight(),l=this.getWidth(),v=this.getHeight(),d=Math.max(Math.floor(n[0]/f),0),p=Math.min(Math.ceil(n[2]/f),Math.ceil(l/f)),y=Math.max(Math.floor(n[1]/h),0),m=Math.min(Math.ceil(n[3]/h),Math.ceil(v/h)),b=n[2]-n[0],w=this.getBytesPerPixel(),g=[],x=[],k=0;k0&&void 0!==O[0]?O[0]:{},e=n.window,r=n.samples,i=void 0===r?[]:r,o=n.interleave,s=n.pool,a=void 0===s?null:s,u=n.width,c=n.height,f=n.resampleMethod,h=n.fillValue,l=n.signal,!((v=e||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if(d=v[2]-v[0],p=v[3]-v[1],y=d*p,m=this.getSamplesPerPixel(),i&&i.length){t.next=12;break}for(b=0;b=m)){t.next=16;break}return t.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(i[w],"'."))));case 16:++w,t.next=13;break;case 19:if(o)x=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,k=Math.max.apply(null,this.fileDirectory.BitsPerSample),g=Np(x,k,y*i.length),h&&g.fill(h);else for(g=[],_=0;_0&&void 0!==T[0]?T[0]:{},e=n.window,r=n.interleave,i=void 0===r||r,o=n.pool,s=void 0===o?null:o,a=n.width,u=n.height,c=n.resampleMethod,f=n.enableAlpha,h=void 0!==f&&f,l=n.signal,!((v=e||[0,0,this.getWidth(),this.getHeight()])[0]>v[2]||v[1]>v[3])){t.next=4;break}throw new Error("Invalid subsets");case 4:if((d=this.fileDirectory.PhotometricInterpretation)!==cp.Ie.RGB){t.next=9;break}if(p=[0,1,2],this.fileDirectory.ExtraSamples!==cp.pd.Unspecified&&h)for(p=[],y=0;y0&&void 0!==arguments[0]?arguments[0]:null,n={};if(!this.fileDirectory.GDAL_METADATA)return null;var e=this.fileDirectory.GDAL_METADATA,r=up()(e,"Item");null!==t&&(r=r.filter((function(n){return Number(sp()(n,"sample"))===t})));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null,n=this.fileDirectory.ModelPixelScale,e=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(e)return[e[0],e[5],e[10]];if(t){var r=t.getResolution(),i=Ap(r,3),o=i[0],s=i[1],a=i[2];return[o*t.getWidth()/this.getWidth(),s*t.getHeight()/this.getHeight(),a*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var t=this.getOrigin(),n=this.getResolution(),e=t[0],r=t[1],i=e+n[0]*this.getWidth(),o=r+n[1]*this.getHeight();return[Math.min(e,i),Math.min(r,o),Math.max(e,i),Math.max(r,o)]}}])&&Pp(n.prototype,e),r&&Pp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Gp(t,n){for(var e=0;e0,i=!0,o=0;o<8;o++){var s=this._dataView.getUint8(t+(n?o:7-o));r&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),e+=s*Math.pow(256,o)}return r&&(e=-e),e}},{key:"getUint8",value:function(t,n){return this._dataView.getUint8(t,n)}},{key:"getInt8",value:function(t,n){return this._dataView.getInt8(t,n)}},{key:"getUint16",value:function(t,n){return this._dataView.getUint16(t,n)}},{key:"getInt16",value:function(t,n){return this._dataView.getInt16(t,n)}},{key:"getUint32",value:function(t,n){return this._dataView.getUint32(t,n)}},{key:"getInt32",value:function(t,n){return this._dataView.getInt32(t,n)}},{key:"getFloat16",value:function(t,n){return ip(this._dataView,t,n)}},{key:"getFloat32",value:function(t,n){return this._dataView.getFloat32(t,n)}},{key:"getFloat64",value:function(t,n){return this._dataView.getFloat64(t,n)}}])&&Gp(n.prototype,e),r&&Gp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Bp(t,n){for(var e=0;e=t+n}},{key:"readUint8",value:function(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(t){var n,e=this.readUint32(t),r=this.readUint32(t+4);if(this._littleEndian){if(n=e+Math.pow(2,32)*r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=Math.pow(2,32)*e+r,!Number.isSafeInteger(n))throw new Error("".concat(n," exceeds MAX_SAFE_INTEGER. ")+"Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}},{key:"readInt64",value:function(t){for(var n=0,e=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0,r=!0,i=0;i<8;i++){var o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));e&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),n+=o*Math.pow(256,i)}return e&&(n=-n),n}},{key:"readOffset",value:function(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}])&&Bp(n.prototype,e),r&&Bp(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function $p(t){return Wp(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Hp(t)||Zp()}function Vp(t,n){return Wp(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,i,o=[],s=!0,a=!1;try{for(e=e.call(t);!(s=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==e.return||e.return()}finally{if(a)throw i}}return o}(t,n)||Hp(t,n)||Zp()}function Zp(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wp(t){if(Array.isArray(t))return t}function Hp(t,n){if(t){if("string"==typeof t)return Kp(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Kp(t,n):void 0}}function Kp(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=Vp(n.value,2),o=i[0],s=i[1];e[o.toLowerCase()]=s}}catch(t){r.e(t)}finally{r.f()}return e}function Jp(t){return Yp(t.split("\r\n").map((function(t){var n=t.split(":").map((function(t){return t.trim()}));return n[0]=n[0].toLowerCase(),n})))}function Qp(t){var n,e,r;if(t){var i=Vp(t.match(/bytes (\d+)-(\d+)\/(\d+)/),4);n=i[1],e=i[2],r=i[3],n=parseInt(n,10),e=parseInt(e,10),r=parseInt(r,10)}return{start:n,end:e,total:r}}function ty(t,n){for(var e=null,r=new TextDecoder("ascii"),i=[],o="--".concat(n),s="".concat(o,"--"),a=0;a<10;++a){r.decode(new Uint8Array(t,a,o.length))===o&&(e=a)}if(null===e)throw new Error("Could not find initial boundary");for(;e1&&void 0!==i[1]?i[1]:void 0,t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,e)}))));case 2:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"fetchSlice",value:(o=ey(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("fetching of slice ".concat(n," not possible, not implemented"));case 1:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})},{key:"fileSize",get:function(){return null}},{key:"close",value:(i=ey(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})}])&&ry(n.prototype,e),r&&ry(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),oy=e(6875),sy=e.n(oy);function ay(t){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uy(t,n){for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}function Ay(t,n){if(t){if("string"==typeof t)return Cy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Cy(t,n):void 0}}function Cy(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e2&&void 0!==arguments[2]?arguments[2]:null;Ly(this,t),this.offset=n,this.length=e,this.data=r}return Gy(t,[{key:"top",get:function(){return this.offset+this.length}}]),t}(),By=Gy((function t(n,e,r){Ly(this,t),this.offset=n,this.length=e,this.blockIds=r})),qy=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&Py(t,n)}(r,t);var n,e=Dy(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.blockSize,s=void 0===o?65536:o,a=i.cacheSize,u=void 0===a?100:a;return Ly(this,r),(n=e.call(this)).source=t,n.blockSize=s,n.blockCache=new(sy())({max:u}),n.blockRequests=new Map,n.blockIdsToFetch=new Set,n}return Gy(r,[{key:"fileSize",get:function(){return this.source.fileSize}},{key:"fetch",value:(n=Iy(regeneratorRuntime.mark((function t(n,e){var r,i,o,s,a,u,c,f,h,l,v,d,p,y,m,b,w,g,x,k,_,S,M,j,O,T,E,A,C,R,I,P,D,N,z,L,F,G;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Map,i=new Map,o=new Set,s=Ey(n);try{for(s.s();!(a=s.n()).done;)for(u=a.value,c=u.offset,f=u.length,h=c+f,null!==(l=this.fileSize)&&(h=Math.min(h,l)),v=Math.floor(c/this.blockSize)*this.blockSize,d=v;d0)){t.next=65;break}this.fetchBlocks(e),A=Ey(k),t.prev=44,A.s();case 46:if((C=A.n()).done){t.next=54;break}if(R=C.value,I=this.blockRequests.get(R)){t.next=51;break}throw new Error("Block ".concat(R," is not in the block requests"));case 51:i.set(R,I);case 52:t.next=46;break;case 54:t.next=59;break;case 56:t.prev=56,t.t1=t.catch(44),A.e(t.t1);case 59:return t.prev=59,A.f(),t.finish(59);case 62:return t.next=64,Promise.allSettled(Array.from(i.values()));case 64:x=t.sent;case 65:if(!x.some((function(t){return"rejected"===t.status}))){t.next=69;break}if(!e||!e.aborted){t.next=68;break}throw new My("Request was aborted");case 68:throw new jy(x.filter((function(t){return"rejected"===t.status})).map((function(t){return t.reason})),"Request failed");case 69:P=x.map((function(t){return t.value})),D=new Map(Sy(Array.from(i.keys()),P)),N=Ey(r);try{for(N.s();!(z=N.n()).done;)L=Ty(z.value,2),F=L[0],G=L[1],D.set(F,G)}catch(t){N.e(t)}finally{N.f()}return t.abrupt("return",this.readSliceData(n,D));case 74:case"end":return t.stop()}}),t,this,[[9,28,31,34],[44,56,59,62]])}))),function(t,e){return n.apply(this,arguments)})},{key:"fetchBlocks",value:function(t){var n=this;this.blockIdsToFetch.size>0&&function(){for(var e=n.groupBlocks(n.blockIdsToFetch),r=n.source.fetch(e,t),i=function(i){var o,s=Ey(e[i].blockIds);try{var a=function(){var e=o.value,s=Iy(regeneratorRuntime.mark((function o(){var s,a,u,c,f,h;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,r;case 3:return o.t0=i,s=o.sent[o.t0],a=e*n.blockSize,u=a-s.offset,c=Math.min(u+n.blockSize,s.data.byteLength),f=s.data.slice(u,c),h=new Uy(a,f.byteLength,f),n.blockCache.set(e,h),o.abrupt("return",h);case 14:throw o.prev=14,o.t1=o.catch(0),"AbortError"===o.t1.name&&(o.t1.signal=t),o.t1;case 18:return o.prev=18,n.blockRequests.delete(e),o.finish(18);case 21:case"end":return o.stop()}}),o,null,[[0,14,18,21]])})))();n.blockRequests.set(e,s)};for(s.s();!(o=s.n()).done;)a()}catch(t){s.e(t)}finally{s.f()}},o=0;o0&&(l=f),v=c.top-r<0?c.length-h:r-c.offset-h;var d=new Uint8Array(c.data,h,v);a.set(d,l)}return s}))}}]),r}(iy);function $y(t,n,e,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(r,i)}function Vy(t){return function(){var n=this,e=arguments;return new Promise((function(r,i){var o=t.apply(n,e);function s(t){$y(o,r,i,s,a,"next",t)}function a(t){$y(o,r,i,s,a,"throw",t)}s(void 0)}))}}function Zy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Wy(t,n){for(var e=0;e=200&&this.status<=299}},{key:"status",get:function(){throw new Error("not implemented")}},{key:"getHeader",value:function(t){throw new Error("not implemented")}},{key:"getData",value:(n=Vy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("not implemented");case 1:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}(),Xy=function(){function t(n){Zy(this,t),this.url=n}var n;return Hy(t,[{key:"request",value:(n=Vy(regeneratorRuntime.mark((function t(){var n,e=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw(n=e.length>0&&void 0!==e[0]?e[0]:{}).headers,n.credentials,n.signal,new Error("request is not implemented");case 2:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})}]),t}();function Yy(t){return(Yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jy(t,n,e,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(r,i)}function Qy(t){return function(){var n=this,e=arguments;return new Promise((function(r,i){var o=t.apply(n,e);function s(t){Jy(o,r,i,s,a,"next",t)}function a(t){Jy(o,r,i,s,a,"throw",t)}s(void 0)}))}}function tm(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function nm(t,n){for(var e=0;e0&&void 0!==s[0]?s[0]:{},e=n.headers,r=n.credentials,i=n.signal,t.next=3,fetch(this.url,{headers:e,credentials:r,signal:i});case 3:return o=t.sent,t.abrupt("return",new um(o));case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Xy);function fm(t){return(fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hm(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,i,o=[],s=!0,a=!1;try{for(e=e.call(t);!(s=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==e.return||e.return()}finally{if(a)throw i}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return lm(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return lm(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lm(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==o[0]?o[0]:{},e=n.headers,r=n.signal,t.next=3,this.constructRequest(e,r);case 3:return i=t.sent,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Xy),Mm=e(1555),jm=e.n(Mm),Om=e(2913),Tm=e.n(Om),Em=e(8419),Am=e.n(Em);function Cm(t){return(Cm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rm(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Im(t){for(var n=1;n0&&void 0!==o[0]?o[0]:{},e=n.headers,r=n.signal,t.next=3,this.constructRequest(e,r);case 3:return i=t.sent,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),r}(Xy);function Wm(t){return(Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Hm=["headers","credentials","maxRanges","allowFullFile"],Km=["headers","maxRanges","allowFullFile"],Xm=["headers","maxRanges","allowFullFile"],Ym=["forceXHR"];function Jm(t,n){if(null==t)return{};var e,r,i=function(t,n){if(null==t)return{};var e,r,i={},o=Object.keys(t);for(r=0;r=0||(i[e]=t[e]);return i}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}function Qm(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function tb(t){for(var n=1;n=n.length)){t.next=4;break}return t.abrupt("return",this.fetchSlices(n,e));case 4:this.maxRanges>0&&n.length;case 5:return t.abrupt("return",Promise.all(n.map((function(t){return r.fetchSlice(t,e)}))));case 6:case"end":return t.stop()}}),t,this)}))),function(t,n){return s.apply(this,arguments)})},{key:"fetchSlices",value:(o=rb(regeneratorRuntime.mark((function t(n,e){var r,i,o,s,a,u,c,f,h,l,v,d,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.client.request({headers:tb(tb({},this.headers),{},{Range:"bytes=".concat(n.map((function(t){var n=t.offset,e=t.length;return"".concat(n,"-").concat(n+e)})).join(","))}),signal:e});case 2:if((r=t.sent).ok){t.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==r.status){t.next=32;break}if(y=r.getHeader("content-type"),m=void 0,m=$p(y.split(";").map((function(t){return t.trim()}))),i={type:m[0],params:Yp(m.slice(1).map((function(t){return t.split("=")})))},o=i.params,"multipart/byteranges"!==i.type){t.next=18;break}return t.t0=ty,t.next=13,r.getData();case 13:return t.t1=t.sent,t.t2=o.boundary,s=(0,t.t0)(t.t1,t.t2),this._fileSize=s[0].fileSize||null,t.abrupt("return",s);case 18:return t.next=20,r.getData();case 20:if(a=t.sent,u=Qp(r.getHeader("content-range")),c=u.start,f=u.end,h=u.total,this._fileSize=h||null,l=[{data:a,offset:c,length:f-c}],!(n.length>1)){t.next=29;break}return t.next=27,Promise.all(n.slice(1).map((function(t){return p.fetchSlice(t,e)})));case 27:return v=t.sent,t.abrupt("return",l.concat(v));case 29:return t.abrupt("return",l);case 32:if(this.allowFullFile){t.next=34;break}throw new Error("Server responded with full file");case 34:return t.next=36,r.getData();case 36:return d=t.sent,this._fileSize=d.byteLength,t.abrupt("return",[{data:d,offset:0,length:d.byteLength}]);case 39:case"end":return t.stop()}var y,m}),t,this)}))),function(t,n){return o.apply(this,arguments)})},{key:"fetchSlice",value:(i=rb(regeneratorRuntime.mark((function t(n,e){var r,i,o,s,a,u,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.offset,i=n.length,t.next=3,this.client.request({headers:tb(tb({},this.headers),{},{Range:"bytes=".concat(r,"-").concat(r+i)}),signal:e});case 3:if((o=t.sent).ok){t.next=8;break}throw new Error("Error fetching data.");case 8:if(206!==o.status){t.next=17;break}return t.next=11,o.getData();case 11:return s=t.sent,a=Qp(o.getHeader("content-range")),u=a.total,this._fileSize=u||null,t.abrupt("return",{data:s,offset:r,length:i});case 17:if(this.allowFullFile){t.next=19;break}throw new Error("Server responded with full file");case 19:return t.next=21,o.getData();case 21:return c=t.sent,this._fileSize=c.byteLength,t.abrupt("return",{data:c,offset:0,length:c.byteLength});case 24:case"end":return t.stop()}}),t,this)}))),function(t,n){return i.apply(this,arguments)})},{key:"fileSize",get:function(){return this._fileSize}}])&&ib(n.prototype,e),r&&ib(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(iy);function fb(t,n){var e=n.blockSize,r=n.cacheSize;return null===e?t:new qy(t,e,r)}function hb(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.headers,r=void 0===e?{}:e,i=n.credentials,o=n.maxRanges,s=void 0===o?0:o,a=n.allowFullFile,u=void 0!==a&&a,c=Jm(n,Hm),f=new cm(t,i),h=new cb(f,r,s,u);return fb(h,c)}function lb(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.headers,r=void 0===e?{}:e,i=n.maxRanges,o=void 0===i?0:i,s=n.allowFullFile,a=void 0!==s&&s,u=Jm(n,Km),c=new Sm(t),f=new cb(c,r,o,a);return fb(f,u)}function vb(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.headers,r=void 0===e?{}:e,i=n.maxRanges,o=void 0===i?0:i,s=n.allowFullFile,a=void 0!==s&&s,u=Jm(n,Xm),c=new Zm(t),f=new cb(c,r,o,a);return fb(f,u)}function db(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=n.forceXHR,r=void 0!==e&&e,i=Jm(n,Ym);return"function"!=typeof fetch||r?"undefined"!=typeof XMLHttpRequest?lb(t,i):vb(t,i):hb(t,i)}function pb(t){return(pb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yb(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function mb(t){for(var n=1;nt.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==G[0]?G[0]:{},e=n.window,r=n.width,i=n.height,o=n.resX,s=n.resY,a=n.bbox,t.next=5,this.getImage();case 5:return u=t.sent,c=u,t.next=9,this.getImageCount();case 9:if(f=t.sent,h=u.getBoundingBox(),!e||!a){t.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!r&&!i){t.next=24;break}if(e&&(l=u.getOrigin(),v=wb(l,2),d=v[0],p=v[1],y=u.getResolution(),m=wb(y,2),b=m[0],w=m[1],a=[d+e[0]*b,p+e[1]*w,d+e[2]*b,p+e[3]*w]),g=a||h,!r){t.next=20;break}if(!o){t.next=19;break}throw new Error("Both width and resX passed");case 19:o=(g[2]-g[0])/r;case 20:if(!i){t.next=24;break}if(!s){t.next=23;break}throw new Error("Both width and resY passed");case 23:s=(g[3]-g[1])/i;case 24:if(!o&&!s){t.next=48;break}x=[],k=0;case 27:if(!(kE||s&&s>A)){t.next=45;break}return t.abrupt("break",48);case 45:++O,t.next=38;break;case 48:return C=e,a&&(R=u.getOrigin(),I=wb(R,2),P=I[0],D=I[1],N=c.getResolution(u),z=wb(N,2),L=z[0],F=z[1],C=[Math.round((a[0]-P)/L),Math.round((a[1]-D)/F),Math.round((a[2]-P)/L),Math.round((a[3]-D)/F)],C=[Math.min(C[0],C[2]),Math.min(C[1],C[3]),Math.max(C[0],C[2]),Math.max(C[1],C[3])]),t.abrupt("return",c.readRasters(mb(mb({},n),{},{window:C})));case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),t}(),Gb=function(t){_b(c,t);var n,e,r,i,o,s,a,u=Sb(c);function c(t,n,e,r){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return Ib(this,c),(i=u.call(this)).source=t,i.littleEndian=n,i.bigTiff=e,i.firstIFDOffset=r,i.cache=o.cache||!1,i.ifdRequests=[],i.ghostValues=null,i}return Rb(c,[{key:"getSlice",value:(a=kb(regeneratorRuntime.mark((function t(n,e){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.bigTiff?4048:1024,t.t0=qp,t.next=4,this.source.fetch([{offset:n,length:void 0!==e?e:r}]);case 4:return t.t1=t.sent[0],t.t2=n,t.t3=this.littleEndian,t.t4=this.bigTiff,t.abrupt("return",new t.t0(t.t1,t.t2,t.t3,t.t4));case 9:case"end":return t.stop()}}),t,this)}))),function(t,n){return a.apply(this,arguments)})},{key:"parseFileDirectoryAt",value:(s=kb(regeneratorRuntime.mark((function t(n){var e,r,i,o,s,a,u,c,f,h,l,v,d,p,y,m,b,w,g,x;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.bigTiff?20:12,r=this.bigTiff?8:2,t.next=4,this.getSlice(n);case 4:if(i=t.sent,o=this.bigTiff?i.readUint64(n):i.readUint16(n),s=o*e+(this.bigTiff?16:6),i.covers(n,s)){t.next=11;break}return t.next=10,this.getSlice(n,s);case 10:i=t.sent;case 11:a={},u=n+(this.bigTiff?8:2),c=0;case 14:if(!(c0&&void 0!==r[0]?r[0]:0,t.next=3,this.requestIFD(n);case 3:return e=t.sent,t.abrupt("return",new Fp(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getImageCount",value:(r=kb(regeneratorRuntime.mark((function t(){var n,e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,e=!0;case 2:if(!e){t.next=18;break}return t.prev=3,t.next=6,this.requestIFD(n);case 6:++n,t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(3),!(t.t0 instanceof Lb)){t.next=15;break}e=!1,t.next=16;break;case 15:throw t.t0;case 16:t.next=2;break;case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(){return r.apply(this,arguments)})},{key:"getGhostValues",value:(e=kb(regeneratorRuntime.mark((function t(){var n,e,r,i,o,s,a,u,c=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.bigTiff?16:8,!this.ghostValues){t.next=3;break}return t.abrupt("return",this.ghostValues);case 3:return r=(e="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,t.next=7,this.getSlice(n,r);case 7:if(i=t.sent,e!==Nb(i,cp.sf.ASCII,e.length,n)){t.next=19;break}if(o=Nb(i,cp.sf.ASCII,r,n),s=o.split("\n")[0],!((a=Number(s.split("=")[1].split(" ")[0])+s.length)>r)){t.next=16;break}return t.next=15,this.getSlice(n,a);case 15:i=t.sent;case 16:u=Nb(i,cp.sf.ASCII,a,n),this.ghostValues={},u.split("\n").filter((function(t){return t.length>0})).map((function(t){return t.split("=")})).forEach((function(t){var n=wb(t,2),e=n[0],r=n[1];c.ghostValues[e]=r}));case 19:return t.abrupt("return",this.ghostValues);case 20:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:(n=kb(regeneratorRuntime.mark((function t(n,e,r){var i,o,s,a,u,f,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.fetch([{offset:0,length:1024}],r);case 2:if(i=t.sent[0],o=new Up(i),18761!==(s=o.getUint16(0,0))){t.next=9;break}a=!0,t.next=14;break;case 9:if(19789!==s){t.next=13;break}a=!1,t.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(u=o.getUint16(2,a))){t.next=19;break}f=!1,t.next=27;break;case 19:if(43!==u){t.next=26;break}if(f=!0,8===o.getUint16(4,a)){t.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:t.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return h=f?o.getUint64(8,a):o.getUint32(4,a),t.abrupt("return",new c(n,a,f,h,e));case 29:case"end":return t.stop()}}),t)}))),function(t,e,r){return n.apply(this,arguments)})}]),c}(Fb),Ub=function(t){_b(o,t);var n,e,r,i=Sb(o);function o(t,n){var e;return Ib(this,o),(e=i.call(this)).mainFile=t,e.overviewFiles=n,e.imageFiles=[t].concat(n),e.fileDirectoriesPerFile=null,e.fileDirectoriesPerFileParsing=null,e.imageCount=null,e}return Rb(o,[{key:"parseFileDirectoriesPerFile",value:(r=kb(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((function(t){return t.parseFileDirectoryAt(t.firstIFDOffset)}))),t.next=3,Promise.all(n);case 3:return this.fileDirectoriesPerFile=t.sent,t.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getImage",value:(e=kb(regeneratorRuntime.mark((function t(){var n,e,r,i,o,s,a,u=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:0,t.next=3,this.getImageCount();case 3:return t.next=5,this.parseFileDirectoriesPerFile();case 5:e=0,r=0,i=0;case 8:if(!(i1&&void 0!==i[1]?i[1]:{},r=i.length>2?i[2]:void 0,t.abrupt("return",Gb.fromSource(db(n,e),r));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function qb(){return(qb=kb(regeneratorRuntime.mark((function t(n){var e,r,i,o,s,a=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>1&&void 0!==a[1]?a[1]:[],r=a.length>2&&void 0!==a[2]?a[2]:{},i=a.length>3?a[3]:void 0,t.next=5,Gb.fromSource(db(n,r),i);case 5:return o=t.sent,t.next=8,Promise.all(e.map((function(t){return Gb.fromSource(db(t,r))})));case 8:return s=t.sent,t.abrupt("return",new Ub(o,s));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var $b=e(769),Vb=($b.registerSerializer,$b.spawn),Zb=($b.BlobWorker,$b.DefaultSerializer,$b.Pool),Wb=($b.Thread,$b.Transfer),Hb=$b.Worker;function Kb(t,n,e,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(r,i)}function Xb(t){return function(){var n=this,e=arguments;return new Promise((function(r,i){var o=t.apply(n,e);function s(t){Kb(o,r,i,s,a,"next",t)}function a(t){Kb(o,r,i,s,a,"throw",t)}s(void 0)}))}}function Yb(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Jb(t,n){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:Qb,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Hb("./decoder.worker.js");Yb(this,t),this.pool=Zb((function(){return Vb(e)}),n)}var n,e,r,i;return n=t,(e=[{key:"decode",value:(i=Xb(regeneratorRuntime.mark((function t(n,e){var r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){r.pool.queue(function(){var r=Xb(regeneratorRuntime.mark((function r(o){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o(n,Wb(e));case 3:s=r.sent,t(s),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),i(r.t0);case 10:case"end":return r.stop()}}),r,null,[[0,7]])})));return function(t){return r.apply(this,arguments)}}())})));case 1:case"end":return t.stop()}}),t)}))),function(t,n){return i.apply(this,arguments)})},{key:"destroy",value:function(){this.pool.terminate(!0)}}])&&Jb(n.prototype,e),r&&Jb(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();var nw,ew=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),rw="STATISTICS_MAXIMUM",iw="STATISTICS_MINIMUM";function ow(){return nw||(nw=new tw(void 0,function(){var t='function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function asyncGeneratorStep(e,t,r,n,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){asyncGeneratorStep(i,n,a,o,s,"next",e)}function s(e){asyncGeneratorStep(i,n,a,o,s,"throw",e)}o(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),f=n.call(o,"finallyLoc");if(l&&f){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(runtime);var worker={},isObservable=function(e){return!!e&&("symbol"===_typeof(Symbol.observable)&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},common$1={},serializers={};function extendSerializer(e,t){var r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:function(e){return t.deserialize(e,r)},serialize:function(e){return t.serialize(e,n)}}}Object.defineProperty(serializers,"__esModule",{value:!0}),serializers.DefaultSerializer=serializers.extendSerializer=void 0,serializers.extendSerializer=extendSerializer;var DefaultErrorSerializer={deserialize:function(e){return Object.assign(Error(e.message),{name:e.name,stack:e.stack})},serialize:function(e){return{__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack}}},isSerializedError=function(e){return e&&"object"===_typeof(e)&&"__error_marker"in e&&"$$error"===e.__error_marker};serializers.DefaultSerializer={deserialize:function(e){return isSerializedError(e)?DefaultErrorSerializer.deserialize(e):e},serialize:function(e){return e instanceof Error?DefaultErrorSerializer.serialize(e):e}},Object.defineProperty(common$1,"__esModule",{value:!0}),common$1.serialize=common$1.deserialize=common$1.registerSerializer=void 0;var serializers_1=serializers,registeredSerializer=serializers_1.DefaultSerializer;function registerSerializer(e){registeredSerializer=serializers_1.extendSerializer(registeredSerializer,e)}function deserialize(e){return registeredSerializer.deserialize(e)}function serialize(e){return registeredSerializer.serialize(e)}common$1.registerSerializer=registerSerializer,common$1.deserialize=deserialize,common$1.serialize=serialize;var transferable={},symbols={};Object.defineProperty(symbols,"__esModule",{value:!0}),symbols.$worker=symbols.$transferable=symbols.$terminate=symbols.$events=symbols.$errors=void 0,symbols.$errors=Symbol("thread.errors"),symbols.$events=Symbol("thread.events"),symbols.$terminate=Symbol("thread.terminate"),symbols.$transferable=Symbol("thread.transferable"),symbols.$worker=Symbol("thread.worker"),Object.defineProperty(transferable,"__esModule",{value:!0}),transferable.Transfer=transferable.isTransferDescriptor=void 0;var symbols_1=symbols;function isTransferable(e){return!(!e||"object"!==_typeof(e))}function isTransferDescriptor(e){return e&&"object"===_typeof(e)&&e[symbols_1.$transferable]}function Transfer$1(e,t){var r;if(!t){if(!isTransferable(e))throw Error();t=[e]}return _defineProperty(r={},symbols_1.$transferable,!0),_defineProperty(r,"send",e),_defineProperty(r,"transferables",t),r}transferable.isTransferDescriptor=isTransferDescriptor,transferable.Transfer=Transfer$1;var messages$1={},exports,MasterMessageType,WorkerMessageType;exports=messages$1,Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerMessageType=exports.MasterMessageType=void 0,(MasterMessageType=exports.MasterMessageType||(exports.MasterMessageType={})).cancel="cancel",MasterMessageType.run="run",(WorkerMessageType=exports.WorkerMessageType||(exports.WorkerMessageType={})).error="error",WorkerMessageType.init="init",WorkerMessageType.result="result",WorkerMessageType.running="running",WorkerMessageType.uncaughtError="uncaughtError";var implementation$1={},implementation_browser={};Object.defineProperty(implementation_browser,"__esModule",{value:!0});var isWorkerRuntime$2=function(){var e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},postMessageToMaster$2=function(e,t){self.postMessage(e,t)},subscribeToMasterMessages$2=function(e){var t=function(t){e(t.data)};return self.addEventListener("message",t),function(){self.removeEventListener("message",t)}};implementation_browser.default={isWorkerRuntime:isWorkerRuntime$2,postMessageToMaster:postMessageToMaster$2,subscribeToMasterMessages:subscribeToMasterMessages$2};var implementation_tinyWorker={};Object.defineProperty(implementation_tinyWorker,"__esModule",{value:!0}),"undefined"==typeof self&&(commonjsGlobal.self=commonjsGlobal);var isWorkerRuntime$1=function(){return!("undefined"==typeof self||!self.postMessage)},postMessageToMaster$1=function(e){self.postMessage(e)},muxingHandlerSetUp=!1,messageHandlers=new Set,subscribeToMasterMessages$1=function(e){muxingHandlerSetUp||(self.addEventListener("message",(function(e){messageHandlers.forEach((function(t){return t(e.data)}))})),muxingHandlerSetUp=!0),messageHandlers.add(e);return function(){return messageHandlers.delete(e)}};implementation_tinyWorker.default={isWorkerRuntime:isWorkerRuntime$1,postMessageToMaster:postMessageToMaster$1,subscribeToMasterMessages:subscribeToMasterMessages$1};var implementation_worker_threads={},worker_threads={},implementation;function selectImplementation(){return"function"==typeof __non_webpack_require__?__non_webpack_require__("worker_threads"):eval("require")("worker_threads")}function getImplementation(){return implementation||(implementation=selectImplementation()),implementation}Object.defineProperty(worker_threads,"__esModule",{value:!0}),worker_threads.default=getImplementation;var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(implementation_worker_threads,"__esModule",{value:!0});var worker_threads_1=__importDefault$1(worker_threads);function assertMessagePort(e){if(!e)throw Error("Invariant violation: MessagePort to parent is not available.");return e}var isWorkerRuntime=function(){return!worker_threads_1.default().isMainThread},postMessageToMaster=function(e,t){assertMessagePort(worker_threads_1.default().parentPort).postMessage(e,t)},subscribeToMasterMessages=function(e){var t=worker_threads_1.default().parentPort;if(!t)throw Error("Invariant violation: MessagePort to parent is not available.");var r=function(t){e(t)};return assertMessagePort(t).on("message",r),function(){assertMessagePort(t).off("message",r)}};function testImplementation(){worker_threads_1.default()}implementation_worker_threads.default={isWorkerRuntime:isWorkerRuntime,postMessageToMaster:postMessageToMaster,subscribeToMasterMessages:subscribeToMasterMessages,testImplementation:testImplementation};var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(implementation$1,"__esModule",{value:!0});var implementation_browser_1=__importDefault(implementation_browser),implementation_tiny_worker_1=__importDefault(implementation_tinyWorker),implementation_worker_threads_1=__importDefault(implementation_worker_threads),runningInNode="undefined"!=typeof process&&"browser"!==process.arch&&"pid"in process;function selectNodeImplementation(){try{return implementation_worker_threads_1.default.testImplementation(),implementation_worker_threads_1.default}catch(e){return implementation_tiny_worker_1.default}}implementation$1.default=runningInNode?selectNodeImplementation():implementation_browser_1.default,function(e){var t=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},r=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.expose=e.isWorkerRuntime=e.Transfer=e.registerSerializer=void 0;var n=r(isObservable),a=common$1,i=transferable,o=messages$1,s=r(implementation$1),l=common$1;Object.defineProperty(e,"registerSerializer",{enumerable:!0,get:function(){return l.registerSerializer}});var f=transferable;Object.defineProperty(e,"Transfer",{enumerable:!0,get:function(){return f.Transfer}}),e.isWorkerRuntime=s.default.isWorkerRuntime;var c=!1,u=new Map,d=function(e){return e&&e.type===o.MasterMessageType.run},h=function(e){return n.default(e)||function(e){return e&&"object"===_typeof(e)&&"function"==typeof e.subscribe}(e)};function p(e){return i.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function m(e,t){var r=p(t),n=r.payload,i=r.transferables,l={type:o.WorkerMessageType.error,uid:e,error:a.serialize(n)};s.default.postMessageToMaster(l,i)}function g(e,t,r){var n=p(r),a=n.payload,i=n.transferables,l={type:o.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:a};s.default.postMessageToMaster(l,i)}function y(e,t){var r={type:o.WorkerMessageType.running,uid:e,resultType:t};s.default.postMessageToMaster(r)}function _(e){try{var t={type:o.WorkerMessageType.uncaughtError,error:a.serialize(e)};s.default.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\\nLatest error:",t,"\\nOriginal error:",e)}}function b(e,r,n){return t(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,i=r.apply(void 0,_toConsumableArray(n)),t.next=7;break;case 4:return t.prev=4,t.t0=t.catch(0),t.abrupt("return",m(e,t.t0));case 7:if(o=h(i)?"observable":"promise",y(e,o),!h(i)){t.next=14;break}s=i.subscribe((function(t){return g(e,!1,a.serialize(t))}),(function(t){m(e,a.serialize(t)),u.delete(e)}),(function(){g(e,!0),u.delete(e)})),u.set(e,s),t.next=24;break;case 14:return t.prev=14,t.next=17,i;case 17:l=t.sent,g(e,!0,a.serialize(l)),t.next=24;break;case 21:t.prev=21,t.t1=t.catch(14),m(e,a.serialize(t.t1));case 24:case"end":return t.stop()}}),t,null,[[0,4],[14,21]])})))}e.expose=function(e){if(!s.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(c)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(c=!0,"function"==typeof e)s.default.subscribeToMasterMessages((function(t){d(t)&&!t.method&&b(t.uid,e,t.args.map(a.deserialize))})),t={type:o.WorkerMessageType.init,exposed:{type:"function"}},s.default.postMessageToMaster(t);else{if("object"!==_typeof(e)||!e)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: ".concat(e));s.default.subscribeToMasterMessages((function(t){d(t)&&t.method&&b(t.uid,e[t.method],t.args.map(a.deserialize))})),function(e){var t={type:o.WorkerMessageType.init,exposed:{type:"module",methods:e}};s.default.postMessageToMaster(t)}(Object.keys(e).filter((function(t){return"function"==typeof e[t]})))}var t;s.default.subscribeToMasterMessages((function(e){if((n=e)&&n.type===o.MasterMessageType.cancel){var t=e.uid,r=u.get(t);r&&(r.unsubscribe(),u.delete(t))}var n}))},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&s.default.isWorkerRuntime()&&(self.addEventListener("error",(function(e){setTimeout((function(){return _(e.error||e)}),250)})),self.addEventListener("unhandledrejection",(function(e){var t=e.reason;t&&"string"==typeof t.message&&setTimeout((function(){return _(t)}),250)}))),"undefined"!=typeof process&&"function"==typeof process.on&&s.default.isWorkerRuntime()&&(process.on("uncaughtException",(function(e){setTimeout((function(){return _(e)}),250)})),process.on("unhandledRejection",(function(e){e&&"string"==typeof e.message&&setTimeout((function(){return _(e)}),250)})))}(worker);var WorkerContext=getDefaultExportFromCjs(worker),expose=WorkerContext.expose;WorkerContext.registerSerializer;var Transfer=WorkerContext.Transfer,registry=new Map;function addDecoder(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return registry.set(e,t)}))}function getDecoder(e){return _getDecoder.apply(this,arguments)}function _getDecoder(){return(_getDecoder=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=registry.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function decode(e,t){return _decode.apply(this,arguments)}function _decode(){return(_decode=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,getDecoder(t);case 2:return n=e.sent,e.next=5,n.decode(t,r);case 5:return a=e.sent,e.abrupt("return",Transfer(a));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function decodeRowAcc(e,t){var r=e.length-t,n=0;do{for(var a=t;a>0;a--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function decodeRowFloatingPoint(e,t,r){for(var n=0,a=e.length,i=a/r;a>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;a-=t}for(var s=e.slice(),l=0;l=e.byteLength);++f){var c=void 0;if(2===t){switch(a[0]){case 8:c=new Uint8Array(e,f*l*r*s,l*r*s);break;case 16:c=new Uint16Array(e,f*l*r*s,l*r*s/2);break;case 32:c=new Uint32Array(e,f*l*r*s,l*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(a[0]," bits per sample."))}decodeRowAcc(c,l)}else 3===t&&decodeRowFloatingPoint(c=new Uint8Array(e,f*l*r*s,l*r*s),l,s)}return e}addDecoder([void 0,1],(function(){return Promise.resolve().then((function(){return raw})).then((function(e){return e.default}))})),addDecoder(5,(function(){return Promise.resolve().then((function(){return lzw})).then((function(e){return e.default}))})),addDecoder(6,(function(){throw new Error("old style JPEG compression is not supported.")})),addDecoder(7,(function(){return Promise.resolve().then((function(){return jpeg})).then((function(e){return e.default}))})),addDecoder([8,32946],(function(){return Promise.resolve().then((function(){return deflate})).then((function(e){return e.default}))})),addDecoder(32773,(function(){return Promise.resolve().then((function(){return packbits})).then((function(e){return e.default}))})),addDecoder(34887,(function(){return Promise.resolve().then((function(){return lerc})).then((function(e){return e.default}))})),expose(decode);var BaseDecoder=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"decode",value:function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a,i,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return i=!t.StripOffsets,o=i?t.TileWidth:t.ImageWidth,s=i?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",applyPredictor(n,a,o,s,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()}]),e}(),RawDecoder=function(e){_inherits(r,BaseDecoder);var t=_createSuper(r);function r(){return _classCallCheck(this,r),t.apply(this,arguments)}return _createClass(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),raw=Object.freeze({__proto__:null,default:RawDecoder}),MIN_BITS=9,CLEAR_CODE=256,EOI_CODE=257,MAX_BYTELENGTH=12;function getByte(e,t,r){var n=t%8,a=Math.floor(t/8),i=8-n,o=t+r-8*(a+1),s=8*(a+2)-(t+r),l=8*(a+2)-t;if(s=Math.max(0,s),a>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),EOI_CODE;var f=e[a]&Math.pow(2,8-n)-1,c=f<<=r-i;if(a+1>>s;c+=u<<=Math.max(0,r-l)}if(o>8&&a+2>>d}return c}function appendReversed(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function decompress(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var a=258,i=MIN_BITS,o=0;function s(){a=258,i=MIN_BITS}function l(e){var t=getByte(e,o,i);return o+=i,t}function f(e,n){return r[a]=n,t[a]=e,++a-1}function c(e){for(var n=[],a=e;4096!==a;a=t[a])n.push(r[a]);return n}var u=[];s();for(var d,h=new Uint8Array(e),p=l(h);p!==EOI_CODE;){if(p===CLEAR_CODE){for(s(),p=l(h);p===CLEAR_CODE;)p=l(h);if(p===EOI_CODE)break;if(p>CLEAR_CODE)throw new Error("corrupted code at scanline ".concat(p));appendReversed(u,c(p)),d=p}else if(p=Math.pow(2,i)&&(i===MAX_BYTELENGTH?d=void 0:i++),p=l(h)}return new Uint8Array(u)}var LZWDecoder=function(e){_inherits(r,BaseDecoder);var t=_createSuper(r);function r(){return _classCallCheck(this,r),t.apply(this,arguments)}return _createClass(r,[{key:"decodeBlock",value:function(e){return decompress(e).buffer}}]),r}(),lzw=Object.freeze({__proto__:null,default:LZWDecoder}),dctZigZag=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),dctCos1=4017,dctSin1=799,dctCos3=3406,dctSin3=2276,dctCos6=1567,dctSin6=3784,dctSqrt2=5793,dctSqrt1d2=2896;function buildHuffmanTable(e,t){for(var r=0,n=[],a=16;a>0&&!e[a-1];)--a;n.push({children:[],index:0});for(var i,o=n[0],s=0;s0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(i={children:[],index:0}),o.children[o.index]=i.children,o=i;r++}s+10)return p--,h>>p&1;if(255===(h=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((h<<8|t).toString(16)))}return p=7,h>>>7}function g(e){for(var t,r=e;null!==(t=m());){if("number"==typeof(r=r[t]))return r;if("object"!==_typeof(r))throw new Error("invalid huffman sequence")}return null}function y(e){for(var t=e,r=0;t>0;){var n=m();if(null===n)return;r=r<<1|n,--t}return r}function _(e){var t=y(e);return t>=1<0)b--;else for(var r=i,n=o;r<=n;){var a=g(e.huffmanTableAC),s=15&a,f=a>>4;if(0===s){if(f<15){b=y(f)+(1<>4,0===u)a<15?(b=y(a)+(1<>4;if(0===o){if(s<15)break;a+=16}else t[dctZigZag[a+=s]]=_(o),a++}};var R,O,C=0;O=1===I?n[0].blocksPerLine*n[0].blocksPerColumn:f*r.mcusPerColumn;for(var P=a||O;C=65488&&R<=65495))break;d+=2}return d-u}function buildComponentData(e,t){var r=[],n=t.blocksPerLine,a=t.blocksPerColumn,i=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function l(e,r,n){var a,i,o,s,l,f,c,u,d,h,p=t.quantizationTable,m=n;for(h=0;h<64;h++)m[h]=e[h]*p[h];for(h=0;h<8;++h){var g=8*h;0!==m[1+g]||0!==m[2+g]||0!==m[3+g]||0!==m[4+g]||0!==m[5+g]||0!==m[6+g]||0!==m[7+g]?(a=dctSqrt2*m[0+g]+128>>8,i=dctSqrt2*m[4+g]+128>>8,o=m[2+g],s=m[6+g],l=dctSqrt1d2*(m[1+g]-m[7+g])+128>>8,u=dctSqrt1d2*(m[1+g]+m[7+g])+128>>8,f=m[3+g]<<4,c=m[5+g]<<4,d=a-i+1>>1,a=a+i+1>>1,i=d,d=o*dctSin6+s*dctCos6+128>>8,o=o*dctCos6-s*dctSin6+128>>8,s=d,d=l-c+1>>1,l=l+c+1>>1,c=d,d=u+f+1>>1,f=u-f+1>>1,u=d,d=a-s+1>>1,a=a+s+1>>1,s=d,d=i-o+1>>1,i=i+o+1>>1,o=d,d=l*dctSin3+u*dctCos3+2048>>12,l=l*dctCos3-u*dctSin3+2048>>12,u=d,d=f*dctSin1+c*dctCos1+2048>>12,f=f*dctCos1-c*dctSin1+2048>>12,c=d,m[0+g]=a+u,m[7+g]=a-u,m[1+g]=i+c,m[6+g]=i-c,m[2+g]=o+f,m[5+g]=o-f,m[3+g]=s+l,m[4+g]=s-l):(d=dctSqrt2*m[0+g]+512>>10,m[0+g]=d,m[1+g]=d,m[2+g]=d,m[3+g]=d,m[4+g]=d,m[5+g]=d,m[6+g]=d,m[7+g]=d)}for(h=0;h<8;++h){var y=h;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(a=dctSqrt2*m[0+y]+2048>>12,i=dctSqrt2*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],l=dctSqrt1d2*(m[8+y]-m[56+y])+2048>>12,u=dctSqrt1d2*(m[8+y]+m[56+y])+2048>>12,f=m[24+y],c=m[40+y],d=a-i+1>>1,a=a+i+1>>1,i=d,d=o*dctSin6+s*dctCos6+2048>>12,o=o*dctCos6-s*dctSin6+2048>>12,s=d,d=l-c+1>>1,l=l+c+1>>1,c=d,d=u+f+1>>1,f=u-f+1>>1,u=d,d=a-s+1>>1,a=a+s+1>>1,s=d,d=i-o+1>>1,i=i+o+1>>1,o=d,d=l*dctSin3+u*dctCos3+2048>>12,l=l*dctCos3-u*dctSin3+2048>>12,u=d,d=f*dctSin1+c*dctCos1+2048>>12,f=f*dctCos1-c*dctSin1+2048>>12,c=d,m[0+y]=a+u,m[56+y]=a-u,m[8+y]=i+c,m[48+y]=i-c,m[16+y]=o+f,m[40+y]=o-f,m[24+y]=s+l,m[32+y]=s-l):(d=dctSqrt2*n[h+0]+8192>>14,m[0+y]=d,m[8+y]=d,m[16+y]=d,m[24+y]=d,m[32+y]=d,m[40+y]=d,m[48+y]=d,m[56+y]=d)}for(h=0;h<64;++h){var _=128+(m[h]+8>>4);r[h]=_<0?0:_>255?255:_}}for(var f=0;f>4==0)for(var u=0;u<64;u++){c[dctZigZag[u]]=e[t++]}else{if(f>>4!=1)throw new Error("DQT: invalid table spec");for(var d=0;d<64;d++){c[dctZigZag[d]]=r()}}this.quantizationTables[15&f]=c}break;case 65472:case 65473:case 65474:r();for(var h={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,g=0;g>4,_=15&e[t+1],b=e[t+2];h.componentsOrder.push(m),h.components[m]={h:y,v:_,quantizationIdx:b},t+=3}n(h),this.frames.push(h);break;case 65476:for(var v=r(),w=2;w>4==0?this.huffmanTablesDC[15&k]=buildHuffmanTable(T,S):this.huffmanTablesAC[15&k]=buildHuffmanTable(T,S)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var A=e[t++],M=[],I=this.frames[0],R=0;R>4],O.huffmanTableAC=this.huffmanTablesAC[15&C],M.push(O)}var P=e[t++],L=e[t++],U=e[t++],B=decodeScan(e,t,I,M,this.resetInterval,P,L,U>>4,15&U);t+=B;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t=0;)e[t]=0}var MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,DIST_CODE_LEN=512,static_ltree=new Array(2*(L_CODES$1+2));zero$1(static_ltree);var static_dtree=new Array(2*D_CODES$1);zero$1(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);var _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);var base_length=new Array(LENGTH_CODES$1);zero$1(base_length);var base_dist=new Array(D_CODES$1);zero$1(base_dist);var adler32=function(e,t,r,n){for(var a=65535&e|0,i=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(a=a+t[n++]|0)|0}while(--o);a%=65521,i%=65521}return a|i<<16|0},adler32_1=adler32,makeTable=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t},crcTable=new Uint32Array(makeTable()),crc32=function(e,t,r,n){var a=crcTable,i=n+r;e^=-1;for(var o=n;o>>8^a[255&(e^t[o])];return-1^e},crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},_has=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!==_typeof(r))throw new TypeError(r+"must be non-object");for(var n in r)_has(r,n)&&(e[n]=r[n])}}return e},flattenChunks=function(e){for(var t=0,r=0,n=e.length;r=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,a,i,o=e.length,s=0;for(a=0;a>>6,t[i++]=128|63&r):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|63&r):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|63&r);return t},buf2binstring=function(e,t){if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n4)i[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r1?i[n++]=65533:o<65536?i[n++]=o:(o-=65536,i[n++]=55296|o>>10&1023,i[n++]=56320|1023&o)}}}return buf2binstring(i,n)},utf8border=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+_utf8len[e[r]]>t?r:t},strings={string2buf:string2buf,buf2string:buf2string,utf8border:utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream,BAD$1=30,TYPE$1=12,inffast=function(e,t){var r,n,a,i,o,s,l,f,c,u,d,h,p,m,g,y,_,b,v,w,k,T,E,x,S=e.state;r=e.next_in,E=e.input,n=r+(e.avail_in-5),a=e.next_out,x=e.output,i=a-(t-e.avail_out),o=a+(e.avail_out-257),s=S.dmax,l=S.wsize,f=S.whave,c=S.wnext,u=S.window,d=S.hold,h=S.bits,p=S.lencode,m=S.distcode,g=(1<>>=b=_>>>24,h-=b,0===(b=_>>>16&255))x[a++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=p[(65535&_)+(d&(1<>>=b,h-=b),h<15&&(d+=E[r++]<>>=b=_>>>24,h-=b,!(16&(b=_>>>16&255))){if(0==(64&b)){_=m[(65535&_)+(d&(1<s){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(d>>>=b,h-=b,w>(b=a-i)){if((b=w-b)>f&&S.sane){e.msg="invalid distance too far back",S.mode=BAD$1;break e}if(k=0,T=u,0===c){if(k+=l-b,b2;)x[a++]=T[k++],x[a++]=T[k++],x[a++]=T[k++],v-=3;v&&(x[a++]=T[k++],v>1&&(x[a++]=T[k++]))}else{k=a-w;do{x[a++]=x[k++],x[a++]=x[k++],x[a++]=x[k++],v-=3}while(v>2);v&&(x[a++]=x[k++],v>1&&(x[a++]=x[k++]))}break}}break}}while(r>3,d&=(1<<(h-=v<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r=1&&0===I[w];w--);if(k>w&&(k=w),0===w)return a[i++]=20971520,a[i++]=20971520,s.bits=1,0;for(v=1;v0&&(e===CODES$1||1!==w))return-1;for(R[1]=0,_=1;_ENOUGH_LENS$1||e===DISTS$1&&S>ENOUGH_DISTS$1)return 1;for(;;){p=_-E,o[b]h?(m=O[C+o[b]],g=A[M+o[b]]):(m=96,g=0),l=1<<_-E,v=f=1<>E)+(f-=l)]=p<<24|m<<16|g|0}while(0!==f);for(l=1<<_-1;D&l;)l>>=1;if(0!==l?(D&=l-1,D+=l):D=0,b++,0==--I[_]){if(_===w)break;_=t[r+o[b]]}if(_>k&&(D&u)!==c){for(0===E&&(E=k),d+=v,x=1<<(T=_-E);T+EENOUGH_LENS$1||e===DISTS$1&&S>ENOUGH_DISTS$1)return 1;a[c=D&u]=k<<24|T<<16|d-i|0}}return 0!==D&&(a[d+D]=_-E<<24|64<<16|0),s.bits=k,0},inftrees=inflate_table,CODES=0,LENS=1,DISTS=2,Z_FINISH$1=constants$2.Z_FINISH,Z_BLOCK=constants$2.Z_BLOCK,Z_TREES=constants$2.Z_TREES,Z_OK$1=constants$2.Z_OK,Z_STREAM_END$1=constants$2.Z_STREAM_END,Z_NEED_DICT$1=constants$2.Z_NEED_DICT,Z_STREAM_ERROR$1=constants$2.Z_STREAM_ERROR,Z_DATA_ERROR$1=constants$2.Z_DATA_ERROR,Z_MEM_ERROR$1=constants$2.Z_MEM_ERROR,Z_BUF_ERROR=constants$2.Z_BUF_ERROR,Z_DEFLATED=constants$2.Z_DEFLATED,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var inflateResetKeep=function(e){if(!e||!e.state)return Z_STREAM_ERROR$1;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=HEAD,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=function(e){if(!e||!e.state)return Z_STREAM_ERROR$1;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=function(e,t){var r;if(!e||!e.state)return Z_STREAM_ERROR$1;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,inflateReset(e))},inflateInit2=function(e,t){if(!e)return Z_STREAM_ERROR$1;var r=new InflateState;e.state=r,r.window=null;var n=inflateReset2(e,t);return n!==Z_OK$1&&(e.state=null),n},inflateInit=function(e){return inflateInit2(e,DEF_WBITS)},virgin=!0,lenfix,distfix,fixedtables=function(e){if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=function(e,t,r,n){var a,i=e.state;return null===i.window&&(i.wsize=1<=i.wsize?(i.window.set(t.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):((a=i.wsize-i.wnext)>n&&(a=n),i.window.set(t.subarray(r-n,r-n+a),i.wnext),(n-=a)?(i.window.set(t.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,r.check=crc32_1(r.check,D,2,0),f=0,c=0,r.mode=FLAGS;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=BAD;break}if((15&f)!==Z_DEFLATED){e.msg="unknown compression method",r.mode=BAD;break}if(c-=4,k=8+(15&(f>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=BAD;break}r.dmax=1<>8&1),512&r.flags&&(D[0]=255&f,D[1]=f>>>8&255,r.check=crc32_1(r.check,D,2,0)),f=0,c=0,r.mode=TIME;case TIME:for(;c<32;){if(0===s)break e;s--,f+=n[i++]<>>8&255,D[2]=f>>>16&255,D[3]=f>>>24&255,r.check=crc32_1(r.check,D,4,0)),f=0,c=0,r.mode=OS;case OS:for(;c<16;){if(0===s)break e;s--,f+=n[i++]<>8),512&r.flags&&(D[0]=255&f,D[1]=f>>>8&255,r.check=crc32_1(r.check,D,2,0)),f=0,c=0,r.mode=EXLEN;case EXLEN:if(1024&r.flags){for(;c<16;){if(0===s)break e;s--,f+=n[i++]<>>8&255,r.check=crc32_1(r.check,D,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=EXTRA;case EXTRA:if(1024&r.flags&&((h=r.length)>s&&(h=s),h&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+h),k)),512&r.flags&&(r.check=crc32_1(r.check,n,h,i)),s-=h,i+=h,r.length-=h),r.length))break e;r.length=0,r.mode=NAME;case NAME:if(2048&r.flags){if(0===s)break e;h=0;do{k=n[i+h++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=TYPE;break;case DICTID:for(;c<32;){if(0===s)break e;s--,f+=n[i++]<>>=7&c,c-=7&c,r.mode=CHECK;break}for(;c<3;){if(0===s)break e;s--,f+=n[i++]<>>=1)){case 0:r.mode=STORED;break;case 1:if(fixedtables(r),r.mode=LEN_,t===Z_TREES){f>>>=2,c-=2;break e}break;case 2:r.mode=TABLE;break;case 3:e.msg="invalid block type",r.mode=BAD}f>>>=2,c-=2;break;case STORED:for(f>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,f+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=BAD;break}if(r.length=65535&f,f=0,c=0,r.mode=COPY_,t===Z_TREES)break e;case COPY_:r.mode=COPY;case COPY:if(h=r.length){if(h>s&&(h=s),h>l&&(h=l),0===h)break e;a.set(n.subarray(i,i+h),o),s-=h,i+=h,l-=h,o+=h,r.length-=h;break}r.mode=TYPE;break;case TABLE:for(;c<14;){if(0===s)break e;s--,f+=n[i++]<>>=5,c-=5,r.ndist=1+(31&f),f>>>=5,c-=5,r.ncode=4+(15&f),f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=BAD;break}r.have=0,r.mode=LENLENS;case LENLENS:for(;r.have>>=3,c-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},T=inftrees(CODES,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid code lengths set",r.mode=BAD;break}r.have=0,r.mode=CODELENS;case CODELENS:for(;r.have>>16&255,_=65535&S,!((g=S>>>24)<=c);){if(0===s)break e;s--,f+=n[i++]<>>=g,c-=g,r.lens[r.have++]=_;else{if(16===_){for(x=g+2;c>>=g,c-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=BAD;break}k=r.lens[r.have-1],h=3+(3&f),f>>>=2,c-=2}else if(17===_){for(x=g+3;c>>=g)),f>>>=3,c-=3}else{for(x=g+7;c>>=g)),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=BAD;break}for(;h--;)r.lens[r.have++]=k}}if(r.mode===BAD)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=BAD;break}if(r.lenbits=9,E={bits:r.lenbits},T=inftrees(LENS,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid literal/lengths set",r.mode=BAD;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},T=inftrees(DISTS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,T){e.msg="invalid distances set",r.mode=BAD;break}if(r.mode=LEN_,t===Z_TREES)break e;case LEN_:r.mode=LEN;case LEN:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=f,r.bits=c,inffast(e,d),o=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===TYPE&&(r.back=-1);break}for(r.back=0;y=(S=r.lencode[f&(1<>>16&255,_=65535&S,!((g=S>>>24)<=c);){if(0===s)break e;s--,f+=n[i++]<>b)])>>>16&255,_=65535&S,!(b+(g=S>>>24)<=c);){if(0===s)break e;s--,f+=n[i++]<>>=b,c-=b,r.back+=b}if(f>>>=g,c-=g,r.back+=g,r.length=_,0===y){r.mode=LIT;break}if(32&y){r.back=-1,r.mode=TYPE;break}if(64&y){e.msg="invalid literal/length code",r.mode=BAD;break}r.extra=15&y,r.mode=LENEXT;case LENEXT:if(r.extra){for(x=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=DIST;case DIST:for(;y=(S=r.distcode[f&(1<>>16&255,_=65535&S,!((g=S>>>24)<=c);){if(0===s)break e;s--,f+=n[i++]<>b)])>>>16&255,_=65535&S,!(b+(g=S>>>24)<=c);){if(0===s)break e;s--,f+=n[i++]<>>=b,c-=b,r.back+=b}if(f>>>=g,c-=g,r.back+=g,64&y){e.msg="invalid distance code",r.mode=BAD;break}r.offset=_,r.extra=15&y,r.mode=DISTEXT;case DISTEXT:if(r.extra){for(x=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=BAD;break}r.mode=MATCH;case MATCH:if(0===l)break e;if(h=d-l,r.offset>h){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=BAD;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),m=r.window}else m=a,p=o-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do{a[o++]=m[p++]}while(--h);0===r.length&&(r.mode=LEN);break;case LIT:if(0===l)break e;a[o++]=r.length,l--,r.mode=LEN;break;case CHECK:if(r.wrap){for(;c<32;){if(0===s)break e;s--,f|=n[i++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;var r=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(r!==Z_OK)throw new Error(messages[r]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=strings.string2buf(t.dictionary):"[object ArrayBuffer]"===toString.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary))!==Z_OK))throw new Error(messages[r])}function inflate$1(e,t){var r=new Inflate$1(t);if(r.push(e),r.err)throw r.msg||messages[r.err];return r.result}function inflateRaw$1(e,t){return(t=t||{}).raw=!0,inflate$1(e,t)}Inflate$1.prototype.push=function(e,t){var r,n,a,i=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Z_FINISH:Z_NO_FLUSH,"[object ArrayBuffer]"===toString.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(r=inflate_1$2.inflate(i,n))===Z_NEED_DICT&&s&&((r=inflate_1$2.inflateSetDictionary(i,s))===Z_OK?r=inflate_1$2.inflate(i,n):r===Z_DATA_ERROR&&(r=Z_NEED_DICT));i.avail_in>0&&r===Z_STREAM_END&&i.state.wrap>0&&0!==e[i.next_in];)inflate_1$2.inflateReset(i),r=inflate_1$2.inflate(i,n);switch(r){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(r),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||r===Z_STREAM_END))if("string"===this.options.to){var l=strings.utf8border(i.output,i.next_out),f=i.next_out-l,c=strings.buf2string(i.output,l);i.next_out=f,i.avail_out=o-f,f&&i.output.set(i.output.subarray(l,l+f),0),this.onData(c)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(r!==Z_OK||0!==a){if(r===Z_STREAM_END)return r=inflate_1$2.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,constants=constants$2,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1,constants:constants},inflate=inflate_1$1.inflate,inflate_1=inflate,DeflateDecoder=function(e){_inherits(r,BaseDecoder);var t=_createSuper(r);function r(){return _classCallCheck(this,r),t.apply(this,arguments)}return _createClass(r,[{key:"decodeBlock",value:function(e){return inflate_1(new Uint8Array(e)).buffer}}]),r}(),deflate=Object.freeze({__proto__:null,default:DeflateDecoder}),PackbitsDecoder=function(e){_inherits(r,BaseDecoder);var t=_createSuper(r);function r(){return _classCallCheck(this,r),t.apply(this,arguments)}return _createClass(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n>3],S<<=7&D),g=0;g>3]),128&S?(l&&(l[D]=1),m=m>(o=M.encoding<2?T[E++]:x)?o:m,s[D++]=o):(l&&(l[D]=0),s[D++]=n),S<<=1;D+=A}else if(M.encoding<2)for(y=0;y(o=T[E++])?o:m,s[D++]=o;D+=A}else for(m=m>x?x:m,y=0;y0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(i=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),l=2,f=0;do{if(s>0)for(;s--;)o[f++]=i.getUint8(l++);else{var c=i.getUint8(l++);for(s=-s;s--;)o[f++]=c}s=i.getInt16(l,!0),l+=2}while(l0?1:0),p=d+(n.height%d>0?1:0);n.pixels.blocks=new Array(h*p);for(var m=0,g=0;g3)throw"Invalid block encoding ("+v.encoding+")";if(2!==v.encoding){if(0!==w&&2!==w){if(w>>=6,v.offsetType=w,2===w)v.offset=i.getInt8(1),_++;else if(1===w)v.offset=i.getInt16(1,!0),_+=2;else{if(0!==w)throw"Invalid block offset type";v.offset=i.getFloat32(1,!0),_+=4}if(1===v.encoding)if(w=i.getUint8(_),_++,v.bitsPerPixel=63&w,w>>=6,v.numValidPixelsType=w,2===w)v.numValidPixels=i.getUint8(_),_++;else if(1===w)v.numValidPixels=i.getUint16(_,!0),_+=2;else{if(0!==w)throw"Invalid valid pixel count type";v.numValidPixels=i.getUint32(_,!0),_+=4}}var k;if(t+=_,3!==v.encoding)if(0===v.encoding){var T=(n.pixels.numBytes-1)/4;if(T!==Math.floor(T))throw"uncompressed block has invalid length";k=new ArrayBuffer(4*T),new Uint8Array(k).set(new Uint8Array(e,t,4*T));var E=new Float32Array(k);v.rawData=E,t+=4*T}else if(1===v.encoding){var x=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),S=Math.ceil(x/4);k=new ArrayBuffer(4*S),new Uint8Array(k).set(new Uint8Array(e,t,x)),v.stuffedData=new Uint32Array(k),t+=x}}else t++}return n.eofOffset=t,n},i=function(e,t,r,n,a,i,o){var s,l,f,c=(1<=t)l=f>>>d-t&c,d-=t;else{var m=t-d;l=(f&c)<>>(d=32-m)}i[s]=l=r?(f=c>>>m-r&h,m-=r):(f=(c&h)<<(u=r-m)&h,f+=(c=e[p++])>>>(m=32-u)),t[l]=a[f];else for(d=Math.ceil((s-i)/o),l=0;l=r?(f=c>>>m-r&h,m-=r):(f=(c&h)<<(u=r-m)&h,f+=(c=e[p++])>>>(m=32-u)),t[l]=f=t?(d=o>>>u-t&s,u-=t):(d=(o&s)<<(c=t-u)&s,d+=(o=e[l++])>>>(u=32-c)),h[f]=d=r?(f=c>>>m&d,p-=r,m+=r):(f=c>>>m&d,p=32-(u=r-p),f|=((c=e[h++])&(1<=r?(f=c>>>m&d,p-=r,m+=r):(f=c>>>m&d,p=32-(u=r-p),f|=((c=e[h++])&(1<=t?(d=o>>>h&s,u-=t,h+=t):(d=o>>>h&s,u=32-(c=t-u),d|=((o=e[l++])&(1<=r?(i=o>>>c-r&l,c-=r):(i=(o&l)<<(s=r-c)&l,i+=(o=e[f++])>>>(c=32-s)),t[a]=i;return t},u=function(e,t,r,n){var a,i,o,s,l=(1<=r?(i=o>>>u&l,c-=r,u+=r):(i=o>>>u&l,c=32-(s=r-c),i|=((o=e[f++])&(1<=359?359:a;a-=o;do{t+=e[i++]<<8,r+=t+=e[i++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[i]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),a={};if(a.fileIdentifierString=String.fromCharCode.apply(null,n),0!==a.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+a.fileIdentifierString;r+=6;var i,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(a.fileVersion=s,r+=4,s>=3&&(a.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),a.height=o.getUint32(0,!0),a.width=o.getUint32(4,!0),r+=8,s>=4?(a.numDims=o.getUint32(8,!0),r+=4):a.numDims=1,o=new DataView(e,r,40),a.numValidPixel=o.getUint32(0,!0),a.microBlockSize=o.getInt32(4,!0),a.blobSize=o.getInt32(8,!0),a.imageType=o.getInt32(12,!0),a.maxZError=o.getFloat64(16,!0),a.zMin=o.getFloat64(24,!0),a.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=a,t.ptr=r,s>=3&&(i=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-i,a.blobSize-14))!==a.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),a=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(e,t.ptr,n,a),o=this.readSubArray(e,t.ptr+a,n,a);t.ptr+=2*a;var s,l=!0;for(s=0;s0){r=new Uint8Array(Math.ceil(o/8));var c=(l=new DataView(e,a,f.numBytes)).getInt16(0,!0),u=2,d=0,h=0;do{if(c>0)for(;c--;)r[d++]=l.getUint8(u++);else for(h=l.getUint8(u++),c=-c;c--;)r[d++]=h;c=l.getInt16(u,!0),u+=2}while(u>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,f.bitset=r,a+=f.numBytes}return t.ptr=a,t.mask=f,!0},readDataOneSweep:function(e,t,r,n){var a,i=t.ptr,o=t.headerInfo,s=o.numDims,l=o.width*o.height,f=o.imageType,c=o.numValidPixel*d.getDataTypeSize(f)*s,u=t.pixels.resultMask;if(r===Uint8Array)a=new Uint8Array(e,i,c);else{var h=new ArrayBuffer(c);new Uint8Array(h).set(new Uint8Array(e,i,c)),a=new r(h)}if(a.length===l*s)t.pixels.resultPixels=n?d.swapDimensionOrder(a,l,s,r,!0):a;else{t.pixels.resultPixels=new r(l*s);var p=0,m=0,g=0,y=0;if(s>1){if(n){for(m=0;m=o)return!1;var s=new Uint32Array(o-i);d.decodeBits(e,t,s);var l,f,c,u,p=[];for(l=i;l0&&(p[f].second=_<>>32-u,32-v>=u?32===(v+=u)&&(v=0,_=b[++w]):(v+=u-32,_=b[++w],p[f].second|=_>>>32-v));var k=0,T=0,E=new h;for(l=0;l=r?r:k;var x,S,D,A,M,I=[];for(l=i;l0)if(x=[u,f],u<=T)for(S=p[f].second<=0;A--)S>>>A&1?(M.right||(M.right=new h),M=M.right):(M.left||(M.left=new h),M=M.left),0!==A||M.val||(M.val=x[1]);return{decodeLut:I,numBitsLUTQick:T,numBitsLUT:k,tree:E,stuffedData:b,srcPtr:w,bitPos:v}},readHuffman:function(e,t,r,n){var a,i,o,s,l,f,c,u,h,p=t.headerInfo.numDims,m=t.headerInfo.height,g=t.headerInfo.width,y=g*m,_=this.readHuffmanTree(e,t),b=_.decodeLut,v=_.tree,w=_.stuffedData,k=_.srcPtr,T=_.bitPos,E=_.numBitsLUTQick,x=_.numBitsLUT,S=0===t.headerInfo.imageType?128:0,D=t.pixels.resultMask,A=0;T>0&&(k++,T=0);var M,I=w[k],R=1===t.encodeMode,O=new r(y*p),C=O;if(p<2||R){for(M=0;M1&&(C=new r(O.buffer,y*M,y),A=0),t.headerInfo.numValidPixel===g*m)for(u=0,f=0;f>>32-E,32-T>>64-T-E),b[l])i=b[l][1],T+=b[l][0];else for(l=s=I<>>32-x,32-T>>64-T-x),a=v,h=0;h>>x-h-1&1?a.right:a.left).left&&!a.right){i=a.val,T=T+h+1;break}T>=32&&(T-=32,I=w[++k]),o=i-S,R?(o+=c>0?A:f>0?C[u-g]:A,o&=255,C[u]=o,A=o):C[u]=o}else for(u=0,f=0;f>>32-E,32-T>>64-T-E),b[l])i=b[l][1],T+=b[l][0];else for(l=s=I<>>32-x,32-T>>64-T-x),a=v,h=0;h>>x-h-1&1?a.right:a.left).left&&!a.right){i=a.val,T=T+h+1;break}T>=32&&(T-=32,I=w[++k]),o=i-S,R?(c>0&&D[u-1]?o+=A:f>0&&D[u-g]?o+=C[u-g]:o+=A,o&=255,C[u]=o,A=o):C[u]=o}}else for(u=0,f=0;f>>32-E,32-T>>64-T-E),b[l])i=b[l][1],T+=b[l][0];else for(l=s=I<>>32-x,32-T>>64-T-x),a=v,h=0;h>>x-h-1&1?a.right:a.left).left&&!a.right){i=a.val,T=T+h+1;break}T>=32&&(T-=32,I=w[++k]),o=i-S,C[u]=o}t.ptr=t.ptr+4*(k+1)+(T>0?4:0),t.pixels.resultPixels=O,p>1&&!n&&(t.pixels.resultPixels=d.swapDimensionOrder(O,y,p,r))},decodeBits:function(e,t,r,n,a){var i=t.headerInfo,d=i.fileVersion,h=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),g=m.getUint8(0);h++;var y=g>>6,_=0===y?4:3-y,b=(32&g)>0,v=31&g,w=0;if(1===_)w=m.getUint8(h),h++;else if(2===_)w=m.getUint16(h,!0),h+=2;else{if(4!==_)throw"Invalid valid pixel count type";w=m.getUint32(h,!0),h+=4}var k,T,E,x,S,D,A,M,I,R=2*i.maxZError,O=i.numDims>1?i.maxValues[a]:i.zMax;if(b){for(t.counter.lut++,M=m.getUint8(h),h++,x=Math.ceil((M-1)*v/8),S=Math.ceil(x/4),T=new ArrayBuffer(4*S),E=new Uint8Array(T),t.ptr+=h,E.set(new Uint8Array(e,t.ptr,x)),A=new Uint32Array(T),t.ptr+=x,I=0;M-1>>>I;)I++;x=Math.ceil(w*I/8),S=Math.ceil(x/4),T=new ArrayBuffer(4*S),(E=new Uint8Array(T)).set(new Uint8Array(e,t.ptr,x)),k=new Uint32Array(T),t.ptr+=x,D=d>=3?f(A,v,M-1,n,R,O):s(A,v,M-1,n,R,O),d>=3?l(k,r,I,w,D):o(k,r,I,w,D)}else t.counter.bitstuffer++,I=v,t.ptr+=h,I>0&&(x=Math.ceil(w*I/8),S=Math.ceil(x/4),T=new ArrayBuffer(4*S),(E=new Uint8Array(T)).set(new Uint8Array(e,t.ptr,x)),k=new Uint32Array(T),t.ptr+=x,d>=3?null==n?u(k,r,I,w):l(k,r,I,w,!1,n,R,O):null==n?c(k,r,I,w):o(k,r,I,w,!1,n,R,O))},readTiles:function(e,t,r,n){var a=t.headerInfo,i=a.width,o=a.height,s=i*o,l=a.microBlockSize,f=a.imageType,c=d.getDataTypeSize(f),u=Math.ceil(i/l),h=Math.ceil(o/l);t.pixels.numBlocksY=h,t.pixels.numBlocksX=u,t.pixels.ptr=0;var p,m,g,y,_,b,v,w,k,T,E=0,x=0,S=0,D=0,A=0,M=0,I=0,R=0,O=0,C=0,P=0,L=0,U=0,B=0,$=0,N=new r(l*l),z=o%l||l,Z=i%l||l,G=a.numDims,j=t.pixels.resultMask,V=t.pixels.resultPixels,F=a.fileVersion>=5?14:15,K=a.zMax;for(S=0;S1?(T=V,C=S*i*l+D*l,V=new r(t.pixels.resultPixels.buffer,s*w*c,s),K=a.maxValues[w]):T=null,I=e.byteLength-t.ptr,m={},$=0,R=(p=new DataView(e,t.ptr,Math.min(10,I))).getUint8(0),$++,k=a.fileVersion>=5?4&R:0,O=R>>6&255,(R>>2&F)!=(D*l>>3&F))throw"integrity issue";if(k&&0===w)throw"integrity issue";if((_=3&R)>3)throw t.ptr+=$,"Invalid block encoding ("+_+")";if(2!==_)if(0===_){if(k)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=$,L=(L=A*M*c)<(U=e.byteLength-t.ptr)?L:U,g=new ArrayBuffer(L%c==0?L:L+c-L%c),new Uint8Array(g).set(new Uint8Array(e,t.ptr,L)),y=new r(g),B=0,j)for(E=0;E1&&!n&&(t.pixels.resultPixels=d.swapDimensionOrder(t.pixels.resultPixels,s,G,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:d.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,a=e.headerInfo.maxValues,i=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,l=0,f=0,c=e.pixels.resultMask,u=e.pixels.resultPixels;if(c)if(i>1){if(t)for(s=0;s1&&n!==r)if(t)for(s=0;s=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var a=0;switch(r){case 0:a=n.getInt8(t);break;case 1:a=n.getUint8(t);break;case 2:a=n.getInt16(t,!0);break;case 3:a=n.getUint16(t,!0);break;case 4:a=n.getInt32(t,!0);break;case 5:a=n.getUInt32(t,!0);break;case 6:a=n.getFloat32(t,!0);break;case 7:a=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return a},swapDimensionOrder:function(e,t,r,n,a){var i=0,o=0,s=0,l=0,f=e;if(r>1)if(f=new n(t*r),a)for(i=0;i5)throw"unsupported lerc version 2."+o;d.readMask(e,a),i.numValidPixel===i.width*i.height||a.pixels.resultMask||(a.pixels.resultMask=t.maskData);var l=i.width*i.height;a.pixels.resultPixels=new s(l*i.numDims),a.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var f,c=!t.returnPixelInterleavedDims;if(0!==i.numValidPixel)if(i.zMax===i.zMin)d.constructConstantSurface(a,c);else if(o>=4&&d.checkMinMaxRanges(e,a))d.constructConstantSurface(a,c);else{var u=new DataView(e,a.ptr,2),h=u.getUint8(0);if(a.ptr++,h)d.readDataOneSweep(e,a,s,c);else if(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var p=u.getUint8(1);if(a.ptr++,a.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?d.readHuffman(e,a,s,c):d.readTiles(e,a,s,c)}else d.readTiles(e,a,s,c)}a.eofOffset=a.ptr,t.inputOffset?(f=a.headerInfo.blobSize+t.inputOffset-a.ptr,Math.abs(f)>=1&&(a.eofOffset=t.inputOffset+a.headerInfo.blobSize)):(f=a.headerInfo.blobSize-a.ptr,Math.abs(f)>=1&&(a.eofOffset=a.headerInfo.blobSize));var m={width:i.width,height:i.height,pixelData:a.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:a.pixels.resultMask};if(a.pixels.resultMask&&d.isValidPixelValue(i.imageType,r)){var g=a.pixels.resultMask;for(n=0;n1&&(f&&m.push(f),w.fileInfo.mask&&w.fileInfo.mask.numBytes>0&&v++),h++,b.pixels.push(w.pixelData),b.statistics.push({minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue,dimStats:w.dimStats})}if(n>1&&v>1){for(d=b.width*b.height,b.bandMasks=m,(f=new Uint8Array(d)).set(m[0]),c=1;ce*t)throw new Error(r)}function vw(t){return t instanceof Int8Array?-128:t instanceof Int16Array?-32768:t instanceof Int32Array?-2147483648:t instanceof Float32Array?12e-39:0}function dw(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}var pw=function(t){function n(n){var e=t.call(this,{state:hs,tileGrid:null,projection:null,opaque:n.opaque,transition:n.transition,interpolate:!1!==n.interpolate,wrapX:n.wrapX})||this;e.Ju=n.sources;var r=e.Ju.length;e.Qu=new Array(r),e.tc=new Array(r),e.ec,e.rc,e.ic,e.oc=!1!==n.normalize,e.sc=!1,e.V=null,e.ac=n.convertToRGB?"readRGB":"readRasters",e.setKey(e.Ju.map((function(t){return t.url})).join(","));for(var i=e,o=new Array(r),s=0;sy.length&&(u=i.length-y.length);var k=i[i.length-1]/y[y.length-1];h.tc[c]=k;var _=y.map((function(t){return t*k})),S="Resolution mismatch for source "+c+", got ["+_+"] but expected ["+i+"]";lw(i.slice(u,i.length),_,.005,S,h.viewRejector)}else i=y,h.tc[c]=1;r?lw(r.slice(u,r.length),p,0,"Tile size mismatch for source "+c,h.viewRejector):r=p,h.Qu[c]=f.reverse()},h=this,l=0;l=0;--v){var m=cw(y[v]);if(m){this.projection=m;break}}}this.ec=o,this.rc=s,this.ic=a;t:for(l=0;ll||c>l;)f.push([Math.ceil(u/l),Math.ceil(c/l)]),l+=l;break;case ww:for(var v=u,d=c;v>l||d>l;)f.push([Math.ceil(v/l),Math.ceil(d/l)]),v>>=1,d>>=1;break;default:Mt(!1,53)}f.push([1,1]),f.reverse();for(var p=[a],y=[0],m=1,b=f.length;m1,r=e&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],i=e&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=e&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:kw(kw([],n.supports),r),formats:kw(kw([],n.formats),i),qualities:kw(kw([],n.qualities),o)}},Aw[Mw]=function(t){var n=t.getComplianceLevelSupportedFeatures(),e=void 0===t.imageInfo.extraFormats?n.formats:kw(kw([],n.formats),t.imageInfo.extraFormats),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return y(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&y(e,n)?n:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?n.supports:kw(kw([],n.supports),t.imageInfo.extraFeatures),formats:e,qualities:void 0===t.imageInfo.extraQualities?n.qualities:kw(kw([],n.qualities),t.imageInfo.extraQualities),preferredFormat:r}};var Cw=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var n=0;n0&&"string"==typeof this.imageInfo.profile[0]&&Tw.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var e=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(e)?e[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?jw.none.none:jw[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},e=this.getImageApiVersion();if(void 0!==e){var r=void 0===e?void 0:Aw[e](this);if(void 0!==r)return{url:r.url,version:e,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&y(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&y(r.qualities,n.quality)?n.quality:y(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),Rw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function Iw(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Pw=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=r.url||"";o+=o.lastIndexOf("/")===o.length-1||""===o?"":"/";var s=r.version||Sw,a=r.sizes||[],u=r.size;Mt(null!=u&&Array.isArray(u)&&2==u.length&&!isNaN(u[0])&&u[0]>0&&!isNaN(u[1])&&u[1]>0,60);var c,f,h,l=u[0],v=u[1],d=r.tileSize,p=r.tilePixelRatio||1,m=r.format||"jpg",b=r.quality||(r.version==_w?"native":"default"),w=r.resolutions||[],g=r.supports||[],x=r.extent||[0,-v,l,0],k=null!=a&&Array.isArray(a)&&a.length>0,_=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),S=null!=g&&Array.isArray(g)&&(y(g,"regionByPx")||y(g,"regionByPct"))&&(y(g,"sizeByWh")||y(g,"sizeByH")||y(g,"sizeByW")||y(g,"sizeByPct"));if(w.sort((function(t,n){return n-t})),_||S)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(c=d,f=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(c=d[0],f=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(c=d[0],f=d[1]):null==d[0]&&Number.isInteger(d[1])&&(c=d[1],f=d[1])))),void 0!==c&&void 0!==f||(c=Ia,f=Ia),0==w.length)for(var M=h=Math.max(Math.ceil(Math.log(l/c)/Math.LN2),Math.ceil(Math.log(v/f)/Math.LN2));M>=0;M--)w.push(Math.pow(2,M));else{var j=Math.max.apply(Math,w);h=Math.round(Math.log(j)/Math.LN2)}else if(c=l,f=v,w=[],k){a.sort((function(t,n){return t[0]-n[0]})),h=-1;var O=[];for(M=0;M0&&w[w.length-1]==T?O.push(M):(w.push(T),h++)}if(O.length>0)for(M=0;Mh)){var d=t[1],p=t[2],x=w[u];if(!(void 0===d||void 0===p||void 0===x||d<0||Math.ceil(l/x/c)<=d||p<0||Math.ceil(v/x/f)<=p)){if(S||_){var M=d*c*x,j=p*f*x,O=c*x,T=f*x,E=c,A=f;if(M+O>l&&(O=l-M),j+T>v&&(T=v-j),M+c*x>l&&(E=Math.floor((l-M+x-1)/x)),j+f*x>v&&(A=Math.floor((v-j+x-1)/x)),0==M&&O==l&&0==j&&T==v)r="full";else if(!S||y(g,"regionByPx"))r=M+","+j+","+O+","+T;else if(y(g,"regionByPct")){r="pct:"+Iw(M/l*100)+","+Iw(j/v*100)+","+Iw(O/l*100)+","+Iw(T/v*100)}s!=Mw||S&&!y(g,"sizeByWh")?!S||y(g,"sizeByW")?i=E+",":y(g,"sizeByH")?i=","+A:y(g,"sizeByWh")?i=E+","+A:y(g,"sizeByPct")&&(i="pct:"+Iw(100/x)):i=E+","+A}else if(r="full",k){var C=a[u][0],R=a[u][1];i=s==Mw?C==l&&R==v?"max":C+","+R:C==l?"full":C+","}else i=s==Mw?"max":"full";return o+r+"/"+i+"/0/"+b+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,e}return Rw(n,t),n}(vd),Dw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Nw=function(t){function n(n,e,r,i,o,s,a){var u=this,c=n.getExtent(),f=e.getExtent(),h=f?Xn(r,f):r,l=Ff(n,e,Zn(h),i),v=new cl(n,e,h,c,.5*l,i),d=s(v.calculateSourceExtent(),l,o),p=d?lo:mo,y=d?d.getPixelRatio():1;return(u=t.call(this,r,i,y,p)||this).ds=e,u.ys=c,u.Ds=v,u.me=i,u.hc=r,u.lc=d,u.vc=y,u.vu=a,u.Ut=null,u.dc=null,u}return Dw(n,t),n.prototype.disposeInternal=function(){this.state==vo&&this.yc(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.Ut},n.prototype.getProjection=function(){return this.ds},n.prototype.Ns=function(){var t=this.lc.getState();if(t==po){var n=Qn(this.hc)/this.me,e=Kn(this.hc)/this.me;this.Ut=Uf(n,e,this.vc,this.lc.getResolution(),this.ys,this.me,this.hc,this.Ds,[{extent:this.lc.getExtent(),image:this.lc.getImage()}],0,void 0,this.vu)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==lo){this.state=vo,this.changed();var t=this.lc.getState();t==po||t==yo?this.Ns():(this.dc=X(this.lc,D,(function(t){var n=this.lc.getState();n!=po&&n!=yo||(this.yc(),this.Ns())}),this),this.lc.load())}},n.prototype.yc=function(){J(this.dc),this.dc=null},n}(ho),zw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Lw="imageloadstart",Fw="imageloadend",Gw="imageloaderror",Uw=function(t){function n(n,e){var r=t.call(this,n)||this;return r.image=e,r}return zw(n,t),n}(h);function Bw(t,n){t.getImage().src=n}var qw=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(e=t.call(this,{attributions:n.attributions,projection:n.projection,state:n.state,interpolate:r})||this).on,e.once,e.un,e.Oe=void 0!==n.resolutions?n.resolutions:null,e.mc=null,e.bc=0,e}return zw(n,t),n.prototype.getResolutions=function(){return this.Oe},n.prototype.findNearestResolution=function(t){if(this.Oe){var n=m(this.Oe,t,0);t=this.Oe[n]}return t},n.prototype.getImage=function(t,n,e,r){var i=this.getProjection();if(i&&r&&!Mr(i,r)){if(this.mc){if(this.bc==this.getRevision()&&Mr(this.mc.getProjection(),r)&&this.mc.getResolution()==n&&Pn(this.mc.getExtent(),t))return this.mc;this.mc.dispose(),this.mc=null}return this.mc=new Nw(i,r,t,n,e,function(t,n,e){return this.getImageInternal(t,n,e,i)}.bind(this),this.getInterpolate()),this.bc=this.getRevision(),this.mc}return i&&(r=i),this.getImageInternal(t,n,e,r)},n.prototype.getImageInternal=function(t,n,e,i){return r()},n.prototype.handleImageChange=function(t){var n=t.target;switch(n.getState()){case vo:this.loading=!0,this.dispatchEvent(new Uw(Lw,n));break;case po:this.loading=!1,this.dispatchEvent(new Uw(Fw,n));break;case yo:this.loading=!1,this.dispatchEvent(new Uw(Gw,n))}},n}(id),$w=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Vw=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(e=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions})||this).qt=void 0!==r.crossOrigin?r.crossOrigin:null,e.ku=void 0===r.hidpi||r.hidpi,e.Li=r.url,e.zt=void 0!==r.imageLoadFunction?r.imageLoadFunction:Bw,e.wc=r.params||{},e.Dt=null,e.gc=[0,0],e.xc=0,e.kc=void 0!==r.ratio?r.ratio:1.5,e}return $w(n,t),n.prototype.getParams=function(){return this.wc},n.prototype.getImageInternal=function(t,n,e,r){if(void 0===this.Li)return null;n=this.findNearestResolution(n),e=this.ku?e:1;var i=this.Dt;if(i&&this.xc==this.getRevision()&&i.getResolution()==n&&i.getPixelRatio()==e&&jn(i.getExtent(),t))return i;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};E(o,this.wc);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.kc){var u=this.kc*Qn(t)/2,c=this.kc*Kn(t)/2;t[0]=s-u,t[1]=a-c,t[2]=s+u,t[3]=a+c}var f=n/e,h=Math.ceil(Qn(t)/f),l=Math.ceil(Kn(t)/f);t[0]=s-f*h/2,t[2]=s+f*h/2,t[1]=a-f*l/2,t[3]=a+f*l/2,this.gc[0]=h,this.gc[1]=l;var v=this._c(t,this.gc,e,r,o);return this.Dt=new go(t,n,e,v,this.qt,this.zt),this.xc=this.getRevision(),this.Dt.addEventListener(D,this.handleImageChange.bind(this)),this.Dt},n.prototype.getImageLoadFunction=function(){return this.zt},n.prototype._c=function(t,n,e,r,i){var o=r.getCode().split(/:(?=\d+$)/).pop();i.SIZE=n[0]+","+n[1],i.BBOX=t.join(","),i.BBOXSR=o,i.IMAGESR=o,i.DPI=Math.round(90*e);var s=this.Li,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&Mt(!1,50),eh(a,i)},n.prototype.getUrl=function(){return this.Li},n.prototype.setImageLoadFunction=function(t){this.Dt=null,this.zt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Li&&(this.Li=t,this.Dt=null,this.changed())},n.prototype.updateParams=function(t){E(this.wc,t),this.Dt=null,this.changed()},n}(qw),Zw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ww=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(e=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).Sc=r.canvasFunction,e.Ut=null,e.xc=0,e.kc=void 0!==r.ratio?r.ratio:1.5,e}return Zw(n,t),n.prototype.getImageInternal=function(t,n,e,r){n=this.findNearestResolution(n);var i=this.Ut;if(i&&this.xc==this.getRevision()&&i.getResolution()==n&&i.getPixelRatio()==e&&jn(i.getExtent(),t))return i;re(t=t.slice(),this.kc);var o=[Qn(t)/n*e,Kn(t)/n*e],s=this.Sc.call(this,t,n,e,o,r);return s&&(i=new ko(t,n,e,s)),this.Ut=i,this.xc=this.getRevision(),i},n}(qw),Hw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();var Kw=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(e=t.call(this,{interpolate:r,projection:n.projection,resolutions:n.resolutions})||this).qt=void 0!==n.crossOrigin?n.crossOrigin:null,e.Mc=void 0!==n.displayDpi?n.displayDpi:96,e.wc=n.params||{},e.Li=n.url,e.zt=void 0!==n.imageLoadFunction?n.imageLoadFunction:Bw,e.ku=void 0===n.hidpi||n.hidpi,e.dt=void 0!==n.metersPerUnit?n.metersPerUnit:1,e.kc=void 0!==n.ratio?n.ratio:1,e.jc=void 0!==n.useOverlay&&n.useOverlay,e.Dt=null,e.xc=0,e}return Hw(n,t),n.prototype.getParams=function(){return this.wc},n.prototype.getImageInternal=function(t,n,e,r){n=this.findNearestResolution(n),e=this.ku?e:1;var i=this.Dt;if(i&&this.xc==this.getRevision()&&i.getResolution()==n&&i.getPixelRatio()==e&&jn(i.getExtent(),t))return i;1!=this.kc&&re(t=t.slice(),this.kc);var o=[Qn(t)/n*e,Kn(t)/n*e];if(void 0!==this.Li){var s=this.getUrl(this.Li,this.wc,t,o,r);(i=new go(t,n,e,s,this.qt,this.zt)).addEventListener(D,this.handleImageChange.bind(this))}else i=null;return this.Dt=i,this.xc=this.getRevision(),i},n.prototype.getImageLoadFunction=function(){return this.zt},n.prototype.updateParams=function(t){E(this.wc,t),this.changed()},n.prototype.getUrl=function(t,n,e,r,i){var o=function(t,n,e,r){var i=Qn(t),o=Kn(t),s=n[0],a=n[1],u=.0254/r;return a*i>s*o?i*e/(s*u):o*e/(a*u)}(e,r,this.dt,this.Mc),s=Zn(e),a={OPERATION:this.jc?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.Mc,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return E(a,n),eh(t,a)},n.prototype.setImageLoadFunction=function(t){this.Dt=null,this.zt=t,this.changed()},n}(qw),Xw=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Yw=function(t){function n(n){var e=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,i=void 0!==n.imageLoadFunction?n.imageLoadFunction:Bw,o=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(o=n.interpolate),(e=t.call(this,{attributions:n.attributions,interpolate:o,projection:mr(n.projection)})||this).Li=n.url,e.Oc=n.imageExtent,e.Dt=new go(e.Oc,void 0,1,e.Li,r,i),e.gc=n.imageSize?n.imageSize:null,e.Dt.addEventListener(D,e.handleImageChange.bind(e)),e}return Xw(n,t),n.prototype.getImageExtent=function(){return this.Oc},n.prototype.getImageInternal=function(t,n,e,r){return te(t,this.Dt.getExtent())?this.Dt:null},n.prototype.getUrl=function(){return this.Li},n.prototype.handleImageChange=function(n){if(this.Dt.getState()==po){var e=this.Dt.getExtent(),r=this.Dt.getImage(),i=void 0,o=void 0;this.gc?(i=this.gc[0],o=this.gc[1]):(i=r.width,o=r.height);var s=Qn(e),a=Kn(e),u=s/i,c=a/o,f=i,h=o;if(u>c?f=Math.round(s/c):h=Math.round(a/u),f!==i||h!==o){var l=_o(f,h);this.getInterpolate()||E(l,Df);var v=l.canvas;l.drawImage(r,0,0,i,o,0,0,v.width,v.height),this.Dt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(qw),Jw="1.3.0",Qw="carmentaserver",tg="geoserver",ng="mapserver",eg="qgis",rg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ig=[101,101],og=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(e=t.call(this,{attributions:r.attributions,interpolate:i,projection:r.projection,resolutions:r.resolutions})||this).qt=void 0!==r.crossOrigin?r.crossOrigin:null,e.Li=r.url,e.zt=void 0!==r.imageLoadFunction?r.imageLoadFunction:Bw,e.wc=r.params||{},e.Tc=!0,e.Ec(),e.Ac=r.serverType,e.ku=void 0===r.hidpi||r.hidpi,e.Dt=null,e.gc=[0,0],e.xc=0,e.kc=void 0!==r.ratio?r.ratio:1.5,e}return rg(n,t),n.prototype.getFeatureInfoUrl=function(t,n,e,r){if(void 0!==this.Li){var i=mr(e),o=this.getProjection();o&&o!==i&&(n=Ff(o,i,t,n),t=Tr(t,i,o));var s=Hn(t,n,0,ig),a={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.wc.LAYERS};E(a,this.wc,r);var u=ge((t[0]-s[0])/n,4),c=ge((s[3]-t[1])/n,4);return a[this.Tc?"I":"X"]=u,a[this.Tc?"J":"Y"]=c,this._c(s,ig,1,o||i,a)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.Li){var e={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.wc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;e.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;e.SCALE=t*i/28e-5}return E(e,n),eh(this.Li,e)}},n.prototype.getParams=function(){return this.wc},n.prototype.getImageInternal=function(t,n,e,r){if(void 0===this.Li)return null;n=this.findNearestResolution(n),1==e||this.ku&&void 0!==this.Ac||(e=1);var i=n/e,o=Zn(t),s=Hn(o,i,0,[xe(Qn(t)/i,4),xe(Kn(t)/i,4)]),a=Hn(o,i,0,[xe(this.kc*Qn(t)/i,4),xe(this.kc*Kn(t)/i,4)]),u=this.Dt;if(u&&this.xc==this.getRevision()&&u.getResolution()==n&&u.getPixelRatio()==e&&jn(u.getExtent(),s))return u;var c={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};E(c,this.wc),this.gc[0]=we(Qn(a)/i,4),this.gc[1]=we(Kn(a)/i,4);var f=this._c(a,this.gc,e,r,c);return this.Dt=new go(a,n,e,f,this.qt,this.zt),this.xc=this.getRevision(),this.Dt.addEventListener(D,this.handleImageChange.bind(this)),this.Dt},n.prototype.getImageLoadFunction=function(){return this.zt},n.prototype._c=function(t,n,e,r,i){if(Mt(void 0!==this.Li,9),i[this.Tc?"CRS":"SRS"]=r.getCode(),"STYLES"in this.wc||(i.STYLES=""),1!=e)switch(this.Ac){case tg:var o=90*e+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case ng:i.MAP_RESOLUTION=90*e;break;case Qw:case eg:i.DPI=90*e;break;default:Mt(!1,8)}i.WIDTH=n[0],i.HEIGHT=n[1];var s,a=r.getAxisOrientation();return s=this.Tc&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=s.join(","),eh(this.Li,i)},n.prototype.getUrl=function(){return this.Li},n.prototype.setImageLoadFunction=function(t){this.Dt=null,this.zt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Li&&(this.Li=t,this.Dt=null,this.changed())},n.prototype.updateParams=function(t){E(this.wc,t),this.Ec(),this.Dt=null,this.changed()},n.prototype.Ec=function(){var t=this.wc.VERSION||Jw;this.Tc=Je(t,"1.3")>=0},n}(qw),sg={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},ag={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function ug(t,n){for(var e,r,i=0;il.maxTileCol||c.tileRowl.maxTileRow)return}E(c,T);var v=e.replace(/\{(\w+?)\}/g,(function(t,n){return c[n]}));return mf(A,v)}}}}function hg(t){return yf(t.url).then((function(n){return function(t,n){var e,r=n.tileMatrixSetLimits;if("map"===n.dataType)e=ug(n.links,t.mediaType);else{if("vector"!==n.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');e=cg(n.links,t.mediaType,t.supportedMediaTypes)}if(n.tileMatrixSet)return fg(t,n.tileMatrixSet,e,r);var i=n.links.find((function(t){return"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel}));if(!i)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");var o=i.href;return yf(mf(t.url,o)).then((function(n){return fg(t,n,e,r)}))}(t,n)}))}var lg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),vg=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),e=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:hs,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this,hg({url:n.url,projection:e.getProjection(),mediaType:n.mediaType,context:n.context||null}).then(e.Cc.bind(e)).catch(e.Rc.bind(e)),e}return lg(n,t),n.prototype.Cc=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState(ls)},n.prototype.Rc=function(t){console.error(t),this.setState(vs)},n}(vd),dg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),pg=function(t){function n(n){var e=this,r=n.projection||"EPSG:3857",i=n.extent||Xf(r),o=n.tileGrid||Wf({extent:i,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(e=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,interpolate:!0,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:yg,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).Ni=n.format?n.format:null,e.sourceTileCache=new Zc(e.tileCache.highWaterMark),e.Du=null==n.overlaps||n.overlaps,e.tileClass=n.tileClass?n.tileClass:tf,e.Ic={},e}return dg(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],e=this.tileCache;if(0===e.getCount())return n;var r=Bc(e.peekFirstKey())[0],i=this.tileGrid;return e.forEach((function(e){if(e.tileCoord[0]===r&&e.getState()===dt)for(var o=e.getSourceTiles(),s=0,a=o.length;s=.5&&j>=.5){var O=S[4],T=S[5],A=s.opacity,C=void 0;1!==A&&(C=b.globalAlpha,b.globalAlpha=A),b.drawImage(_,0,0,+_.width,+_.height,Math.round(O),Math.round(T),Math.round(M),Math.round(j)),1!==A&&(b.globalAlpha=C)}return this.postRender(b,t),g&&b.restore(),E(b,Nf),m!==w.style.transform&&(w.style.transform=m),this.container},n}(Mg),Tg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Eg=function(t){function n(n){return t.call(this,n)||this}return Tg(n,t),n.prototype.createRenderer=function(){return new Og(this)},n}(_g),Ag="preload",Cg="useInterimTilesOnError",Rg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ig=function(t){function n(n){var e=this,r=n||{},i=E({},r);return delete i.preload,delete i.useInterimTilesOnError,(e=t.call(this,i)||this).on,e.once,e.un,e.setPreload(void 0!==r.preload?r.preload:0),e.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),e}return Rg(n,t),n.prototype.getPreload=function(){return this.get(Ag)},n.prototype.setPreload=function(t){this.set(Ag,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(Cg)},n.prototype.setUseInterimTilesOnError=function(t){this.set(Cg,t)},n}(ys),Pg=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Dg=function(t){function n(n){var e=t.call(this,n)||this;return e.extentChanged=!0,e.Pc=null,e.renderedPixelRatio,e.renderedProjection=null,e.renderedRevision,e.renderedTiles=[],e.Dc=!1,e.tmpExtent=[1/0,1/0,-1/0,-1/0],e.Nc=new Kc(0,0,0,0),e}return Pg(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),e=t.getState(),r=n.getUseInterimTilesOnError();return e==dt||e==yt||e==pt&&!r},n.prototype.getTile=function(t,n,e,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,n,e,i,o);return a.getState()==pt&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Dc=!0):a.setState(dt)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},n.prototype.loadedTileCallback=function(n,e,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,e,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var e=t.layerStatesArray[t.layerIndex],r=t.viewState,i=r.projection,s=r.resolution,a=r.center,u=r.rotation,c=t.pixelRatio,f=this.getLayer(),h=f.getSource(),l=h.getRevision(),v=h.getTileGridForProjection(i),d=v.getZForResolution(s,h.zDirection),y=v.getResolution(d),m=t.extent,b=e.extent&&Nr(e.extent,i);b&&(m=Xn(m,Nr(e.extent,i)));var w=h.getTilePixelRatio(c),g=Math.round(t.size[0]*w),x=Math.round(t.size[1]*w);if(u){var k=Math.round(Math.sqrt(g*g+x*x));g=k,x=k}var _=y*g/2/w,S=y*x/2/w,M=[a[0]-_,a[1]-S,a[0]+_,a[1]+S],j=v.getTileRangeForExtentAndZ(m,d),O={};O[d]={};var T=this.createLoadedTileFinder(h,i,O),A=this.tmpExtent,C=this.Nc;this.Dc=!1;for(var R=j.minX;R<=j.maxX;++R)for(var I=j.minY;I<=j.maxY;++I){var P=this.getTile(d,R,I,t);if(this.isDrawableTile(P)){var D=o(this);if(P.getState()==dt){O[d][P.tileCoord.toString()]=P;var N=P.inTransition(D);this.Dc||!N&&-1!==this.renderedTiles.indexOf(P)||(this.Dc=!0)}if(1===P.getAlpha(D,t.time))continue}var z=v.getTileCoordChildTileRange(P.tileCoord,C,A),L=!1;z&&(L=T(d+1,z)),L||v.forEachTileCoordParentTileRange(P.tileCoord,T,C,A)}var F=y/s;an(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/w,1/w,u,-g/2,-x/2);var G=fn(this.pixelTransform);this.useContainer(n,G,e.opacity,this.getBackground(t));var U=this.context,B=U.canvas;un(this.inversePixelTransform,this.pixelTransform),an(this.tempTransform,g/2,x/2,F,F,0,-g/2,-x/2),B.width!=g||B.height!=x?(B.width=g,B.height=x):this.containerReused||U.clearRect(0,0,g,x),b&&this.clipUnrotated(U,t,b),h.getInterpolate()||E(U,Df),this.preRender(U,t),this.renderedTiles.length=0;var q,$,V,Z=Object.keys(O).map(Number);Z.sort(p),1!==e.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(q=[],$=[]):Z=Z.reverse();for(var W=Z.length-1;W>=0;--W){var H=Z[W],K=h.getTilePixelSize(H,c,i),X=v.getResolution(H)/y,Y=K[0]*X*F,J=K[1]*X*F,Q=v.getTileCoordForCoordAndZ(Yn(M),H),tt=v.getTileCoordExtent(Q),nt=nn(this.tempTransform,[w*(tt[0]-M[0])/y,w*(M[3]-tt[3])/y]),et=w*h.getGutterForProjection(i),rt=O[H];for(var it in rt){var ot=(P=rt[it]).tileCoord,st=Q[1]-ot[1],at=Math.round(nt[0]-(st-1)*Y),ut=Q[2]-ot[2],ct=Math.round(nt[1]-(ut-1)*J),ft=at-(R=Math.round(nt[0]-st*Y)),ht=ct-(I=Math.round(nt[1]-ut*J)),lt=d===H;if(!(N=lt&&1!==P.getAlpha(o(this),t.time)))if(q){U.save(),V=[R,I,R+ft,I,R+ft,I+ht,R,I+ht];for(var vt=0,pt=q.length;vtthis._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(!this._running&&0!==this._queue.length){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,e=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),i=this._workers.length;if(this._running=i,1!==i)for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/i),a=0;aStamen Design, under CC BY 3.0.',gg],ix={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},ox={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},sx=function(t){function n(n){var e=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(e=n.interpolate);var r=n.layer.indexOf("-"),i=-1==r?n.layer:n.layer.slice(0,r),o=ox[i],s=ix[n.layer],a=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+s.extension;return t.call(this,{attributions:rx,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:e,maxZoom:null!=n.maxZoom?n.maxZoom:o.maxZoom,minZoom:null!=n.minZoom?n.minZoom:o.minZoom,opaque:s.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return ex(n,t),n}(bd),ax=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ux=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(i=r.interpolate),(e=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).wc=r.params||{},e.ku=void 0===r.hidpi||r.hidpi,e.Eo=[1/0,1/0,-1/0,-1/0],e.setKey(e.Wc()),e}return ax(n,t),n.prototype.Wc=function(){var t=0,n=[];for(var e in this.wc)n[t++]=e+"-"+this.wc[e];return n.join("/")},n.prototype.getParams=function(){return this.wc},n.prototype._c=function(t,n,e,r,i,o){var s=this.urls;if(s){var a,u=i.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=e.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[ye(qc(t),s.length)];return eh(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this.ku?t:1},n.prototype.updateParams=function(t){E(this.wc,t),this.setKey(this.Wc())},n.prototype.tileUrlFunction=function(t,n,e){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(e)),!(r.getResolutions().length<=t[0])){1==n||this.ku||(n=1);var i=r.getTileCoordExtent(t,this.Eo),o=eu(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=nu(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return E(s,this.wc),this._c(t,o,i,n,e,s)}},n}(vd),cx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),fx=function(t){function n(n){var e=this,r=n||{};return e=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],i=eu(e.tileGrid.getTileSize(r)),o=_o(i[0],i[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,i[0]+.5,i[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,i[0]/2,i[1]/2,i[0]),o.fillText(n,i[0]/2,i[1]/2,i[0]),t.setImage(o.canvas)}})||this}return cx(n,t),n}(bd),hx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),lx=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;if(void 0!==n.interpolate&&(r=n.interpolate),(e=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:mr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:hs,tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Hc=null,e.jo=n.tileSize,n.url)if(n.jsonp)lf(n.url,e.handleTileJSONResponse.bind(e),e.handleTileJSONError.bind(e));else{var i=new XMLHttpRequest;i.addEventListener("load",e.Kc.bind(e)),i.addEventListener("error",e.Xc.bind(e)),i.open("GET",n.url),i.send()}else n.tileJSON?e.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return e}return hx(n,t),n.prototype.Kc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var e=void 0;try{e=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(e)}else this.handleTileJSONError()},n.prototype.Xc=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Hc},n.prototype.handleTileJSONResponse=function(t){var n,e=mr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var i=jr(e,r);n=oe(t.bounds,i)}var o=Xf(r),s=t.minzoom||0,a=Wf({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.jo});if(this.tileGrid=a,this.tileUrlFunction=Jf(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==n?n:o;this.setAttributions((function(n){return te(u,n.extent)?[t.attribution]:null}))}this.Hc=t,this.setState(ls)},n.prototype.handleTileJSONError=function(){this.setState(vs)},n}(vd),vx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),dx=function(t){function n(n){var e=this,r=n||{},i=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(i=r.interpolate);var o=r.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(e=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:!s,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).Ts=void 0!==r.gutter?r.gutter:0,e.wc=o,e.Tc=!0,e.Ac=r.serverType,e.ku=void 0===r.hidpi||r.hidpi,e.Eo=[1/0,1/0,-1/0,-1/0],e.Ec(),e.setKey(e.Wc()),e}return vx(n,t),n.prototype.getFeatureInfoUrl=function(t,n,e,r){var i=mr(e),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(i));var a=s.getZForResolution(n,this.zDirection),u=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=u[0])){var c=s.getResolution(u[0]),f=s.getTileCoordExtent(u,this.Eo),h=eu(s.getTileSize(u[0]),this.tmpSize),l=this.Ts;0!==l&&(h=Qa(h,l,this.tmpSize),f=kn(f,c*l,f)),o&&o!==i&&(c=Ff(o,i,t,c),f=Er(f,i,o),t=Tr(t,i,o));var v={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.wc.LAYERS};E(v,this.wc,r);var d=Math.floor((t[0]-f[0])/c),p=Math.floor((f[3]-t[1])/c);return v[this.Tc?"I":"X"]=d,v[this.Tc?"J":"Y"]=p,this._c(u,h,f,1,o||i,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var e={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.wc.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;e.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;e.SCALE=t*i/28e-5}return E(e,n),eh(this.urls[0],e)}},n.prototype.getGutter=function(){return this.Ts},n.prototype.getParams=function(){return this.wc},n.prototype._c=function(t,n,e,r,i,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Tc?"CRS":"SRS"]=i.getCode(),"STYLES"in this.wc||(o.STYLES=""),1!=r)switch(this.Ac){case tg:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case ng:o.MAP_RESOLUTION=90*r;break;case Qw:case eg:o.DPI=90*r;break;default:Mt(!1,52)}var u,c=i.getAxisOrientation(),f=e;if(this.Tc&&"ne"==c.substr(0,2)){var h=void 0;h=e[0],f[0]=e[1],f[1]=h,h=e[2],f[2]=e[3],f[3]=h}if(o.BBOX=f.join(","),1==s.length)u=s[0];else u=s[ye(qc(t),s.length)];return eh(u,o)}},n.prototype.getTilePixelRatio=function(t){return this.ku&&void 0!==this.Ac?t:1},n.prototype.Wc=function(){var t=0,n=[];for(var e in this.wc)n[t++]=e+"-"+this.wc[e];return n.join("/")},n.prototype.updateParams=function(t){E(this.wc,t),this.Ec(),this.setKey(this.Wc())},n.prototype.Ec=function(){var t=this.wc.VERSION||Jw;this.Tc=Je(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,e){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(e)),!(r.getResolutions().length<=t[0])){1==n||this.ku&&void 0!==this.Ac||(n=1);var i=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.Eo),s=eu(r.getTileSize(t[0]),this.tmpSize),a=this.Ts;0!==a&&(s=Qa(s,a,this.tmpSize),o=kn(o,i*a,o)),1!=n&&(s=nu(s,n,this.tmpSize));var u={SERVICE:"WMS",VERSION:Jw,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return E(u,this.wc),this._c(t,s,o,n,e,u)}},n}(vd),px=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),yx=function(t){function n(n,e,r,i,o,s){var a=t.call(this,n,e)||this;return a.Pt=r,a.st=i,a.Yc=o,a.Jc=null,a.Qc=null,a.q=null,a.tf=s,a}return px(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.Jc||!this.Qc)return null;var n=(t[0]-this.st[0])/(this.st[2]-this.st[0]),e=(t[1]-this.st[1])/(this.st[3]-this.st[1]),r=this.Jc[Math.floor((1-e)*this.Jc.length)];if("string"!=typeof r)return null;var i=r.charCodeAt(Math.floor(n*r.length));i>=93&&i--,i>=35&&i--;var o=null;if((i-=32)in this.Qc){var s=this.Qc[i];o=this.q&&s in this.q?this.q[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,e){this.state==yt&&!0===e?(this.state=lt,Y(this,D,(function(e){n(this.getData(t))}),this),this.nf()):!0===e?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.Pt},n.prototype.Rc=function(){this.state=pt,this.changed()},n.prototype.Bt=function(t){this.Jc=t.grid,this.Qc=t.keys,this.q=t.data,this.state=dt,this.changed()},n.prototype.nf=function(){if(this.state==lt)if(this.state=vt,this.tf)lf(this.Pt,this.Bt.bind(this),this.Rc.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Kc.bind(this)),t.addEventListener("error",this.Xc.bind(this)),t.open("GET",this.Pt),t.send()}},n.prototype.Kc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var e=void 0;try{e=JSON.parse(n.responseText)}catch(t){return void this.Rc()}this.Bt(e)}else this.Rc()},n.prototype.Xc=function(t){this.Rc()},n.prototype.load=function(){this.Yc?this.nf():this.setState(yt)},n}(kt),mx=function(t){function n(n){var e=t.call(this,{projection:mr("EPSG:3857"),state:hs,zDirection:n.zDirection})||this;if(e.Yc=void 0===n.preemptive||n.preemptive,e.ef=th,e.rf=void 0,e.tf=n.jsonp||!1,n.url)if(e.tf)lf(n.url,e.handleTileJSONResponse.bind(e),e.handleTileJSONError.bind(e));else{var r=new XMLHttpRequest;r.addEventListener("load",e.Kc.bind(e)),r.addEventListener("error",e.Xc.bind(e)),r.open("GET",n.url),r.send()}else n.tileJSON?e.handleTileJSONResponse(n.tileJSON):Mt(!1,51);return e}return px(n,t),n.prototype.Kc=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var e=void 0;try{e=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(e)}else this.handleTileJSONError()},n.prototype.Xc=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.rf},n.prototype.forDataAtCoordinateAndResolution=function(t,n,e,r){if(this.tileGrid){var i=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,i);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,e,r)}else!0===r?setTimeout((function(){e(null)}),0):e(null)},n.prototype.handleTileJSONError=function(){this.setState(vs)},n.prototype.handleTileJSONResponse=function(t){var n,e=mr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var i=jr(e,r);n=oe(t.bounds,i)}var o=Xf(r),s=t.minzoom||0,a=Wf({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=a,this.rf=t.template;var u=t.grids;if(u){if(this.ef=Jf(u,a),void 0!==t.attribution){var c=void 0!==n?n:o;this.setAttributions((function(n){return te(c,n.extent)?[t.attribution]:null}))}this.setState(ls)}else this.setState(vs)},n.prototype.getTile=function(t,n,e,r,i){var o=Fc(t,n,e);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,e],a=this.getTileCoordForTileUrlFunction(s,i),u=this.ef(a,r,i),c=new yx(s,void 0!==u?lt:yt,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(s),this.Yc,this.tf);return this.tileCache.set(o,c),c},n.prototype.useTile=function(t,n,e){var r=Fc(t,n,e);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(ud),bx="KVP",wx="REST",gx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),xx=function(t){function n(n){var e=this,r=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(r=n.interpolate);var i=void 0!==n.requestEncoding?n.requestEncoding:bx,o=n.tileGrid,s=n.urls;return void 0===s&&void 0!==n.url&&(s=nh(n.url)),(e=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:o,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,urls:s,wrapX:void 0!==n.wrapX&&n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).if=void 0!==n.version?n.version:"1.0.0",e.Ni=void 0!==n.format?n.format:"image/jpeg",e.af=void 0!==n.dimensions?n.dimensions:{},e.Us=n.layer,e.uf=n.matrixSet,e.K=n.style,e.cf=i,e.setKey(e.ff()),s&&s.length>0&&(e.tileUrlFunction=Qf(s.map(e.createFromWMTSTemplate.bind(e)))),e}return gx(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(Qf(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.af},n.prototype.getFormat=function(){return this.Ni},n.prototype.getLayer=function(){return this.Us},n.prototype.getMatrixSet=function(){return this.uf},n.prototype.getRequestEncoding=function(){return this.cf},n.prototype.getStyle=function(){return this.K},n.prototype.getVersion=function(){return this.if},n.prototype.ff=function(){var t=0,n=[];for(var e in this.af)n[t++]=e+"-"+this.af[e];return n.join("/")},n.prototype.updateDimensions=function(t){E(this.af,t),this.setKey(this.ff())},n.prototype.createFromWMTSTemplate=function(t){var n=this.cf,e={layer:this.Us,style:this.K,tilematrixset:this.uf};n==bx&&E(e,{Service:"WMTS",Request:"GetTile",Version:this.if,Format:this.Ni}),t=n==bx?eh(t,e):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in e?e[n.toLowerCase()]:t}));var r=this.tileGrid,i=this.af;return function(e,o,s){if(e){var a={TileMatrix:r.getMatrixId(e[0]),TileCol:e[1],TileRow:e[2]};E(a,i);var u=t;return u=n==bx?eh(u,a):u.replace(/\{(\w+?)\}/g,(function(t,n){return a[n]}))}}},n}(vd);var kx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),_x="renderOrder",Sx=function(t){function n(n){var e=this,r=n||{},i=E({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(e=t.call(this,i)||this).hf=void 0!==r.declutter&&r.declutter,e.lf=void 0!==r.renderBuffer?r.renderBuffer:100,e.K=null,e.tt=void 0,e.setStyle(r.style),e.vf=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,e.df=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,e}return kx(n,t),n.prototype.getDeclutter=function(){return this.hf},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.lf},n.prototype.getRenderOrder=function(){return this.get(_x)},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.getUpdateWhileAnimating=function(){return this.vf},n.prototype.getUpdateWhileInteracting=function(){return this.df},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Yv(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(_x,t)},n.prototype.setStyle=function(t){this.K=void 0!==t?t:qv,this.tt=null===t?void 0:Uv(this.K),this.changed()},n}(ys);var Mx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),jx=function(t){function n(n,e){var r=this,i=e.uniforms||{},s=[1,0,0,1,0,0];i[Zh]=s,(r=t.call(this,n,{uniforms:i,postProcesses:e.postProcesses})||this).pf=-1,r.yf=new Fh(ih,ah),r.mf=new Fh(ih,ah),r.bf=new Fh(oh,ah),r.Qs=e.vertexShader,r.ta=e.fragmentShader,r.Js,r.wf=!(!e.hitFragmentShader||!e.hitVertexShader),r.gf=e.hitVertexShader,r.xf=e.hitFragmentShader,r.kf;var a=e.attributes?e.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Jh.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:Jh.FLOAT},{name:"a_index",size:1,type:Jh.FLOAT}].concat(a),r.hitDetectionAttributes=[{name:"a_position",size:2,type:Jh.FLOAT},{name:"a_index",size:1,type:Jh.FLOAT},{name:"a_hitColor",size:4,type:Jh.FLOAT},{name:"a_featureUid",size:1,type:Jh.FLOAT}].concat(a),r.customAttributes=e.attributes?e.attributes:[],r.He=[1/0,1/0,-1/0,-1/0],r._f=s,r.Sf=[1,0,0,1,0,0],r.Mf=[1,0,0,1,0,0],r.jf=new Float32Array(0),r.Of=new Float32Array(0),r.Tf,r.Ef=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;rh&&(this.instructions.push([Rx.CUSTOM,h,o,t,e,yi]),this.hitDetectionInstructions.push([Rx.CUSTOM,h,o,t,r||e,yi]));break;case It.POINT:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([Rx.CUSTOM,h,o,t,e]),this.hitDetectionInstructions.push([Rx.CUSTOM,h,o,t,r||e])}this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.Lf=[Rx.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.Lf),this.Ff=[Rx.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.Ff)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var e,r,i=n.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.Gf=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0},n.prototype.createFill=function(t){var n=t.fillStyle,e=[Rx.SET_FILL_STYLE,n];return"string"!=typeof n&&e.push(!0),e},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[Rx.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var e=t.fillStyle;"string"==typeof e&&t.currentFillStyle==e||(void 0!==e&&this.instructions.push(n.call(this,t)),t.currentFillStyle=e)},n.prototype.updateStrokeStyle=function(t,n){var e=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=e||t.currentLineCap!=r||i!=t.currentLineDash&&!x(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=u)&&(void 0!==e&&n.call(this,t),t.currentStrokeStyle=e,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=u)},n.prototype.endGeometry=function(t){this.Lf[2]=this.instructions.length,this.Lf=null,this.Ff[2]=this.hitDetectionInstructions.length,this.Ff=null;var n=[Rx.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Gf&&(this.Gf=_n(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;kn(this.Gf,t,this.Gf)}return this.Gf},n}(bf),Dx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Nx=function(t){function n(n,e,r,i){var o=t.call(this,n,e,r,i)||this;return o.Sa=null,o.Dt=null,o.qf=void 0,o.$f=void 0,o.Vf=void 0,o.Zf=void 0,o.aa=void 0,o.Wf=void 0,o.Hf=void 0,o.ua=void 0,o.Fr=void 0,o.ca=void 0,o.Ba=void 0,o.Kf=void 0,o}return Dx(n,t),n.prototype.drawPoint=function(t,n){if(this.Dt){this.beginGeometry(t,n);var e=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([Rx.DRAW_IMAGE,i,o,this.Dt,this.$f*this.qf,this.Vf*this.qf,Math.ceil(this.Zf*this.qf),this.aa,this.Wf,this.Hf,this.ua,this.Fr,[this.ca[0]*this.pixelRatio/this.qf,this.ca[1]*this.pixelRatio/this.qf],Math.ceil(this.Ba*this.qf),this.Kf]),this.hitDetectionInstructions.push([Rx.DRAW_IMAGE,i,o,this.Sa,this.$f,this.Vf,this.Zf,this.aa,this.Wf,this.Hf,this.ua,this.Fr,this.ca,this.Ba,this.Kf]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.Dt){this.beginGeometry(t,n);var e=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([Rx.DRAW_IMAGE,i,o,this.Dt,this.$f*this.qf,this.Vf*this.qf,Math.ceil(this.Zf*this.qf),this.aa,this.Wf,this.Hf,this.ua,this.Fr,[this.ca[0]*this.pixelRatio/this.qf,this.ca[1]*this.pixelRatio/this.qf],Math.ceil(this.Ba*this.qf),this.Kf]),this.hitDetectionInstructions.push([Rx.DRAW_IMAGE,i,o,this.Sa,this.$f,this.Vf,this.Zf,this.aa,this.Wf,this.Hf,this.ua,this.Fr,this.ca,this.Ba,this.Kf]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.$f=void 0,this.Vf=void 0,this.Sa=null,this.Dt=null,this.qf=void 0,this.Zf=void 0,this.ca=void 0,this.aa=void 0,this.Wf=void 0,this.Hf=void 0,this.ua=void 0,this.Fr=void 0,this.Ba=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var e=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.qf=t.getPixelRatio(this.pixelRatio),this.$f=e[0],this.Vf=e[1],this.Sa=i,this.Dt=o,this.Zf=r[1],this.aa=t.getOpacity(),this.Wf=s[0]*this.qf,this.Hf=s[1]*this.qf,this.ua=t.getRotateWithView(),this.Fr=t.getRotation(),this.ca=t.getScaleArray(),this.Ba=r[0],this.Kf=n},n}(Px),zx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Lx=function(t){function n(n,e,r,i){return t.call(this,n,e,r,i)||this}return zx(n,t),n.prototype.Xf=function(t,n,e,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,e,r,!1,!1),s=[Rx.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),e},n.prototype.drawLineString=function(t,n){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([Rx.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,Ds,0],Ax);var o=t.getFlatCoordinates(),s=t.getStride();this.Xf(o,0,o.length,s),this.hitDetectionInstructions.push(Ex),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([Rx.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],Ax);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),u=0,c=0,f=o.length;ct&&(m>y&&(y=m,d=b,p=o),m=0,b=o-i)),s=a,f=l,h=v),u=w,c=g}return(m+=a)>y?[b,o]:[d,p]}var Bx=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),qx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},$x=function(t){function n(n,e,r,i){var o=t.call(this,n,e,r,i)||this;return o.Qf=null,o.io="",o.oo=0,o.so=0,o.ao=void 0,o.uo=0,o.fo=null,o.fillStates={},o.ho=null,o.strokeStates={},o.lo={},o.textStates={},o.th="",o.nh="",o.eh="",o.Kf=void 0,o}return Bx(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var e=this.fo,r=this.ho,i=this.lo;if(""!==this.io&&i&&(e||r)){var o=this.coordinates,s=o.length,a=t.getType(),u=null,c=t.getStride();if(i.placement!==Hv||a!=It.LINE_STRING&&a!=It.MULTI_LINE_STRING&&a!=It.POLYGON&&a!=It.MULTI_POLYGON){var f=i.overflow?null:[];switch(a){case It.POINT:case It.MULTI_POINT:u=t.getFlatCoordinates();break;case It.LINE_STRING:u=t.getFlatMidpoint();break;case It.CIRCLE:u=t.getCenter();break;case It.MULTI_LINE_STRING:u=t.getFlatMidpoints(),c=2;break;case It.POLYGON:u=t.getFlatInteriorPoint(),i.overflow||f.push(u[2]/this.resolution),c=3;break;case It.MULTI_POLYGON:var h=t.getFlatInteriorPoints();u=[];for(k=0,_=h.length;k<_;k+=3)i.overflow||f.push(h[k+2]/this.resolution),u.push(h[k],h[k+1]);if(0===u.length)return;c=2}if((A=this.appendFlatPointCoordinates(u,c))===s)return;if(f&&(A-s)/2!=u.length/c){var l=s/2;f=f.filter((function(t,n){var e=o[2*(l+n)]===u[n*c]&&o[2*(l+n)+1]===u[n*c+1];return e||--l,e}))}this.rh(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,n);var v=i.padding;if(v!=Us&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],p=i.padding[1],y=i.padding[2],m=i.padding[3];i.scale[0]<0&&(p=-p,m=-m),i.scale[1]<0&&(d=-d,y=-y),v=[d,p,y,m]}var b=this.pixelRatio;this.instructions.push([Rx.DRAW_IMAGE,s,A,null,NaN,NaN,NaN,1,0,0,this.ao,this.uo,[1,1],NaN,this.Kf,v==Us?Us:v.map((function(t){return t*b})),!!i.backgroundFill,!!i.backgroundStroke,this.io,this.th,this.eh,this.nh,this.oo,this.so,f]);var w=1/b;this.hitDetectionInstructions.push([Rx.DRAW_IMAGE,s,A,null,NaN,NaN,NaN,1,0,0,this.ao,this.uo,[w,w],NaN,this.Kf,v,!!i.backgroundFill,!!i.backgroundStroke,this.io,this.th,this.eh,this.nh,this.oo,this.so,f]),this.endGeometry(n)}else{if(!te(this.getBufferedMaxExtent(),t.getExtent()))return;var g=void 0;if(u=t.getFlatCoordinates(),a==It.LINE_STRING)g=[u.length];else if(a==It.MULTI_LINE_STRING)g=t.getEnds();else if(a==It.POLYGON)g=t.getEnds().slice(0,1);else if(a==It.MULTI_POLYGON){var x=t.getEndss();g=[];for(var k=0,_=x.length;k<_;++k)g.push(x[k][0])}this.beginGeometry(t,n);for(var S=i.textAlign,M=0,j=void 0,O=0,T=g.length;OT[2]}else M=g>j;var E,A=Math.PI,C=[],R=k+r===n;if(y=0,m=_,l=t[n=k],v=t[n+1],R){b(),E=Math.atan2(v-p,l-d),M&&(E+=E>0?-A:A);var I=(j+g)/2,P=(O+x)/2;return C[0]=[I,P,(S-o)/2,E,i],C}for(var D=0,N=i.length;D0?-A:A),void 0!==E){var L=z-E;if(L+=L>A?-2*A:L<-A?2*A:0,Math.abs(L)>s)return null}E=z;for(var F=D,G=0;Dt?t-u:i,g=o+c>n?n-c:o,x=v[3]+w*h[0]+v[1],k=v[0]+g*h[1]+v[2],_=m-v[3],S=b-v[0];return(d||0!==f)&&(Xx[0]=_,Qx[0]=_,Xx[1]=S,Yx[1]=S,Yx[0]=_+x,Jx[0]=Yx[0],Jx[1]=S+k,Qx[1]=Jx[1]),0!==f?(nn(y=an([1,0,0,1,0,0],e,r,1,1,f,-e,-r),Xx),nn(y,Yx),nn(y,Jx),nn(y,Qx),An(Math.min(Xx[0],Yx[0],Jx[0],Qx[0]),Math.min(Xx[1],Yx[1],Jx[1],Qx[1]),Math.max(Xx[0],Yx[0],Jx[0],Qx[0]),Math.max(Xx[1],Yx[1],Jx[1],Qx[1]),Kx)):An(Math.min(_,_+x),Math.min(S,S+k),Math.max(_,_+x),Math.max(S,S+k),Kx),l&&(m=Math.round(m),b=Math.round(b)),{drawImageX:m,drawImageY:b,drawImageW:w,drawImageH:g,originX:u,originY:c,declutterBox:{minX:Kx[0],minY:Kx[1],maxX:Kx[2],maxY:Kx[3],value:p},canvasTransform:y,scale:h}},t.prototype.bh=function(t,n,e,r,i,o,s){var a=!(!o&&!s),u=r.declutterBox,c=t.canvas,f=s?s[2]*r.scale[0]/2:0;return u.minX-f<=c.width/n&&u.maxX+f>=0&&u.minY-f<=c.height/n&&u.maxY+f>=0&&(a&&this.ph(t,Xx,Yx,Jx,Qx,o,s),ta(t,r.canvasTransform,i,e,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.va=function(t){if(this.fh){var n=nn(this.lh,[0,0]),e=512*this.pixelRatio;t.save(),t.translate(n[0]%e,n[1]%e),t.rotate(this.Fi)}t.fill(),this.fh&&t.restore()},t.prototype.yh=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.wh=function(t,n,e,r){var i=this.textStates[n],o=this.createLabel(t,n,r,e),s=this.strokeStates[e],a=this.pixelRatio,u=ek(t,i.textAlign||Fs),c=qx[i.textBaseline||Gs],f=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:u*(o.width/a-2*i.scale[0])+2*(.5-u)*f,anchorY:c*o.height/a+2*(.5-c)*f}},t.prototype.gh=function(t,n,e,r,i,o,s,a){var u;this.vo&&x(e,this.lh)?u=this.vo:(this.vo||(this.vo=[]),u=Ur(this.coordinates,0,this.coordinates.length,2,e,this.vo),tn(this.lh,e));for(var c,f,h,l,v,d,p,y,m,b,w,g,k,_,S,M,j=0,O=r.length,T=0,E=0,A=0,C=null,R=null,I=this.hh,P=this.Fi,D=Math.round(1e12*Math.atan2(-e[1],e[0]))/1e12,N={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},z=this.instructions!=r||this.overlaps?0:200;jz&&(this.va(t),E=0),A>z&&(t.stroke(),A=0),E||A||(t.beginPath(),l=NaN,v=NaN),++j;break;case Rx.CIRCLE:var F=u[T=L[1]],G=u[T+1],U=u[T+2]-F,B=u[T+3]-G,q=Math.sqrt(U*U+B*B);t.moveTo(F+q,G),t.arc(F,G,q,0,2*Math.PI,!0),++j;break;case Rx.CLOSE_PATH:t.closePath(),++j;break;case Rx.CUSTOM:T=L[1],c=L[2];var $=L[3],V=L[4],Z=6==L.length?L[5]:void 0;N.geometry=$,N.feature=k,j in I||(I[j]=[]);var W=I[j];Z?Z(u,T,c,2,W):(W[0]=u[T],W[1]=u[T+1],W.length=2),V(W,N),++j;break;case Rx.DRAW_IMAGE:T=L[1],c=L[2],y=L[3],f=L[4],h=L[5];var H=L[6],K=L[7],X=L[8],Y=L[9],J=L[10],Q=L[11],tt=L[12],nt=L[13],et=L[14];if(!y&&L.length>=19){m=L[18],b=L[19],w=L[20],g=L[21];var rt=this.wh(m,b,w,g);y=rt.label,L[3]=y;var it=L[22];f=(rt.anchorX-it)*this.pixelRatio,L[4]=f;var ot=L[23];h=(rt.anchorY-ot)*this.pixelRatio,L[5]=h,H=y.height,L[6]=H,nt=y.width,L[13]=nt}var st=void 0;L.length>24&&(st=L[24]);var at=void 0,ut=void 0,ct=void 0;L.length>16?(at=L[15],ut=L[16],ct=L[17]):(at=Us,ut=!1,ct=!1),J&&D?Q+=P:J||D||(Q-=P);for(var ft=0;T0){if(!o||h!==_f&&h!==jf||-1!==o.indexOf(t)){var c=(l[a]-3)/4,v=r-c%s,d=r-(c/s|0),p=i(t,n,v*v+d*d);if(p)return p}f.clearRect(0,0,s,s);break}}var d,y,m,b,w,g=Object.keys(this.xh).map(Number);for(g.sort(p),d=g.length-1;d>=0;--d){var x=g[d].toString();for(m=this.xh[x],y=ik.length-1;y>=0;--y)if(void 0!==(b=m[h=ik[y]])&&(w=b.executeHitDetection(f,a,e,v,c)))return w}},t.prototype.getClipCoords=function(t){var n=this.sh;if(!n)return null;var e=n[0],r=n[1],i=n[2],o=n[3],s=[e,r,e,o,i,o,i,r];return Ur(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return R(this.xh)},t.prototype.execute=function(t,n,e,r,i,o,s){var a=Object.keys(this.xh).map(Number);a.sort(p),this.sh&&(t.save(),this.clip(t,e));var u,c,f,h,l,v,d=o||ik;for(s&&a.reverse(),u=0,c=a.length;ue)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*n+(t+o))+3),i>0&&a.push(4*((t-i)*n+(t+o))+3),o>0&&(a.push(4*((t+i)*n+(t-o))+3),i>0&&a.push(4*((t-i)*n+(t-o))+3))}for(var u=[],c=(i=0,r.length);iv[2];)m=p*++y,c.push(this.getRenderTransform(r,i,o,ck,f,h,m).slice()),d-=p}this.Eh=fk(e,c,this.Ah,u.getStyleFunction(),a,i,o)}n(hk(t,this.Ah,this.Eh))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,e,r,i){var s=this;if(this.zh){var a,u=n.viewState.resolution,c=n.viewState.rotation,f=this.getLayer(),h={},l=function(t,n,e){var s=o(t),a=h[s];if(a){if(!0!==a&&ew[0]&&_[2]>w[2]&&b.push([_[0]-g,_[1],_[2]-g,_[3]])}if(!this.Th&&this.Ch==f&&this.xc==l&&this.Nh==d&&jn(this.Rh,y))return x(this.Pc,m)||(this.Eh=null,this.Pc=m),this.Ph=p,this.replayGroupChanged=!1,!0;this.zh=null,this.Th=!1;var S,M=new Zx(Af(f,h),y,f,h);this.getLayer().getDeclutter()&&(S=new Zx(Af(f,h),y,f,h));var j,O=Rr();if(O){for(var T=0,E=b.length;T0)n([]);else{var m=Yn(h.getTileCoordExtent(r.wrappedTileCoord)),b=[(l[0]-m[0])/f,(m[1]-l[1])/f],w=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),g=r.hitDetectionImageData[s];if(!g&&!this.Oh){var x=eu(h.getTileSize(h.getZForResolution(f))),k=this.Ih;g=fk(x,[this.getRenderTransform(h.getTileCoordCenter(r.wrappedTileCoord),f,0,ck,x[0]*ck,x[1]*ck,0)],w,i.getStyleFunction(),h.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(i).renderedResolution,k),r.hitDetectionImageData[s]=g}n(hk(b,w,g))}}.bind(this))},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.Bh&&t.changed()},n.prototype.jh=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,e=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,i=!(r[Aa]||r[Ca]),s=this.renderedTiles,a=0,u=s.length;a=0;--h)f[h].execute(this.context,1,this.getTileRenderTransform(c,t),t.viewState.rotation,i,void 0,t.declutterTree)}n.globalAlpha=e},n.prototype.getTileRenderTransform=function(t,n){var e=n.pixelRatio,r=n.viewState,i=r.center,o=r.resolution,s=r.rotation,a=n.size,u=Math.round(a[0]*e),c=Math.round(a[1]*e),f=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),h=t.tileCoord,l=f.getTileCoordExtent(t.wrappedTileCoord),v=f.getTileCoordExtent(h,this.tmpExtent)[0]-l[0];return Jt(rn(this.inversePixelTransform.slice(),1/e,1/e),this.getRenderTransform(i,o,s,e,u,c,v))},n.prototype.renderFrame=function(n,e){var r=n.viewHints,i=!(r[Aa]||r[Ca]);t.prototype.renderFrame.call(this,n,e),this.Uh=n.pixelToCoordinateTransform.slice(),this.Ih=n.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),u=this.context,c=u.globalAlpha;u.globalAlpha=s.getOpacity();for(var f=xk[a],h=n.viewState.rotation,l=this.renderedTiles,v=[],d=[],p=l.length-1;p>=0;--p)for(var y=l[p],m=this.getTileRenderTransform(y,n),b=y.executorGroups[o(s)],w=!1,g=0,x=b.length;g1?s:2,x=o||new Array(g);for(p=0;p>1;i0&&y.length>0;)o=y.pop(),f=d.pop(),l=p.pop(),(u=o.toString())in m||(c.push(l[0],l[1]),m[u]=!0),s=y.pop(),h=d.pop(),v=p.pop(),he((i=n(r=t(a=(o+s)/2)))[0],i[1],l[0],l[1],v[0],v[1])this.Il.length;)a=new Tt,this.Il.push(a);var c=r.getFeaturesCollection();c.clear();var f,h,l=0;for(f=0,h=this.hl.length;fMath.PI/2);for(var y=If(t),m=h;m<=l;++m){var b=this.hl.length+this.ll.length,w=void 0,g=void 0,x=void 0,k=void 0;if(this.xl)for(g=0,x=this.xl.length;g=a?(t[0]=s[0],t[2]=s[2]):o=!0);var u=[ue(n[0],this.al,this.il),ue(n[1],this.ul,this.sl)],c=this.pl(u);isNaN(c[1])&&(c[1]=Math.abs(this.tl)>=Math.abs(this.el)?this.tl:this.el);var f,h,l,v,d=ue(c[0],this.rl,this.nl),p=ue(c[1],this.el,this.tl),y=this.fl,m=t;o||(m=[ue(t[0],this.al,this.il),ue(t[1],this.ul,this.sl),ue(t[2],this.al,this.il),ue(t[3],this.ul,this.sl)]);var b=oe(m,this.pl,void 0,8),w=b[3],g=b[2],x=b[1],k=b[0];if(o||(Mn(m,this.ml)&&(k=this.rl,x=this.el),Mn(m,this.bl)&&(g=this.nl,x=this.el),Mn(m,this.wl)&&(k=this.rl,w=this.tl),Mn(m,this.gl)&&(g=this.nl,w=this.tl),w=ue(w,p,this.tl),g=ue(g,d,this.nl),x=ue(x,this.el,p),k=ue(k,this.rl,d)),v=ue(d=Math.floor(d/i)*i,this.rl,this.nl),h=this.Ll(v,x,w,r,t,0),f=0,o)for(;(v-=i)>=k&&f++r[o]&&(i=o,o=1);var s=Math.max(n[1],r[i]),a=Math.min(n[3],r[o]),u=ue(n[1]+Math.abs(n[1]-n[3])*this.Ml,s,a),c=[r[i-1]+(r[o-1]-r[i-1])*(u-r[i])/(r[o]-r[i]),u],f=this.xl[e].geom;return f.setCoordinates(c),f},n.prototype.getMeridians=function(){return this.hl},n.prototype.Ul=function(t,n,e,r,i){var o=Nk(t,n,e,this.de,r),s=this.ll[i];return s?(s.setFlatCoordinates(Et,o),s.changed()):s=new Ck(o,Et),s},n.prototype.ql=function(t,n,e){var r=t.getFlatCoordinates(),i=0,o=r.length-2;r[i]>r[o]&&(i=o,o=0);var s=Math.max(n[0],r[i]),a=Math.min(n[2],r[o]),u=ue(n[0]+Math.abs(n[0]-n[2])*this.jl,s,a),c=[u,r[i+1]+(r[o+1]-r[i+1])*(u-r[i])/(r[o]-r[i])],f=this.kl[e].geom;return f.setCoordinates(c),f},n.prototype.getParallels=function(){return this.ll},n.prototype.Nl=function(t){var n=mr("EPSG:4326"),e=t.getWorldExtent();this.tl=e[3],this.nl=e[2],this.el=e[1],this.rl=e[0];var r=Or(t,n);if(this.rl=Math.abs(this.el)?this.tl:this.el),this.de=t},n}(Ik),Uk=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Bk="blur",qk="gradient",$k="radius",Vk=["#00f","#0ff","#0f0","#ff0","#f00"];var Zk=function(t){function n(n){var e=this,r=n||{},i=E({},r);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(e=t.call(this,i)||this).Vl=null,e.addChangeListener(qk,e.Zl),e.setGradient(r.gradient?r.gradient:Vk),e.setBlur(void 0!==r.blur?r.blur:15),e.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return e.Wl="string"==typeof o?function(t){return t.get(o)}:o,e.setRenderOrder(null),e}return Uk(n,t),n.prototype.getBlur=function(){return this.get(Bk)},n.prototype.getGradient=function(){return this.get(qk)},n.prototype.getRadius=function(){return this.get($k)},n.prototype.Zl=function(){this.Vl=function(t){for(var n=1,e=256,r=_o(n,e),i=r.createLinearGradient(0,0,n,e),o=1/(t.length-1),s=0,a=t.length;s>3)?e.readString():2===t?e.readFloat():3===t?e.readDouble():4===t?e.readVarint64():5===t?e.readVarint():6===t?e.readSVarint():7===t?e.readBoolean():null;n.values.push(r)}}function s_(t,n,e){if(1==t)n.id=e.readVarint();else if(2==t)for(var r=e.readVarint()+e.pos;e.pos>3}s--,1===o||2===o?(a+=t.readSVarint(),u+=t.readSVarint(),1===o&&c>f&&(r.push(c),f=c),e.push(a,u),c+=2):7===o?c>f&&(e.push(e[f],e[f+1]),c+=2):Mt(!1,59)}c>f&&(r.push(c),f=c)},n.prototype.tv=function(t,n,e){var r,i=n.type;if(0===i)return null;var o,s=n.properties;this.Jl?(o=s[this.Jl],delete s[this.Jl]):o=n.id,s[this.Yl]=n.layer.name;var a=[],u=[];this.Ql(t,n,a,u);var c=function(t,n){var e;1===t?e=1===n?It.POINT:It.MULTI_POINT:2===t?e=1===n?It.LINE_STRING:It.MULTI_LINE_STRING:3===t&&(e=It.POLYGON);return e}(i,u.length);if(this.Xl===Ek)(r=new this.Xl(c,a,u,s,o)).transform(e.dataProjection);else{var f=void 0;if(c==It.POLYGON){for(var h=[],l=0,v=0,d=0,p=u.length;d1?new n_(a,Et,h):new Zi(a,Et,u)}else f=c===It.POINT?new Mi(a,Et):c===It.LINE_STRING?new Ck(a,Et):c===It.POLYGON?new Zi(a,Et,u):c===It.MULTI_POINT?new Qk(a,Et):c===It.MULTI_LINE_STRING?new Yk(a,Et,u):null;r=new(0,this.Xl),this.H&&r.setGeometryName(this.H);var m=Hk(f,!1,e);r.setGeometry(m),r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return ef},n.prototype.readFeatures=function(t,n){var e=this.Gc,r=this.adaptOptions(n),i=mr(r.dataProjection);i.setWorldExtent(r.extent),r.dataProjection=i;var o=new e_(t),s=o.readFields(i_,{}),a=[];for(var u in s)if(!e||-1!=e.indexOf(u)){var c=s[u],f=c?[0,0,c.extent,c.extent]:null;i.setExtent(f);for(var h=0,l=c.length;h=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw o}}}}function z_(t,n){if(t){if("string"==typeof t)return L_(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?L_(t,n):void 0}}function L_(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var U_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B_(t){var n={exports:{}};return t(n,n.exports),n.exports}var q_=B_((function(t,n){!function(e){var r=n&&!n.nodeType&&n,i=t&&!t.nodeType&&t,o="object"==F_(U_)&&U_;o.global!==o&&o.window!==o&&o.self!==o||(e=o);var s,a,u=2147483647,c=36,f=/^xn--/,h=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function y(t){throw RangeError(v[t])}function m(t,n){for(var e=t.length,r=[];e--;)r[e]=n(t[e]);return r}function b(t,n){var e=t.split("@"),r="";return e.length>1&&(r=e[0]+"@",t=e[1]),r+m((t=t.replace(l,".")).split("."),n).join(".")}function w(t){for(var n,e,r=[],i=0,o=t.length;i=55296&&n<=56319&&i65535&&(n+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+=p(t)})).join("")}function x(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function k(t,n,e){var r=0;for(t=e?d(t/700):t>>1,t+=d(t/n);t>455;r+=c)t=d(t/35);return d(r+36*t/(t+38))}function _(t){var n,e,r,i,o,s,a,f,h,l,v,p=[],m=t.length,b=0,w=128,x=72;for((e=t.lastIndexOf("-"))<0&&(e=0),r=0;r=128&&y("not-basic"),p.push(t.charCodeAt(r));for(i=e>0?e+1:0;i=m&&y("invalid-input"),((f=(v=t.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||f>d((u-b)/s))&&y("overflow"),b+=f*s,!(f<(h=a<=x?1:a>=x+26?26:a-x));a+=c)s>d(u/(l=c-h))&&y("overflow"),s*=l;x=k(b-o,n=p.length+1,0==o),d(b/n)>u-w&&y("overflow"),w+=d(b/n),b%=n,p.splice(b++,0,w)}return g(p)}function S(t){var n,e,r,i,o,s,a,f,h,l,v,m,b,g,_,S=[];for(m=(t=w(t)).length,n=128,e=0,o=72,s=0;s=n&&vd((u-e)/(b=r+1))&&y("overflow"),e+=(a-n)*b,n=a,s=0;su&&y("overflow"),v==n){for(f=e,h=c;!(f<(l=h<=o?1:h>=o+26?26:h-o));h+=c)_=f-l,g=c-l,S.push(p(x(l+_%g,0))),f=d(_/g);S.push(p(x(f,0))),o=k(e,b,r==i),e=0,++r}++e,++n}return S.join("")}if(s={version:"1.3.2",ucs2:{decode:w,encode:g},decode:_,encode:S,toASCII:function(t){return b(t,(function(t){return h.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return b(t,(function(t){return f.test(t)?_(t.slice(4).toLowerCase()):t}))}},r&&i)if(t.exports==r)i.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else e.punycode=s}(U_)})),$_=function(t){return"string"==typeof t},V_=function(t){return"object"===F_(t)&&null!==t},Z_=function(t){return null===t},W_=function(t){return null==t};function H_(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var K_=function(t,n,e,r){n=n||"&",e=e||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(n);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u=0?(c=v.substr(0,d),f=v.substr(d+1)):(c=v,f=""),h=decodeURIComponent(c),l=decodeURIComponent(f),H_(i,h)?Array.isArray(i[h])?i[h].push(l):i[h]=[i[h],l]:i[h]=l}return i},X_=function(t){switch(F_(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Y_=function(t,n,e,r){return n=n||"&",e=e||"=",null===t&&(t=void 0),"object"===F_(t)?Object.keys(t).map((function(r){var i=encodeURIComponent(X_(r))+e;return Array.isArray(t[r])?t[r].map((function(t){return i+encodeURIComponent(X_(t))})).join(n):i+encodeURIComponent(X_(t[r]))})).join(n):r?encodeURIComponent(X_(r))+e+encodeURIComponent(X_(t)):""},J_=B_((function(t,n){n.decode=n.parse=K_,n.encode=n.stringify=Y_}));function Q_(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var tS=/^([a-z0-9.+-]+:)/i,nS=/:[0-9]*$/,eS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,rS=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),iS=["'"].concat(rS),oS=["%","/","?",";","#"].concat(iS),sS=["/","?","#"],aS=/^[+a-z0-9A-Z_-]{0,63}$/,uS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,cS={javascript:!0,"javascript:":!0},fS={javascript:!0,"javascript:":!0},hS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lS(t,n,e){if(t&&V_(t)&&t instanceof Q_)return t;var r=new Q_;return r.parse(t,n,e),r}Q_.prototype.parse=function(t,n,e){if(!$_(t))throw new TypeError("Parameter 'url' must be a string, not "+F_(t));var r=t.indexOf("?"),i=-1!==r&&r127?g+="x":g+=w[x];if(!g.match(aS)){var _=m.slice(0,d),S=m.slice(d+1),M=w.match(uS);M&&(_.push(M[1]),S.unshift(M[2])),S.length&&(s="/"+S.join(".")+s),this.hostname=_.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=q_.toASCII(this.hostname));var j=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+j,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!cS[c])for(d=0,b=iS.length;d0)&&e.host.split("@"))&&(e.auth=M.shift(),e.host=e.hostname=M.shift());return e.search=t.search,e.query=t.query,Z_(e.pathname)&&Z_(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!w.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var x=w.slice(-1)[0],k=(e.host||t.host||w.length>1)&&("."===x||".."===x)||""===x,_=0,S=w.length;S>=0;S--)"."===(x=w[S])?w.splice(S,1):".."===x?(w.splice(S,1),_++):_&&(w.splice(S,1),_--);if(!m&&!b)for(;_--;_)w.unshift("..");!m||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),k&&"/"!==w.join("/").substr(-1)&&w.push("");var M,j=""===w[0]||w[0]&&"/"===w[0].charAt(0);g&&(e.hostname=e.host=j?"":w.length?w.shift():"",(M=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=M.shift(),e.host=e.hostname=M.shift()));return(m=m||e.host&&w.length)&&!j&&w.unshift(""),w.length?e.pathname=w.join("/"):(e.pathname=null,e.path=null),Z_(e.pathname)&&Z_(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Q_.prototype.parseHost=function(){var t=this.host,n=nS.exec(t);n&&(":"!==(n=n[0])&&(this.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(this.hostname=t)};function vS(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];E_(this,t),this.parent=n,this.bindings={};var r,i=N_(e);try{for(i.s();!(r=i.n()).done;){var o=S_(r.value,2),s=o[0],a=o[1];this.bindings[s]=a}}catch(t){i.e(t)}finally{i.f()}}return T_(t,[{key:"concat",value:function(n){return new t(this,n)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}]),t}(),yS={kind:"null"},mS={kind:"number"},bS={kind:"string"},wS={kind:"boolean"},gS={kind:"color"},xS={kind:"object"},kS={kind:"value"},_S={kind:"collator"},SS={kind:"formatted"},MS={kind:"resolvedImage"};function jS(t,n){return{kind:"array",itemType:t,N:n}}function OS(t){if("array"===t.kind){var n=OS(t.itemType);return"number"==typeof t.N?"array<".concat(n,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(n,">")}return t.kind}var TS=[yS,mS,bS,wS,gS,SS,xS,jS(kS),MS];function ES(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!ES(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind){var e,r=N_(TS);try{for(r.s();!(e=r.n()).done;){if(!ES(e.value,n))return null}}catch(t){r.e(t)}finally{r.f()}}}return"Expected ".concat(OS(t)," but found ").concat(OS(n)," instead.")}function AS(t,n){return n.some((function(n){return n.kind===t.kind}))}function CS(t,n){return n.some((function(n){return"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"===F_(t):n===F_(t)}))}var RS=B_((function(t,n){var e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function s(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function a(t,n,e){return e<0?e+=1:e>1&&(e-=1),6*e<1?t+(n-t)*e*6:2*e<1?n:3*e<2?t+(n-t)*(2/3-e)*6:t}try{n.parseCSSColor=function(t){var n,i=t.replace(/ /g,"").toLowerCase();if(i in e)return e[i].slice();if("#"===i[0])return 4===i.length?(n=parseInt(i.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===i.length&&(n=parseInt(i.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var u=i.indexOf("("),c=i.indexOf(")");if(-1!==u&&c+1===i.length){var f=i.substr(0,u),h=i.substr(u+1,c-(u+1)).split(","),l=1;switch(f){case"rgba":if(4!==h.length)return null;l=s(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),l];case"hsla":if(4!==h.length)return null;l=s(h.pop());case"hsl":if(3!==h.length)return null;var v=(parseFloat(h[0])%360+360)%360/360,d=s(h[1]),p=s(h[2]),y=p<=.5?p*(d+1):p+d-p*d,m=2*p-y;return[r(255*a(m,y,v+1/3)),r(255*a(m,y,v)),r(255*a(m,y,v-1/3)),l];default:return null}}return null}}catch(t){}})),IS=function(){function t(n,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;E_(this,t),this.r=n,this.g=e,this.b=r,this.a=i}return T_(t,[{key:"toString",value:function(){var t=S_(this.toArray(),4),n=t[0],e=t[1],r=t[2],i=t[3];return"rgba(".concat(Math.round(n),",").concat(Math.round(e),",").concat(Math.round(r),",").concat(i,")")}},{key:"toArray",value:function(){var t=this.r,n=this.g,e=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*n/r,255*e/r,r]}}],[{key:"parse",value:function(n){if(n){if(n instanceof t)return n;if("string"==typeof n){var e=RS.parseCSSColor(n);if(e)return new t(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}}}]),t}();IS.black=new IS(0,0,0,1),IS.white=new IS(1,1,1,1),IS.transparent=new IS(0,0,0,0),IS.red=new IS(1,0,0,1),IS.blue=new IS(0,0,1,1);var PS=function(){function t(n,e,r){E_(this,t),this.sensitivity=n?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}return T_(t,[{key:"compare",value:function(t,n){return this.collator.compare(t,n)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}]),t}(),DS=T_((function t(n,e,r,i,o){E_(this,t),this.text=n,this.image=e,this.scale=r,this.fontStack=i,this.textColor=o})),NS=function(){function t(n){E_(this,t),this.sections=n}return T_(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")}},{key:"serialize",value:function(){var t,n=["format"],e=N_(this.sections);try{for(e.s();!(t=e.n()).done;){var r=t.value;if(r.image)n.push(["image",r.image.name]);else{n.push(r.text);var i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),r.textColor&&(i["text-color"]=["rgba"].concat(r.textColor.toArray())),n.push(i)}}}catch(t){e.e(t)}finally{e.f()}return n}}],[{key:"fromString",value:function(n){return new t([new DS(n,null,null,null,null)])}},{key:"factory",value:function(n){return n instanceof t?n:t.fromString(n)}}]),t}(),zS=function(){function t(n){E_(this,t),this.name=n.name,this.available=n.available}return T_(t,[{key:"toString",value:function(){return this.name}},{key:"serialize",value:function(){return["image",this.name]}}],[{key:"fromString",value:function(n){return n?new t({name:n,available:!1}):null}}]),t}();function LS(t,n,e,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof e&&e>=0&&e<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([t,n,e,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[t,n,e,r]:[t,n,e]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function FS(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof IS)return!0;if(t instanceof PS)return!0;if(t instanceof NS)return!0;if(t instanceof zS)return!0;if(Array.isArray(t)){var n,e=N_(t);try{for(e.s();!(n=e.n()).done;){if(!FS(n.value))return!1}}catch(t){e.e(t)}finally{e.f()}return!0}if("object"===F_(t)){for(var r in t)if(!FS(t[r]))return!1;return!0}return!1}function GS(t){if(null===t)return yS;if("string"==typeof t)return bS;if("boolean"==typeof t)return wS;if("number"==typeof t)return mS;if(t instanceof IS)return gS;if(t instanceof PS)return _S;if(t instanceof NS)return SS;if(t instanceof zS)return MS;if(Array.isArray(t)){var n,e,r=t.length,i=N_(t);try{for(i.s();!(e=i.n()).done;){var o=GS(e.value);if(n){if(n===o)continue;n=kS;break}n=o}}catch(t){i.e(t)}finally{i.f()}return jS(n||kS,r)}return xS}function US(t){var n=F_(t);return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof IS||t instanceof NS||t instanceof zS?t.toString():JSON.stringify(t)}var BS=function(){function t(n,e){E_(this,t),this.type=n,this.value=e}return T_(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof IS?["rgba"].concat(this.value.toArray()):this.value instanceof NS?this.value.serialize():this.value}}],[{key:"parse",value:function(n,e){if(2!==n.length)return e.error("'literal' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(!FS(n[1]))return e.error("invalid value");var r=n[1],i=GS(r),o=e.expectedType;return"array"!==i.kind||0!==i.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(i=o),new t(i,r)}}]),t}(),qS=function(){function t(n){E_(this,t),this.name="ExpressionEvaluationError",this.message=n}return T_(t,[{key:"toJSON",value:function(){return this.message}}]),t}(),$S={string:bS,number:mS,boolean:wS,object:xS},VS=function(){function t(n,e){E_(this,t),this.type=n,this.args=e}return T_(t,[{key:"evaluate",value:function(t){for(var n=0;n1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))}}],[{key:"parse",value:function(n,e){if(n.length<2)return e.error("Expected at least one argument.");var r,i=1,o=n[0];if("array"===o){var s,a;if(n.length>2){var u=n[1];if("string"!=typeof u||!(u in $S)||"object"===u)return e.error('The item type argument of "array" must be one of string, number, boolean',1);s=$S[u],i++}else s=kS;if(n.length>3){if(null!==n[2]&&("number"!=typeof n[2]||n[2]<0||n[2]!==Math.floor(n[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=n[2],i++}r=jS(s,a)}else r=$S[o];for(var c=[];i-1),e}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["image",this.input.serialize()]}}],[{key:"parse",value:function(n,e){if(2!==n.length)return e.error("Expected two arguments.");var r=e.parse(n[1],1,bS);return r?new t(r):e.error("No image name provided.")}}]),t}(),HS={"to-boolean":wS,"to-color":gS,"to-number":mS,"to-string":bS},KS=function(){function t(n,e){E_(this,t),this.type=n,this.args=e}return T_(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var n,e,r,i=N_(this.args);try{for(i.s();!(r=i.n()).done;){if(n=r.value.evaluate(t),e=null,n instanceof IS)return n;if("string"==typeof n){var o=t.parseColor(n);if(o)return o}else if(Array.isArray(n)&&!(e=n.length<3||n.length>4?"Invalid rbga value ".concat(JSON.stringify(n),": expected an array containing either three or four numeric values."):LS(n[0],n[1],n[2],n[3])))return new IS(n[0]/255,n[1]/255,n[2]/255,n[3])}}catch(t){i.e(t)}finally{i.f()}throw new qS(e||"Could not parse color from value '".concat("string"==typeof n?n:String(JSON.stringify(n)),"'"))}if("number"===this.type.kind){var s,a=null,u=N_(this.args);try{for(u.s();!(s=u.n()).done;){if(null===(a=s.value.evaluate(t)))return 0;var c=Number(a);if(!isNaN(c))return c}}catch(t){u.e(t)}finally{u.f()}throw new qS("Could not convert ".concat(JSON.stringify(a)," to number."))}return"formatted"===this.type.kind?NS.fromString(US(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?zS.fromString(US(this.args[0].evaluate(t))):US(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new ZS([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new WS(this.args[0]).serialize();var t=["to-".concat(this.type.kind)];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,e){if(n.length<2)return e.error("Expected at least one argument.");var r=n[0];if(("to-boolean"===r||"to-string"===r)&&2!==n.length)return e.error("Expected one argument.");for(var i=HS[r],o=[],s=1;s=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function rM(t,n){var e,r=(180+t[0])/360,i=(e=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*tM),Math.round(i*o*tM)]}function iM(t,n,e){var r=t[0]-n[0],i=t[1]-n[1],o=t[0]-e[0],s=t[1]-e[1];return r*s-o*i==0&&r*o<=0&&i*s<=0}function oM(t,n,e){return n[1]>t[1]!=e[1]>t[1]&&t[0]<(e[0]-n[0])*(t[1]-n[1])/(e[1]-n[1])+n[0]}function sM(t,n){for(var e=!1,r=0,i=n.length;r0&&h<0||f<0&&h>0}function cM(t,n,e){var r,i,o,s,a,u,c,f,h,l=N_(e);try{for(l.s();!(r=l.n()).done;)for(var v=r.value,d=0;de[2]){var i=.5*r,o=t[0]-e[0]>i?-r:e[0]-t[0]>i?r:0;0===o&&(o=t[0]-e[2]>i?-r:e[2]-t[0]>i?r:0),t[0]+=o}nM(n,t)}function pM(t,n,e,r){var i,o=Math.pow(2,r.z)*tM,s=[r.x*tM,r.y*tM],a=[],u=N_(t);try{for(u.s();!(i=u.n()).done;){var c,f=N_(i.value);try{for(f.s();!(c=f.n()).done;){var h=c.value,l=[h.x+s[0],h.y+s[1]];dM(l,n,e,o),a.push(l)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function yM(t,n,e,r){var i,o=Math.pow(2,r.z)*tM,s=[r.x*tM,r.y*tM],a=[],u=N_(t);try{for(u.s();!(i=u.n()).done;){var c,f=i.value,h=[],l=N_(f);try{for(l.s();!(c=l.n()).done;){var v=c.value,d=[v.x+s[0],v.y+s[1]];nM(n,d),h.push(d)}}catch(t){l.e(t)}finally{l.f()}a.push(h)}}catch(t){u.e(t)}finally{u.f()}if(n[2]-n[0]<=o/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(n);var p,y=N_(a);try{for(y.s();!(p=y.n()).done;){var m,b=N_(p.value);try{for(b.s();!(m=b.n()).done;){dM(m.value,n,e,o)}}catch(t){b.e(t)}finally{b.f()}}}catch(t){y.e(t)}finally{y.f()}}return a}var mM=function(){function t(n,e){E_(this,t),this.type=wS,this.geojson=n,this.geometries=e}return T_(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){var e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===n.type){var o=lM(n.coordinates,r,i),s=pM(t.geometry(),e,r,i);if(!eM(e,r))return!1;var a,u=N_(s);try{for(u.s();!(a=u.n()).done;)if(!sM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=vM(n.coordinates,r,i),f=pM(t.geometry(),e,r,i);if(!eM(e,r))return!1;var h,l=N_(f);try{for(l.s();!(h=l.n()).done;)if(!aM(h.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){var e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===n.type){var o=lM(n.coordinates,r,i),s=yM(t.geometry(),e,r,i);if(!eM(e,r))return!1;var a,u=N_(s);try{for(u.s();!(a=u.n()).done;)if(!fM(a.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===n.type){var c=vM(n.coordinates,r,i),f=yM(t.geometry(),e,r,i);if(!eM(e,r))return!1;var h,l=N_(f);try{for(l.s();!(h=l.n()).done;)if(!hM(h.value,c))return!1}catch(t){l.e(t)}finally{l.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(n,e){if(2!==n.length)return e.error("'within' expression requires exactly one argument, but found ".concat(n.length-1," instead."));if(FS(n[1])){var r=n[1];if("FeatureCollection"===r.type)for(var i=0;i=0)return!1;var e=!0;return t.eachChild((function(t){e&&!gM(t,n)&&(e=!1)})),e}var xM=function(){function t(n,e){E_(this,t),this.type=e.type,this.name=n,this.boundExpression=e}return T_(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(n,e){if(2!==n.length||"string"!=typeof n[1])return e.error("'var' expression requires exactly one string literal argument.");var r=n[1];return e.scope.has(r)?new t(r,e.scope.get(r)):e.error('Unknown variable "'.concat(r,'". Make sure "').concat(r,'" has been bound in an enclosing "let" expression before using it.'),1)}}]),t}(),kM=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new pS,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];E_(this,t),this.registry=n,this.path=e,this.key=e.map((function(t){return"[".concat(t,"]")})).join(""),this.scope=i,this.errors=o,this.expectedType=r}return T_(t,[{key:"parse",value:function(t,n,e,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return n?this.concat(n,e,r)._parse(t,i):this._parse(t,i)}},{key:"_parse",value:function(t,n){function e(t,n,e){return"assert"===e?new VS(n,[t]):"coerce"===e?new KS(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(F_(r),' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var i=this.registry[r];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=e(o,s,n.typeAnnotation||"coerce");else o=e(o,s,n.typeAnnotation||"assert")}if(!(o instanceof BS)&&"resolvedImage"!==o.type.kind&&_M(o)){var u=new YS;try{o=new BS(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===F_(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(F_(t)," instead."))}},{key:"concat",value:function(n,e,r){var i="number"==typeof n?this.path.concat(n):this.path,o=r?this.scope.concat(r):this.scope;return new t(this.registry,i,e||null,o,this.errors)}},{key:"error",value:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;rn))throw new qS("Input is not a number.");s=a-1}return 0}var MM=function(){function t(n,e,r){E_(this,t),this.type=n,this.input=e,this.labels=[],this.outputs=[];var i,o=N_(r);try{for(o.s();!(i=o.n()).done;){var s=S_(i.value,2),a=s[0],u=s[1];this.labels.push(a),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return T_(t,[{key:"evaluate",value:function(t){var n=this.labels,e=this.outputs;if(1===n.length)return e[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return e[0].evaluate(t);var i=n.length;return r>=n[i-1]?e[i-1].evaluate(t):e[SM(n,r)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var n,e=N_(this.outputs);try{for(e.s();!(n=e.n()).done;){t(n.value)}}catch(t){e.e(t)}finally{e.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],n=0;n0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t}}],[{key:"parse",value:function(n,e){if(n.length-1<4)return e.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(n[1],1,mS);if(!r)return null;var i=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var s=1;s=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var h=e.parse(u,f,o);if(!h)return null;o=o||h.type,i.push([a,h])}return new t(o,r,i)}}]),t}(),jM=OM;function OM(t,n,e,r){this.cx=3*t,this.bx=3*(e-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=e,this.p2y=r}function TM(t,n,e){return t*(1-e)+n*e}OM.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},OM.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},OM.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},OM.prototype.solveCurveX=function(t,n){var e,r,i,o,s;for(void 0===n&&(n=1e-6),i=t,s=0;s<8;s++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(r=1))return r;for(;eo?e=i:r=i,i=.5*(r-e)+e}return i},OM.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var EM=Object.freeze({__proto__:null,number:TM,color:function(t,n,e){return new IS(TM(t.r,n.r,e),TM(t.g,n.g,e),TM(t.b,n.b,e),TM(t.a,n.a,e))},array:function(t,n,e){return t.map((function(t,r){return TM(t,n[r],e)}))}}),AM=.95047,CM=1.08883,RM=4/29,IM=6/29,PM=3*IM*IM,DM=Math.PI/180,NM=180/Math.PI;function zM(t){return t>.008856451679035631?Math.pow(t,1/3):t/PM+RM}function LM(t){return t>IM?t*t*t:PM*(t-RM)}function FM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function GM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function UM(t){var n=GM(t.r),e=GM(t.g),r=GM(t.b),i=zM((.4124564*n+.3575761*e+.1804375*r)/AM),o=zM((.2126729*n+.7151522*e+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-zM((.0193339*n+.119192*e+.9503041*r)/CM)),alpha:t.a}}function BM(t){var n=(t.l+16)/116,e=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*LM(n),e=AM*LM(e),r=CM*LM(r),new IS(FM(3.2404542*e-1.5371385*n-.4985314*r),FM(-.969266*e+1.8760108*n+.041556*r),FM(.0556434*e-.2040259*n+1.0572252*r),t.alpha)}function qM(t,n,e){var r=n-t;return t+e*(r>180||r<-180?r-360*Math.round(r/360):r)}var $M={forward:UM,reverse:BM,interpolate:function(t,n,e){return{l:TM(t.l,n.l,e),a:TM(t.a,n.a,e),b:TM(t.b,n.b,e),alpha:TM(t.alpha,n.alpha,e)}}},VM={forward:function(t){var n=UM(t),e=n.l,r=n.a,i=n.b,o=Math.atan2(i,r)*NM;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:e,alpha:t.a}},reverse:function(t){var n=t.h*DM,e=t.c;return BM({l:t.l,a:Math.cos(n)*e,b:Math.sin(n)*e,alpha:t.alpha})},interpolate:function(t,n,e){return{h:qM(t.h,n.h,e),c:TM(t.c,n.c,e),l:TM(t.l,n.l,e),alpha:TM(t.alpha,n.alpha,e)}}},ZM=function(){function t(n,e,r,i,o){E_(this,t),this.type=n,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];var s,a=N_(o);try{for(a.s();!(s=a.n()).done;){var u=S_(s.value,2),c=u[0],f=u[1];this.labels.push(c),this.outputs.push(f)}}catch(t){a.e(t)}finally{a.f()}}return T_(t,[{key:"evaluate",value:function(n){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(n);var i=this.input.evaluate(n);if(i<=e[0])return r[0].evaluate(n);var o=e.length;if(i>=e[o-1])return r[o-1].evaluate(n);var s=SM(e,i),a=e[s],u=e[s+1],c=t.interpolationFactor(this.interpolation,i,a,u),f=r[s].evaluate(n),h=r[s+1].evaluate(n);return"interpolate"===this.operator?EM[this.type.kind.toLowerCase()](f,h,c):"interpolate-hcl"===this.operator?VM.reverse(VM.interpolate(VM.forward(f),VM.forward(h),c)):$M.reverse($M.interpolate($M.forward(f),$M.forward(h),c))}},{key:"eachChild",value:function(t){t(this.input);var n,e=N_(this.outputs);try{for(e.s();!(n=e.n()).done;){t(n.value)}}catch(t){e.e(t)}finally{e.f()}}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],e=0;e1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:f}}if(n.length-1<4)return e.error("Expected at least 4 arguments, but found only ".concat(n.length-1,"."));if((n.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(a=e.parse(a,2,mS)))return null;var h=[],l=null;"interpolate-hcl"===o||"interpolate-lab"===o?l=gS:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var v=0;v=d)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',y);var b=e.parse(p,m,l);if(!b)return null;l=l||b.type,h.push([d,b])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new t(l,o,s,a,h):e.error("Type ".concat(OS(l)," is not interpolatable."))}}]),t}();function WM(t,n,e,r){var i=r-e,o=t-e;return 0===i?0:1===n?o/i:(Math.pow(n,o)-1)/(Math.pow(n,i)-1)}var HM=function(){function t(n,e){E_(this,t),this.type=n,this.args=e}return T_(t,[{key:"evaluate",value:function(t){var n,e,r=null,i=0,o=N_(this.args);try{for(o.s();!(e=o.n()).done;){var s=e.value;if(i++,(r=s.evaluate(t))&&r instanceof zS&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),null!==r)break}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every((function(t){return t.outputDefined()}))}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,e){if(n.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);var o,s=[],a=N_(n.slice(1));try{for(a.s();!(o=a.n()).done;){var u=o.value,c=e.parse(u,1+s.length,r,void 0,{typeAnnotation:"omit"});if(!c)return null;r=r||c.type,s.push(c)}}catch(t){a.e(t)}finally{a.f()}return new t(i&&s.some((function(t){return ES(i,t.type)}))?kS:r,s)}}]),t}(),KM=function(){function t(n,e){E_(this,t),this.type=e.type,this.bindings=[].concat(n),this.result=e}return T_(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var n,e=N_(this.bindings);try{for(e.s();!(n=e.n()).done;){t(n.value[1])}}catch(t){e.e(t)}finally{e.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,n=["let"],e=N_(this.bindings);try{for(e.s();!(t=e.n()).done;){var r=S_(t.value,2),i=r[0],o=r[1];n.push(i,o.serialize())}}catch(t){e.e(t)}finally{e.f()}return n.push(this.result.serialize()),n}}],[{key:"parse",value:function(n,e){if(n.length<4)return e.error("Expected at least 3 arguments, but found ".concat(n.length-1," instead."));for(var r=[],i=1;i=e.length)throw new qS("Array index out of bounds: ".concat(n," > ").concat(e.length-1,"."));if(n!==Math.floor(n))throw new qS("Array index must be an integer, but found ".concat(n," instead."));return e[n]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(n,e){if(3!==n.length)return e.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=e.parse(n[1],1,mS),i=e.parse(n[2],2,jS(e.expectedType||kS));return r&&i?new t(i.type.itemType,r,i):null}}]),t}(),YM=function(){function t(n,e){E_(this,t),this.type=wS,this.needle=n,this.haystack=e}return T_(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(!e)return!1;if(!CS(n,["boolean","string","number","null"]))throw new qS("Expected first argument to be of type boolean, string, number or null, but found ".concat(OS(GS(n))," instead."));if(!CS(e,["string","array"]))throw new qS("Expected second argument to be of type array or string, but found ".concat(OS(GS(e))," instead."));return e.indexOf(n)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,e){if(3!==n.length)return e.error("Expected 2 arguments, but found ".concat(n.length-1," instead."));var r=e.parse(n[1],1,kS),i=e.parse(n[2],2,kS);return r&&i?AS(r.type,[wS,bS,mS,yS,kS])?new t(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(OS(r.type)," instead")):null}}]),t}(),JM=function(){function t(n,e,r){E_(this,t),this.type=mS,this.needle=n,this.haystack=e,this.fromIndex=r}return T_(t,[{key:"evaluate",value:function(t){var n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(!CS(n,["boolean","string","number","null"]))throw new qS("Expected first argument to be of type boolean, string, number or null, but found ".concat(OS(GS(n))," instead."));if(!CS(e,["string","array"]))throw new qS("Expected second argument to be of type array or string, but found ".concat(OS(GS(e))," instead."));if(this.fromIndex){var r=this.fromIndex.evaluate(t);return e.indexOf(n,r)}return e.indexOf(n)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(n,e){if(n.length<=2||n.length>=5)return e.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=e.parse(n[1],1,kS),i=e.parse(n[2],2,kS);if(!r||!i)return null;if(!AS(r.type,[wS,bS,mS,yS,kS]))return e.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(OS(r.type)," instead"));if(4===n.length){var o=e.parse(n[3],3,mS);return o?new t(r,i,o):null}return new t(r,i)}}]),t}(),QM=function(){function t(n,e,r,i,o,s){E_(this,t),this.inputType=n,this.type=e,this.input=r,this.cases=i,this.outputs=o,this.otherwise=s}return T_(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);return(GS(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,n=this,e=["match",this.input.serialize()],r=[],i={},o=N_(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var s=t.value,a=i[this.cases[s]];void 0===a?(i[this.cases[s]]=r.length,r.push([this.cases[s],[s]])):r[a][1].push(s)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===n.inputType.kind?Number(t):t},c=0,f=r;cNumber.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof v&&Math.floor(v)!==v)return f.error("Numeric branch labels must be integer values.");if(r){if(f.checkSubtype(r,GS(v)))return null}else r=GS(v);if(void 0!==o[String(v)])return f.error("Branch labels must be unique.");o[String(v)]=s.length}}catch(t){l.e(t)}finally{l.f()}var d=e.parse(c,a,i);if(!d)return null;i=i||d.type,s.push(d)}var p=e.parse(n[1],1,kS);if(!p)return null;var y=e.parse(n[n.length-1],n.length-1,i);return y?"value"!==p.type.kind&&e.concat(1).checkSubtype(r,p.type)?null:new t(r,i,p,o,s,y):null}}]),t}(),tj=function(){function t(n,e,r){E_(this,t),this.type=n,this.branches=e,this.otherwise=r}return T_(t,[{key:"evaluate",value:function(t){var n,e=N_(this.branches);try{for(e.s();!(n=e.n()).done;){var r=S_(n.value,2),i=r[0],o=r[1];if(i.evaluate(t))return o.evaluate(t)}}catch(t){e.e(t)}finally{e.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var n,e=N_(this.branches);try{for(e.s();!(n=e.n()).done;){var r=S_(n.value,2),i=r[0],o=r[1];t(i),t(o)}}catch(t){e.e(t)}finally{e.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every((function(t){var n=S_(t,2);n[0];return n[1].outputDefined()}))&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,e){if(n.length<4)return e.error("Expected at least 3 arguments, but found only ".concat(n.length-1,"."));if(n.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],o=1;o=5)return e.error("Expected 3 or 4 arguments, but found ".concat(n.length-1," instead."));var r=e.parse(n[1],1,kS),i=e.parse(n[2],2,mS);if(!r||!i)return null;if(!AS(r.type,[jS(kS),bS,kS]))return e.error("Expected first argument to be of type array or string, but found ".concat(OS(r.type)," instead"));if(4===n.length){var o=e.parse(n[3],3,mS);return o?new t(r.type,r,i,o):null}return new t(r.type,r,i)}}]),t}();function ej(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function rj(t,n,e,r){return 0===r.compare(n,e)}function ij(t,n,e){var r="=="!==t&&"!="!==t;return function(){function i(t,n,e){E_(this,i),this.type=wS,this.lhs=t,this.rhs=n,this.collator=e,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}return T_(i,[{key:"evaluate",value:function(i){var o=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var a=GS(o),u=GS(s);if(a.kind!==u.kind||"string"!==a.kind&&"number"!==a.kind)throw new qS('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(a.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!r&&this.hasUntypedArgument){var c=GS(o),f=GS(s);if("string"!==c.kind||"string"!==f.kind)return n(i,o,s)}return this.collator?e(i,o,s,this.collator.evaluate(i)):n(i,o,s)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var n=[t];return this.eachChild((function(t){n.push(t.serialize())})),n}}],[{key:"parse",value:function(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");var e=t[0],o=n.parse(t[1],1,kS);if(!o)return null;if(!ej(e,o.type))return n.concat(1).error('"'.concat(e,"\" comparisons are not supported for type '").concat(OS(o.type),"'."));var s=n.parse(t[2],2,kS);if(!s)return null;if(!ej(e,s.type))return n.concat(2).error('"'.concat(e,"\" comparisons are not supported for type '").concat(OS(s.type),"'."));if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot compare types '".concat(OS(o.type),"' and '").concat(OS(s.type),"'."));r&&("value"===o.type.kind&&"value"!==s.type.kind?o=new VS(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new VS(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(a=n.parse(t[3],3,_S)))return null}return new i(o,s,a)}}]),i}()}var oj=ij("==",(function(t,n,e){return n===e}),rj),sj=ij("!=",(function(t,n,e){return n!==e}),(function(t,n,e,r){return!rj(0,n,e,r)})),aj=ij("<",(function(t,n,e){return n",(function(t,n,e){return n>e}),(function(t,n,e,r){return r.compare(n,e)>0})),cj=ij("<=",(function(t,n,e){return n<=e}),(function(t,n,e,r){return r.compare(n,e)<=0})),fj=ij(">=",(function(t,n,e){return n>=e}),(function(t,n,e,r){return r.compare(n,e)>=0})),hj=function(){function t(n,e,r,i,o){E_(this,t),this.type=bS,this.number=n,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=o}return T_(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(n,e){if(3!==n.length)return e.error("Expected two arguments.");var r=e.parse(n[1],1,mS);if(!r)return null;var i=n[2];if("object"!==F_(i)||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=e.parse(i.locale,1,bS)))return null;var s=null;if(i.currency&&!(s=e.parse(i.currency,1,bS)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,mS)))return null;var u=null;return i["max-fraction-digits"]&&!(u=e.parse(i["max-fraction-digits"],1,mS))?null:new t(r,o,s,a,u)}}]),t}(),lj={"==":oj,"!=":sj,">":uj,"<":aj,">=":fj,"<=":cj,array:VS,at:XM,boolean:VS,case:tj,coalesce:HM,collator:QS,format:ZS,image:WS,in:YM,"index-of":JM,interpolate:ZM,"interpolate-hcl":ZM,"interpolate-lab":ZM,length:function(){function t(n){E_(this,t),this.type=mS,this.input=n}return T_(t,[{key:"evaluate",value:function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new qS("Expected value to be of type string or array, but found ".concat(OS(GS(n))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t}}],[{key:"parse",value:function(n,e){if(2!==n.length)return e.error("Expected 1 argument, but found ".concat(n.length-1," instead."));var r=e.parse(n[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found ".concat(OS(r.type)," instead.")):new t(r):null}}]),t}(),let:KM,literal:BS,match:QM,number:VS,"number-format":hj,object:VS,slice:nj,step:MM,string:VS,"to-boolean":KS,"to-color":KS,"to-number":KS,"to-string":KS,var:xM,within:mM};function vj(t,n){var e=S_(n,4),r=e[0],i=e[1],o=e[2],s=e[3];r=r.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var a=s?s.evaluate(t):1,u=LS(r,i,o,a);if(u)throw new qS(u);return new IS(r/255*a,i/255*a,o/255*a,a)}function dj(t,n){return t in n}function pj(t,n){var e=n[t];return void 0===e?null:e}function yj(t){return{type:t}}function mj(t){return{result:"success",value:t}}function bj(t){return{result:"error",value:t}}function wj(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function gj(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function xj(t){return!!t.expression&&t.expression.interpolated}function kj(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":F_(t)}function _j(t){return"object"===F_(t)&&null!==t&&!Array.isArray(t)}JS.register(lj,{error:[{kind:"error"},[bS],function(t,n){var e=S_(n,1)[0];throw new qS(e.evaluate(t))}],typeof:[bS,[kS],function(t,n){return OS(GS(S_(n,1)[0].evaluate(t)))}],"to-rgba":[jS(mS,4),[gS],function(t,n){return S_(n,1)[0].evaluate(t).toArray()}],rgb:[gS,[mS,mS,mS],vj],rgba:[gS,[mS,mS,mS,mS],vj],has:{type:wS,overloads:[[[bS],function(t,n){return dj(S_(n,1)[0].evaluate(t),t.properties())}],[[bS,xS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return dj(r.evaluate(t),i.evaluate(t))}]]},get:{type:kS,overloads:[[[bS],function(t,n){return pj(S_(n,1)[0].evaluate(t),t.properties())}],[[bS,xS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return pj(r.evaluate(t),i.evaluate(t))}]]},"feature-state":[kS,[bS],function(t,n){return pj(S_(n,1)[0].evaluate(t),t.featureState||{})}],properties:[xS,[],function(t){return t.properties()}],"geometry-type":[bS,[],function(t){return t.geometryType()}],id:[kS,[],function(t){return t.id()}],zoom:[mS,[],function(t){return t.globals.zoom}],"heatmap-density":[mS,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[mS,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[mS,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[kS,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[mS,yj(mS),function(t,n){var e,r=0,i=N_(n);try{for(i.s();!(e=i.n()).done;){r+=e.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return r}],"*":[mS,yj(mS),function(t,n){var e,r=1,i=N_(n);try{for(i.s();!(e=i.n()).done;){r*=e.value.evaluate(t)}}catch(t){i.e(t)}finally{i.f()}return r}],"-":{type:mS,overloads:[[[mS,mS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return r.evaluate(t)-i.evaluate(t)}],[[mS],function(t,n){return-S_(n,1)[0].evaluate(t)}]]},"/":[mS,[mS,mS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return r.evaluate(t)/i.evaluate(t)}],"%":[mS,[mS,mS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[mS,[],function(){return Math.LN2}],pi:[mS,[],function(){return Math.PI}],e:[mS,[],function(){return Math.E}],"^":[mS,[mS,mS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.sqrt(e.evaluate(t))}],log10:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.log(e.evaluate(t))/Math.LN10}],ln:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.log(e.evaluate(t))}],log2:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.log(e.evaluate(t))/Math.LN2}],sin:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.sin(e.evaluate(t))}],cos:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.cos(e.evaluate(t))}],tan:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.tan(e.evaluate(t))}],asin:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.asin(e.evaluate(t))}],acos:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.acos(e.evaluate(t))}],atan:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.atan(e.evaluate(t))}],min:[mS,yj(mS),function(t,n){return Math.min.apply(Math,k_(n.map((function(n){return n.evaluate(t)}))))}],max:[mS,yj(mS),function(t,n){return Math.max.apply(Math,k_(n.map((function(n){return n.evaluate(t)}))))}],abs:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.abs(e.evaluate(t))}],round:[mS,[mS],function(t,n){var e=S_(n,1)[0].evaluate(t);return e<0?-Math.round(-e):Math.round(e)}],floor:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.floor(e.evaluate(t))}],ceil:[mS,[mS],function(t,n){var e=S_(n,1)[0];return Math.ceil(e.evaluate(t))}],"filter-==":[wS,[bS,kS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[wS,[kS],function(t,n){var e=S_(n,1)[0];return t.id()===e.value}],"filter-type-==":[wS,[bS],function(t,n){var e=S_(n,1)[0];return t.geometryType()===e.value}],"filter-<":[wS,[bS,kS],function(t,n){var e=S_(n,2),r=e[0],i=e[1],o=t.properties()[r.value],s=i.value;return F_(o)===F_(s)&&o":[wS,[bS,kS],function(t,n){var e=S_(n,2),r=e[0],i=e[1],o=t.properties()[r.value],s=i.value;return F_(o)===F_(s)&&o>s}],"filter-id->":[wS,[kS],function(t,n){var e=S_(n,1)[0],r=t.id(),i=e.value;return F_(r)===F_(i)&&r>i}],"filter-<=":[wS,[bS,kS],function(t,n){var e=S_(n,2),r=e[0],i=e[1],o=t.properties()[r.value],s=i.value;return F_(o)===F_(s)&&o<=s}],"filter-id-<=":[wS,[kS],function(t,n){var e=S_(n,1)[0],r=t.id(),i=e.value;return F_(r)===F_(i)&&r<=i}],"filter->=":[wS,[bS,kS],function(t,n){var e=S_(n,2),r=e[0],i=e[1],o=t.properties()[r.value],s=i.value;return F_(o)===F_(s)&&o>=s}],"filter-id->=":[wS,[kS],function(t,n){var e=S_(n,1)[0],r=t.id(),i=e.value;return F_(r)===F_(i)&&r>=i}],"filter-has":[wS,[kS],function(t,n){return S_(n,1)[0].value in t.properties()}],"filter-has-id":[wS,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[wS,[jS(bS)],function(t,n){return S_(n,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[wS,[jS(kS)],function(t,n){return S_(n,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[wS,[bS,jS(kS)],function(t,n){var e=S_(n,2),r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[wS,[bS,jS(kS)],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return function(t,n,e,r){for(;e<=r;){var i=e+r>>1;if(n[i]===t)return!0;n[i]>t?r=i-1:e=i+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:wS,overloads:[[[wS,wS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[yj(wS),function(t,n){var e,r=N_(n);try{for(r.s();!(e=r.n()).done;){if(!e.value.evaluate(t))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}]]},any:{type:wS,overloads:[[[wS,wS],function(t,n){var e=S_(n,2),r=e[0],i=e[1];return r.evaluate(t)||i.evaluate(t)}],[yj(wS),function(t,n){var e,r=N_(n);try{for(r.s();!(e=r.n()).done;){if(e.value.evaluate(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}]]},"!":[wS,[wS],function(t,n){return!S_(n,1)[0].evaluate(t)}],"is-supported-script":[wS,[bS],function(t,n){var e=S_(n,1)[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[bS,[bS],function(t,n){return S_(n,1)[0].evaluate(t).toUpperCase()}],downcase:[bS,[bS],function(t,n){return S_(n,1)[0].evaluate(t).toLowerCase()}],concat:[bS,yj(kS),function(t,n){return n.map((function(n){return US(n.evaluate(t))})).join("")}],"resolved-locale":[bS,[_S],function(t,n){return S_(n,1)[0].evaluate(t).resolvedLocale()}]});var Sj=function(){function t(n,e){var r;E_(this,t),this.expression=n,this._warningHistory={},this._evaluator=new YS,this._defaultValue=e?"color"===(r=e).type&&_j(r.default)?new IS(0,0,0,0):"color"===r.type?IS.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}return T_(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,e,r,i,o){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=e,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(t,n,e,r,i,o){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=e||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new qS("Expected value to be one of ".concat(Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}]),t}();function Mj(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in lj}function jj(t,n){var e=new kM(lj,[],n?function(t){var n={color:gS,string:bS,number:mS,enum:bS,boolean:wS,formatted:SS,resolvedImage:MS};if("array"===t.type)return jS(n[t.value]||kS,t.length);return n[t.type]}(n):void 0),r=e.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?mj(new Sj(r,n)):bj(e.errors)}var Oj=function(){function t(n,e){E_(this,t),this.kind=n,this._styleExpression=e,this.isStateDependent="constant"!==n&&!wM(e.expression)}return T_(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,e,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,e,r,i,o)}},{key:"evaluate",value:function(t,n,e,r,i,o){return this._styleExpression.evaluate(t,n,e,r,i,o)}}]),t}(),Tj=function(){function t(n,e,r,i){E_(this,t),this.kind=n,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==n&&!wM(e.expression),this.interpolationType=i}return T_(t,[{key:"evaluateWithoutErrorHandling",value:function(t,n,e,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,e,r,i,o)}},{key:"evaluate",value:function(t,n,e,r,i,o){return this._styleExpression.evaluate(t,n,e,r,i,o)}},{key:"interpolationFactor",value:function(t,n,e){return this.interpolationType?ZM.interpolationFactor(this.interpolationType,t,n,e):0}}]),t}();function Ej(t,n){if("error"===(t=jj(t,n)).result)return t;var e=t.value.expression,r=bM(e);if(!r&&!wj(n))return bj([new dS("","data expressions not supported")]);var i=gM(e,["zoom"]);if(!i&&!gj(n))return bj([new dS("","zoom expressions not supported")]);var o=Aj(e);if(!o&&!i)return bj([new dS("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof dS)return bj([o]);if(o instanceof ZM&&!xj(n))return bj([new dS("",'"interpolate" expressions cannot be used with this property')]);if(!o)return mj(new Oj(r?"constant":"source",t.value));var s=o instanceof ZM?o.interpolation:void 0;return mj(new Tj(r?"camera":"composite",t.value,o.labels,s))}function Aj(t){var n=null;if(t instanceof KM)n=Aj(t.result);else if(t instanceof HM){var e,r=N_(t.args);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(n=Aj(i))break}}catch(t){r.e(t)}finally{r.f()}}else(t instanceof MM||t instanceof ZM)&&t.input instanceof JS&&"zoom"===t.input.name&&(n=t);return n instanceof dS||t.eachChild((function(t){var e=Aj(t);e instanceof dS?n=e:!n&&e?n=new dS("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&e&&n!==e&&(n=new dS("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}function Cj(t){return"object"===F_(t)?["literal",t]:t}function Rj(t,n){var e=t.stops;if(!e)return function(t,n){var e=["get",t.property];if(void 0===t.default)return"string"===n.type?["string",e]:e;if("enum"===n.type)return["match",e,Object.keys(n.values),e,t.default];var r=["color"===n.type?"to-color":n.type,e,Cj(t.default)];return"array"===n.type&&r.splice(1,0,n.value,n.length||null),r}(t,n);var r=e&&"object"===F_(e[0][0]),i=r||void 0!==t.property,o=r||!i;return e=e.map((function(t){return!i&&n.tokens&&"string"==typeof t[1]?[t[0],Fj(t[1])]:[t[0],Cj(t[1])]})),r?function(t,n,e){for(var r={},i={},o=[],s=0;s3&&void 0!==arguments[3]?arguments[3]:["zoom"],o=Lj(t,n),s=!1;if("interval"===o)r=["step",i],s=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'.concat(o,'"'));var a=void 0!==t.base?t.base:1;r=[Ij(t),1===a?["linear"]:["exponential",a],i]}var u,c=N_(e);try{for(c.s();!(u=c.n()).done;){var f=u.value;zj(r,f[0],f[1],s)}}catch(t){c.e(t)}finally{c.f()}return Nj(r),r}(t,n,e):Dj(t,n,e)}function Ij(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Pj(t,n){var e,r,i=Cj((e=t.default,r=n.default,void 0!==e?e:void 0!==r?r:void 0));return void 0===i&&"resolvedImage"===n.type?"":i}function Dj(t,n,e){var r=Lj(t,n),i=["get",t.property];if("categorical"===r&&"boolean"==typeof e[0][0]){var o,s=["case"],a=N_(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;s.push(["==",i,u[0]],u[1])}}catch(t){a.e(t)}finally{a.f()}return s.push(Pj(t,n)),s}if("categorical"===r){var c,f=["match",i],h=N_(e);try{for(h.s();!(c=h.n()).done;){var l=c.value;zj(f,l[0],l[1],!1)}}catch(t){h.e(t)}finally{h.f()}return f.push(Pj(t,n)),f}if("interval"===r){var v,d=["step",["number",i]],p=N_(e);try{for(p.s();!(v=p.n()).done;){var y=v.value;zj(d,y[0],y[1],!0)}}catch(t){p.e(t)}finally{p.f()}return Nj(d),void 0===t.default?d:["case",["==",["typeof",i],"number"],d,Cj(t.default)]}if("exponential"===r){var m,b=void 0!==t.base?t.base:1,w=[Ij(t),1===b?["linear"]:["exponential",b],["number",i]],g=N_(e);try{for(g.s();!(m=g.n()).done;){var x=m.value;zj(w,x[0],x[1],!1)}}catch(t){g.e(t)}finally{g.f()}return void 0===t.default?w:["case",["==",["typeof",i],"number"],w,Cj(t.default)]}throw new Error("Unknown property function type ".concat(r))}function Nj(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function zj(t,n,e,r){t.length>3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(e))}function Lj(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function Fj(t){for(var n=["concat"],e=/{([^{}]+)}/g,r=0,i=e.exec(t);null!==i;i=e.exec(t)){var o=t.slice(r,e.lastIndex-i[0].length);r=e.lastIndex,o.length>0&&n.push(o),n.push(["get",i[1]])}if(1===n.length)return t;if(r=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":var n,e=N_(t.slice(1));try{for(e.s();!(n=e.n()).done;){var r=n.value;if(!Gj(r)&&"boolean"!=typeof r)return!1}}catch(t){e.e(t)}finally{e.f()}return!0;default:return!0}}var Uj={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Bj(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};Gj(t)||(t=Vj(t));var n=jj(t,Uj);if("error"===n.result)throw new Error(n.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return{filter:function(t,e,r){return n.value.evaluate(t,e,{},r)},needGeometry:$j(t)}}function qj(t,n){return tn?1:0}function $j(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n"===e||"<="===e||">="===e?Zj(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(Vj))):"all"===e?["all"].concat(t.slice(1).map(Vj)):"none"===e?["all"].concat(t.slice(1).map(Vj).map(Kj)):"in"===e?Wj(t[1],t.slice(2)):"!in"===e?Kj(Wj(t[1],t.slice(2))):"has"===e?Hj(t[1]):"!has"===e?Kj(Hj(t[1])):"within"!==e||t}function Zj(t,n,e){switch(t){case"$type":return["filter-type-".concat(e),n];case"$id":return["filter-id-".concat(e),n];default:return["filter-".concat(e),t,n]}}function Wj(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return F_(t)!==F_(n[0])}))?["filter-in-large",t,["literal",n.sort(qj)]]:["filter-in-small",t,["literal",n]]}}function Hj(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Kj(t){return["!",t]}var Xj=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Yj(t,n){var e={};for(var r in t)"ref"!==r&&(e[r]=t[r]);return Xj.forEach((function(t){t in n&&(e[t]=n[t])})),e}var Jj=T_((function t(n,e,r,i){E_(this,t),this.message=(n?"".concat(n,": "):"")+r,i&&(this.identifier=i),null!=e&&e.av&&(this.line=e.av)})),Qj=T_((function t(n){E_(this,t),this.error=n,this.message=n.message;var e=n.message.match(/line (\d+)/);this.line=e?parseInt(e[1],10):0}));function tO(t){var n=t.key,e=t.value;return e?[new Jj(n,e,"constants have been deprecated as of v8")]:[]}function nO(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function eO(t){if(Array.isArray(t))return t.map(eO);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var e in t)n[e]=eO(t[e]);return n}return nO(t)}function rO(t){var n=t.key,e=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],u=kj(e);if("object"!==u)return[new Jj(n,e,"object expected, ".concat(u," found"))];for(var c in e){var f=c.split(".")[0],h=r[f]||r["*"],l=void 0;if(i[f])l=i[f];else if(r[f])l=kO;else if(i["*"])l=i["*"];else{if(!r["*"]){a.push(new Jj(n,e[c],'unknown property "'.concat(c,'"')));continue}l=kO}a=a.concat(l({key:(n?"".concat(n,"."):n)+c,value:e[c],valueSpec:h,style:o,styleSpec:s,object:e,objectKey:c},e))}for(var v in r)i[v]||r[v].required&&void 0===r[v].default&&void 0===e[v]&&a.push(new Jj(n,e,'missing required property "'.concat(v,'"')));return a}function iO(t){var n=t.value,e=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,s=t.arrayElementValidator||kO;if("array"!==kj(n))return[new Jj(o,n,"array expected, ".concat(kj(n)," found"))];if(e.length&&n.length!==e.length)return[new Jj(o,n,"array length ".concat(e.length," expected, length ").concat(n.length," found"))];if(e["min-length"]&&n.lengtha)return[new Jj(n,e,"".concat(e," is greater than the maximum value ").concat(a))]}return[]}function sO(t){var n,e,r,i=t.valueSpec,o=nO(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,u=!a,c="array"===kj(t.value.stops)&&"array"===kj(t.value.stops[0])&&"object"===kj(t.value.stops[0][0]),f=rO({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Jj(t.key,t.value,'identity function may not have a "stops" property')];var n=[],e=t.value;n=n.concat(iO({key:t.key,value:e,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===kj(e)&&0===e.length&&n.push(new Jj(t.key,e,"array must have at least one stop"));return n},default:function(t){return kO({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&f.push(new Jj(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||f.push(new Jj(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!xj(t.valueSpec)&&f.push(new Jj(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!wj(t.valueSpec)?f.push(new Jj(t.key,t.value,"property functions not supported")):a&&!gj(t.valueSpec)&&f.push(new Jj(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||f.push(new Jj(t.key,t.value,'"property" property is required')),f;function h(t){var n=[],o=t.value,a=t.key;if("array"!==kj(o))return[new Jj(a,o,"array expected, ".concat(kj(o)," found"))];if(2!==o.length)return[new Jj(a,o,"array length 2 expected, length ".concat(o.length," found"))];if(c){if("object"!==kj(o[0]))return[new Jj(a,o,"object expected, ".concat(kj(o[0])," found"))];if(void 0===o[0].zoom)return[new Jj(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Jj(a,o,"object stop key must have value")];if(r&&r>nO(o[0].zoom))return[new Jj(a,o[0].zoom,"stop zoom values must appear in ascending order")];nO(o[0].zoom)!==r&&(r=nO(o[0].zoom),e=void 0,s={}),n=n.concat(rO({key:"".concat(a,"[0]"),value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:oO,value:l}}))}else n=n.concat(l({key:"".concat(a,"[0]"),value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Mj(eO(o[1]))?n.concat([new Jj("".concat(a,"[1]"),o[1],"expressions are not allowed in function stops.")]):n.concat(kO({key:"".concat(a,"[1]"),value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function l(t,r){var a=kj(t.value),u=nO(t.value),c=null!==t.value?t.value:r;if(n){if(a!==n)return[new Jj(t.key,c,"".concat(a," stop domain type must match previous stop domain type ").concat(n))]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new Jj(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var f="number expected, ".concat(a," found");return wj(i)&&void 0===o&&(f+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jj(t.key,c,f)]}return"categorical"!==o||"number"!==a||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===a&&void 0!==e&&u":case">=":n.length>=2&&"$type"===nO(n[1])&&o.push(new Jj(e,n,'"$type" cannot be use with operator "'.concat(n[0],'"')));case"==":case"!=":3!==n.length&&o.push(new Jj(e,n,'filter array for operator "'.concat(n[0],'" must have 3 elements')));case"in":case"!in":n.length>=2&&"string"!==(r=kj(n[1]))&&o.push(new Jj("".concat(e,"[1]"),n[1],"string expected, ".concat(r," found")));for(var s=2;s1&&void 0!==arguments[1]?arguments[1]:G_,e=[];return e=e.concat(kO({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:_O,"*":function(){return[]}}})),t.constants&&(e=e.concat(tO({key:"constants",value:t.constants,style:t,styleSpec:n}))),MO(e)}function MO(t){return[].concat(t).sort((function(t,n){return t.line-n.line}))}function jO(t){return function(){for(var n=arguments.length,e=new Array(n),r=0;rc&&M.push("'"+this.cv[k]+"'");O=l.showPosition?"Parse error on line "+(a+1)+":\n"+l.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.cv[b]||b)+"'":"Parse error on line "+(a+1)+": Unexpected "+(b==f?"end of input":"'"+(this.cv[b]||b)+"'"),this.parseError(O,{text:l.match,token:this.cv[b]||b,line:l.yylineno,loc:p,expected:M})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+b);switch(g[0]){case 1:e.push(b),r.push(l.yytext),i.push(l.yylloc),e.push(g[1]),b=null,u=l.yyleng,s=l.yytext,a=l.yylineno,p=l.yylloc;break;case 2:if(_=this.fv[g[1]][1],j.$=r[r.length-_],j._$={first_line:i[i.length-(_||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(_||1)].first_column,last_column:i[i.length-1].last_column},y&&(j._$.range=[i[i.length-(_||1)].range[0],i[i.length-1].range[1]]),void 0!==(x=this.performAction.apply(j,[s,u,a,v.yy,g[1],r,i].concat(h))))return x;_&&(e=e.slice(0,-1*_*2),r=r.slice(0,-1*_),i=i.slice(0,-1*_)),e.push(this.fv[g[1]][0]),r.push(j.$),i.push(j._$),S=o[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}},l={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===r.length?this.yylloc.first_column:0)+r[r.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var e,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var o in i)this[o]=i[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,e,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),o=0;on[0].length)){if(n=e,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,i[o])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,n,e,r){switch(e){case 0:break;case 1:return 6;case 2:return n.yytext=n.yytext.substr(1,n.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function v(){this.yy={}}return h.lexer=l,v.prototype=h,h.Parser=v,new v}();n.parser=e,n.Parser=e.Parser,n.parse=function(){return e.parse.apply(e,arguments)}}));function TO(t){if(t instanceof String||"string"==typeof t||t instanceof Buffer)try{return OO.parse(t.toString())}catch(t){throw new Qj(t)}return t}function EO(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G_,e=t;try{e=TO(e)}catch(t){return[t]}return SO(e,n)}new Set(["vector","raster","raster-dem"]);var AO=Mj,CO=Ej,RO=Rj,IO=_j;EO.parsed=EO,EO.latest=EO;var PO="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1,i=arguments.length;r=.05){for(var e="",r=t.split("\n"),i=FO.slice(0,Math.round(n/.1)),o=0,s=r.length;o0&&(e+="\n"),e+=r[o].split("").join(i);return e}return t}function UO(){return LO||(LO=zO(1,1).getContext("2d")),LO}function BO(t,n){return UO().measureText(t).width+(t.length-1)*n}var qO={};function $O(t,n,e,r){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],s=0,a=i.length;s1){var h=UO();h.font=n;var l=h.measureText("M").width*e,v="";for(o=[],s=0,a=f.length;s1;++s){var y=o[s];if(BO(y,r)<.35*l){var m=s>0?BO(o[s-1],r):1/0,b=s.7*l&&BO(g,r)<.6*l){var x=w.split(" "),k=x.pop();BO(k,r)<.2*l&&(o[s]=x.join(" "),o[s+1]=k+" "+g),a-=1}}c=o.join("\n")}else c=t;c=GO(c,r),qO[u]=c}return c}qs&&X(qs,z,(function(){qO={}}));var VO,ZO,WO=IO,HO=RO,KO=AO,XO=CO,YO={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},JO={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},QO={},tT={zoom:0};function nT(t,n,e,r,i,o){var s=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});var a=o[s];if(!a[e]){var u=(t[n]||QO)[e],c=G_["".concat(n,"_").concat(t.type)][e];void 0===u&&(u=c.default);var f=KO(u);if(!f&&WO(u)&&(u=HO(u,c),f=!0),f){var h=function(t,n){var e=XO(t,n);if("error"===e.result)throw new Error(e.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return e.value}(u,c);a[e]=h.evaluate.bind(h)}else"color"==c.type&&(u=IS.parse(u)),a[e]=function(){return u}}return tT.zoom=r,a[e](tT,i)}var eT=!1;function rT(t,n){if(t){if(!eT&&(0===t.a||0===n))return;var e=t.a;return n=void 0===n?1:n,0===e?"transparent":"rgba("+Math.round(255*t.r/e)+","+Math.round(255*t.g/e)+","+Math.round(255*t.b/e)+","+e*n+")"}return t}var iT=/^([^]*)\{(.*)\}([^]*)$/;function oT(t,n){var e;do{if(e=t.match(iT)){var r=n[e[2]]||"";t=e[1]+r+e[3]}}while(e);return t}var sT=!1;function aT(t,n,e,r,i,o,s){if(void 0===r&&(r=NO),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var a,u;if(o)if("undefined"!=typeof Image){var c=new Image;c.crossOrigin="anonymous",c.onload=function(){a=c,u=[c.width,c.height],t.changed(),c.onload=null},c.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var f=self;f.postMessage({action:"loadImage",src:o}),f.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,u=[a.width,a.height])}))}for(var h,l=function(t){t=t.slice();for(var n=Object.create(null),e=0;e=g.maxzoom)return"continue";var S=g.filter;if(!S||function(t,n,e,r,i){return i||console.warn("No filterCache provided to evaluateFilter()"),t in i||(i[t]=Bj(n).filter),tT.zoom=r,i[t](tT,e)}(x,S,l,c,b)){f=g;var M=void 0,j=void 0,A=void 0,C=void 0,R=void 0,I=void 0,P=w.index;if(3==h&&("fill"==g.type||"fill-extrusion"==g.type))if(j=nT(g,"paint",g.type+"-opacity",c,l,m),g.type+"-pattern"in _){var D=nT(g,"paint",g.type+"-pattern",c,l,m);if(D){var N="string"==typeof D?oT(D,e):D.toString();if(a&&i&&i[N]){++d,(I=E[d])&&I.getFill()&&!I.getStroke()&&!I.getText()||(I=new Zv({fill:new Sv}),E[d]=I),A=I.getFill(),I.setZIndex(P);var z=y[vt=N+"."+j];if(!z){var L=zO((dt=i[N]).width,dt.height),F=L.getContext("2d");F.globalAlpha=j,F.drawImage(a,dt.x,dt.y,dt.width,dt.height,0,0,dt.width,dt.height),z=F.createPattern(L,"repeat"),y[vt]=z}A.setColor(z)}}}else(M=rT(nT(g,"paint",g.type+"-color",c,l,m),j))&&(g.type+"-outline-color"in _&&(R=rT(nT(g,"paint",g.type+"-outline-color",c,l,m),j)),R||(R=M),++d,(I=E[d])&&I.getFill()&&I.getStroke()&&!I.getText()||(I=new Zv({fill:new Sv,stroke:new Lv}),E[d]=I),(A=I.getFill()).setColor(M),(C=I.getStroke()).setColor(R),C.setWidth(.5),I.setZIndex(P));if(1!=h&&"line"==g.type){M=!("line-pattern"in _)&&"line-color"in _?rT(nT(g,"paint","line-color",c,l,m),nT(g,"paint","line-opacity",c,l,m)):void 0;var G=nT(g,"paint","line-width",c,l,m);M&&G>0&&(++d,(I=E[d])&&I.getStroke()&&!I.getFill()&&!I.getText()||(I=new Zv({stroke:new Lv}),E[d]=I),(C=I.getStroke()).setLineCap(nT(g,"layout","line-cap",c,l,m)),C.setLineJoin(nT(g,"layout","line-join",c,l,m)),C.setMiterLimit(nT(g,"layout","line-miter-limit",c,l,m)),C.setColor(M),C.setWidth(G),C.setLineDash(_["line-dasharray"]?nT(g,"paint","line-dasharray",c,l,m).map((function(t){return t*G})):null),I.setZIndex(P))}var U=!1,B=null,q=0,$=void 0,V=void 0,Z=void 0;if((1==h||2==h)&&"icon-image"in k){var W=nT(g,"layout","icon-image",c,l,m);if(W){$="string"==typeof W?oT(W,e):W.toString();var H=void 0;if(a&&i&&i[$]){var K=nT(g,"layout","icon-rotation-alignment",c,l,m);if(2==h){var X=t.getGeometry();if(X.getFlatMidpoint||X.getFlatMidpoints){var Y=X.getExtent();if(Math.sqrt(Math.max(Math.pow((Y[2]-Y[0])/n,2),Math.pow((Y[3]-Y[1])/n,2)))>150){var J="MultiLineString"===X.getType()?X.getFlatMidpoints():X.getFlatMidpoint();if(ZO||(ZO=new Ek("Point",VO=[NaN,NaN],[],{},null)),H=ZO,VO[0]=J[0],VO[1]=J[1],"line"===(At=nT(g,"layout","symbol-placement",c,l,m))&&"map"===K)for(var Q=X.getStride(),tt=X.getFlatCoordinates(),nt=0,et=tt.length-Q;nt=at&&J[0]<=ct&&J[1]>=ut&&J[1]<=ft){q=Math.atan2(it-st,ot-rt);break}}}}}if(2!==h||H){var ht=nT(g,"layout","icon-size",c,l,m),lt=void 0!==_["icon-color"]?nT(g,"paint","icon-color",c,l,m):null;if(!lt||0!==lt.a){var vt=$+"."+ht;if(null!==lt&&(vt+="."+lt),!(V=p[vt])){var dt=i[$];V=new zv({color:lt?[255*lt.r,255*lt.g,255*lt.b,lt.a]:void 0,img:a,imgSize:u,size:[dt.width,dt.height],offset:[dt.x,dt.y],rotateWithView:"map"===K,scale:ht/dt.pixelRatio}),p[vt]=V}}V&&(++d,(I=E[d])&&I.getImage()&&!I.getFill()&&!I.getStroke()||(I=new Zv,E[d]=I),I.setGeometry(H),V.setRotation(q+DO(nT(g,"layout","icon-rotate",c,l,m))),V.setOpacity(nT(g,"paint","icon-opacity",c,l,m)),V.setAnchor(JO[nT(g,"layout","icon-anchor",c,l,m)]),I.setImage(V),B=I.getText(),I.setText(void 0),I.setZIndex(P),U=!0,Z=!1)}else Z=!0}}}if(1==h&&"circle-radius"in _){++d,(I=E[d])&&I.getImage()&&!I.getFill()&&!I.getStroke()||(I=new Zv,E[d]=I);var pt=nT(g,"paint","circle-radius",c,l,m),yt=rT(nT(g,"paint","circle-stroke-color",c,l,m),nT(g,"paint","circle-stroke-opacity",c,l,m)),mt=rT(nT(g,"paint","circle-color",c,l,m),nT(g,"paint","circle-opacity",c,l,m)),bt=nT(g,"paint","circle-stroke-width",c,l,m),wt=pt+"."+yt+"."+mt+"."+bt;(V=p[wt])||(V=new _v({radius:pt,stroke:yt&&bt>0?new Lv({width:bt,color:yt}):void 0,fill:mt?new Sv({color:mt}):void 0}),p[wt]=V),I.setImage(V),B=I.getText(),I.setText(void 0),I.setGeometry(void 0),I.setZIndex(P),U=!0}var gt=void 0;if("text-field"in k)gt=oT(nT(g,"layout","text-field",c,l,m).toString(),e).trim(),j=nT(g,"paint","text-opacity",c,l,m);if(gt&&j&&!Z){U||(++d,(I=E[d])&&I.getText()&&!I.getFill()&&!I.getStroke()||(I=new Zv,E[d]=I),I.setImage(void 0),I.setGeometry(void 0)),I.getText()||I.setText(B||new Kv({padding:[2,2,2,2]})),B=I.getText();var xt=Math.round(nT(g,"layout","text-size",c,l,m)),kt=nT(g,"layout","text-font",c,l,m),_t=nT(g,"layout","text-line-height",c,l,m),St=x_(s?s(kt):kt,xt,_t),Mt=k["text-transform"];"uppercase"==Mt?gt=gt.toUpperCase():"lowercase"==Mt&&(gt=gt.toLowerCase());var jt=nT(g,"layout","text-max-width",c,l,m),Ot=nT(g,"layout","text-letter-spacing",c,l,m),Tt=2==h?GO(gt,Ot):$O(gt,St,jt,Ot);B.setText(Tt),B.setFont(St),B.setRotation(DO(nT(g,"layout","text-rotate",c,l,m)));var Et=nT(g,"layout","text-anchor",c,l,m),At=U||1==h?"point":nT(g,"layout","symbol-placement",c,l,m);B.setPlacement(At);var Ct=nT(g,"paint","text-halo-width",c,l,m),Rt=nT(g,"layout","text-offset",c,l,m),It=nT(g,"paint","text-translate",c,l,m),Pt=0,Dt=0;if("point"==At){var Nt="center";-1!==Et.indexOf("left")?(Nt="left",Dt=Ct):-1!==Et.indexOf("right")&&(Nt="right",Dt=-Ct),B.setTextAlign(Nt);var zt=nT(g,"layout","text-rotation-alignment",c,l,m);B.setRotateWithView("map"==zt)}else B.setMaxAngle(DO(nT(g,"layout","text-max-angle",c,l,m))*gt.length/Tt.length),B.setTextAlign(),B.setRotateWithView(!1);var Lt="middle";0==Et.indexOf("bottom")?(Lt="bottom",Pt=-Ct-.5*(_t-1)*xt):0==Et.indexOf("top")&&(Lt="top",Pt=Ct+.5*(_t-1)*xt),B.setTextBaseline(Lt),B.setOffsetX(Rt[0]*xt+Dt+It[0]),B.setOffsetY(Rt[1]*xt+Pt+It[1]),T.setColor(rT(nT(g,"paint","text-color",c,l,m),j)),B.setFill(T);var Ft=rT(nT(g,"paint","text-halo-color",c,l,m),j);if(Ft){O.setColor(Ft),Ct*=2;var Gt=.5*xt;O.setWidth(Ct<=Gt?Ct:Gt),B.setStroke(O)}else B.setStroke(void 0);var Ut=nT(g,"layout","text-padding",c,l,m),Bt=B.getPadding();Ut!==Bt[0]&&(Bt[0]=Ut,Bt[1]=Ut,Bt[2]=Ut,Bt[3]=Ut),I.setZIndex(P)}}},g=0,x=o.length;g-1?(E.length=d+1,sT&&("function"==typeof t.set?t.set("mapbox-layer",f):t.getProperties()["mapbox-layer"]=f),E):void 0}};return t.setStyle(A),t.set("mapbox-source",h),t.set("mapbox-layers",d),A}var uT=e(8338);function cT(t){return(cT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var fT,hT={},lT=/font-family: ?([^;]*);/,vT=/("|')/g;function dT(t){if(!fT){fT={};for(var n=document.styleSheets,e=0,r=n.length;e2?r[2]:""):t+e}function xT(t,n,e,r,i){return new Promise((function(o,s){if("object"!=cT(n)&&(n=JSON.parse(n)),8!=n.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Ik||t instanceof f_))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,u,c;function f(){c||n.sprite&&!a?c?(t.setStyle(c),o()):s(new Error("Something went wrong trying to apply style.")):(c=aT(t,n,e,i,a,u,mT),t.getStyle()?o():s(new Error("Nothing to show for source [".concat(e,"]"))))}if(n.sprite){var h=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",l=gT(n.sprite,r,h+".json");fetch(l,{credentials:"same-origin"}).then((function(t){return t.ok||""===h?t:(l=gT(n.sprite,r,".json"),fetch(l,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from ".concat(l,": ").concat(t.statusText)))})).then((function(t){if(void 0===t)return s(new Error("No sprites found."));a=t,u=gT(n.sprite,r,h+".png"),f()})).catch((function(t){s(new Error("Sprites cannot be loaded: ".concat(l,": ").concat(t.message)))}))}else f()}))}var kT={};function _T(t,n){var e={id:n.id,type:n.type},r={};function i(i){var o=n.layout||{},s=n.paint||{};e.paint=s;var a,u,c="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(i):t.getView().getZoom(),f="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==s["background-color"]&&(a=nT(e,"paint","background-color",c,kT,r),f&&(f.style.background=IS.parse(a).toString())),void 0!==s["background-opacity"]&&(u=nT(e,"paint","background-opacity",c,kT,r),f&&(f.style.opacity=u)),"none"!=o.visibility)return rT(a,u);f&&(f.style.backgroundColor="",f.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&i(),t.on(["change:resolution","change:target"],i);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(i)}}function ST(t){var n=t.bounds;if(n){var e=Sr([n[0],n[1]]),r=Sr([n[2],n[3]]);return[e[0],e[1],r[0],r[1]]}}function MT(t,n){t=PO({},t);var e=[n,JSON.stringify(t)].toString(),r=hT[e];return r||(r=new lx({url:t.tiles?void 0:n,tileJSON:t.tiles?t:void 0}),hT[e]=r),new Promise((function(t){var e=r.on("change",(function(){var i=r.getState();if("ready"===i){var o=r.getTileJSON(),s=Array.isArray(o.tiles)?o.tiles:[o.tiles];if(n)for(var a=0,u=s.length;a1&&!t.variables)throw new Error("Missing variables in style (expected "+r.variables+")");for(var v=function(n){var e=r.variables[n];if(!(e in t.variables))throw new Error("Missing '"+e+"' in style variables");var i=uv(e);h[i]=function(){var n=t.variables[e];return"string"==typeof n&&(n=Xl(r,n)),void 0!==n?n:-9999999}},d=0;d0){this.kv&&(this.kv.clear(),this.kv.addFeatures(h)),this.dispatchEvent(new ZT(VT,t,h,o));break}}},n.prototype.Mv=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this.xv=[X(n,q,this.handleDrop,this),X(n,U,this.handleStop,this),X(n,B,this.handleStop,this),X(n,q,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.Mv(),this.getActive()&&!n&&this.jv(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.jv(),t.prototype.setMap.call(this,n),this.getActive()&&this.Mv()},n.prototype.Sv=function(t,n,e){try{return t.readFeatures(n,e)}catch(t){return null}},n.prototype.jv=function(){this.xv&&(this.xv.forEach(J),this.xv=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,e=0,r=n.length;e1?1:-1;return n.endInteraction(this.zr,e),this.Oi=0,!1},n.prototype.handleDownEvent=function(t){return!!Lu(t)&&(!!this.Hr(t)&&(t.map.getView().beginInteraction(),this.Xr=void 0,this.Ov=void 0,!0))},n}(Mu),XT=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),YT=function(t){function n(n,e,r){var i=t.call(this)||this;if(void 0!==r&&void 0===e)i.setFlatCoordinates(r,n);else{var o=e||0;i.setCenterAndRadius(n,o,r)}return i}return XT(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,e,r){var i=this.flatCoordinates,o=t-i[0],s=n-i[1],a=o*o+s*s;if(a=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Bn(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,e=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+e;for(var i=1;i=this.Gv?(this.Av=n.pixel,this.Ev=!this.Pv,e=!0):this.Rv=void 0,this.Ev&&void 0!==this.Cv&&(clearTimeout(this.Cv),this.Cv=void 0));return this.Pv&&n.type===ha.POINTERDRAG&&null!==this.Bv?(this.Yv(n.coordinate),r=!1):this.Pv&&n.type===ha.POINTERDOWN?r=!1:e&&this.getPointerCount()<2?(r=n.type===ha.POINTERMOVE)&&this.Pv?(this.Hn(n),this.Ev&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===ha.POINTERDRAG&&void 0===this.Cv)&&this.Hn(n):n.type===ha.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this.Ev=!this.Pv,this.Pv?(this.Av=t.pixel,this.Uv||this.Jv(t.coordinate),!0):this.Hr(t)?(this.Rv=Date.now(),this.Cv=setTimeout(function(){this.Hn(new fa(ha.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Gv),this.Av=t.pixel,!0):(this.Rv=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.Cv&&(clearTimeout(this.Cv),this.Cv=void 0),this.Hn(t),this.Ev){var e=!this.Uv;e&&this.Jv(t.coordinate),!e&&this.Pv?this.finishDrawing():this.Pv||e&&this.yi!==tE||(this.Qv(t.pixel)?this.Fv(t)&&this.finishDrawing():this.Yv(t.coordinate)),n=!1}else this.Pv&&this.abortDrawing();return!n&&this.Nv&&t.preventDefault(),n},n.prototype.Hn=function(t){if(this.Iv=t.originalEvent.pointerType,this.Av&&(!this.Pv&&this.Ev||this.Pv&&!this.Ev)){var n=this.Av,e=t.pixel,r=n[0]-e[0],i=n[1]-e[1],o=r*r+i*i;if(this.Ev=this.Pv?o>this.Wv:o<=this.Wv,!this.Ev)return}this.Uv?this.td(t.coordinate):this.ed(t.coordinate.slice())},n.prototype.Qv=function(t){var n=!1;if(this.Bv){var e=!1,r=[this.Uv],i=this.yi;if(i===tE)n=!0;else if(i===rE)n=2===this.$v.length;else if(i===nE)e=this.$v.length>this.zv;else if(i===eE){var o=this.$v;e=o[0].length>this.zv,r=[o[0][0],o[0][o[0].length-2]]}if(e)for(var s=this.getMap(),a=0,u=r.length;a=this.Lv&&(this.Pv?e.pop():n=!0),e.push(t.slice()),this.qa(e,r,i)):o===eE&&((e=this.$v[0]).length>=this.Lv&&(this.Pv?e.pop():n=!0),e.push(t.slice()),n&&(this.Uv=e[0]),this.qa(this.$v,r,i)),this.ed(t.slice()),this.rd(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Bv){var t,n=this.Bv.getGeometry(),e=this.getMap().getView().getProjection(),r=this.yi;if(r===nE||r===rE){if((t=this.$v).splice(-2,1),t.length>=2){this.Uv=t[t.length-2].slice();var i=this.Uv.slice();t[t.length-1]=i,this.ed(i)}this.qa(t,n,e),n.getType()===It.POLYGON&&this.Vv&&this.od(n)}else if(r===eE){(t=this.$v[0]).splice(-2,1);var o=this.Vv.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.ed(i)}o.setCoordinates(t),this.qa(this.$v,n,e)}1===t.length&&this.abortDrawing(),this.rd()}},n.prototype.finishDrawing=function(){var t=this.sd();if(t){var n=this.$v,e=t.getGeometry(),r=this.getMap().getView().getProjection();this.yi===nE?(n.pop(),this.qa(n,e,r)):this.yi===eE&&(n[0].pop(),this.qa(n,e,r),n=e.getCoordinates()),this.Wh===It.MULTI_POINT?t.setGeometry(new Qk([n])):this.Wh===It.MULTI_LINE_STRING?t.setGeometry(new Yk([n])):this.Wh===It.MULTI_POLYGON&&t.setGeometry(new n_([n])),this.dispatchEvent(new aE(oE,t)),this.zi&&this.zi.push(t),this.kv&&this.kv.addFeature(t)}},n.prototype.sd=function(){this.Uv=null;var t=this.Bv;return this.Bv=null,this.qv=null,this.Vv=null,this.Hv.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.sd();t&&this.dispatchEvent(new aE(sE,t))},n.prototype.appendCoordinates=function(t){var n,e=this.yi,r=!this.Bv;if(r&&this.Jv(t[0]),e===nE||e===rE)n=this.$v;else{if(e!==eE)return;n=this.$v&&this.$v.length?this.$v[0]:[]}r&&n.shift(),n.pop();for(var i=0;ih?o[1]:o[0]),s}}return null},n.prototype.Hn=function(t){var n=t.pixel,e=t.map,r=this.yd(n,e);r||(r=e.getCoordinateFromPixelInternal(n)),this.md(r)},n.prototype.bd=function(t){var n=this.hd;return n?t?n.setGeometry(Hi(t)):n.setGeometry(void 0):(n=new Tt(t?Hi(t):{}),this.hd=n,this.vd.getSource().addFeature(n)),n},n.prototype.md=function(t){var n=this.ld;n?n.getGeometry().setCoordinates(t):(n=new Tt(new Mi(t)),this.ld=n,this.dd.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Hr(n)||(n.type!=ha.POINTERMOVE||this.handlingDownUpSequence||this.Hn(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,e=t.map,r=this.getExtentInternal(),i=this.yd(n,e),o=function(t){var n=null,e=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?e=r[3]:t[1]==r[3]&&(e=r[1]),null!==n&&null!==e?[n,e]:null};if(i&&r){var s=i[0]==r[0]||i[0]==r[2]?i[0]:null,a=i[1]==r[1]||i[1]==r[3]?i[1]:null;null!==s&&null!==a?this.ad=vE(o(i)):null!==s?this.ad=dE(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.ad=dE(o([r[0],a]),o([r[2],a])))}else i=e.getCoordinateFromPixelInternal(n),this.setExtent([i[0],i[1],i[0],i[1]]),this.ad=vE(i);return!0},n.prototype.handleDragEvent=function(t){if(this.ad){var n=t.coordinate;this.setExtent(this.ad(n)),this.md(n)}},n.prototype.handleUpEvent=function(t){this.ad=null;var n=this.getExtentInternal();return n&&0!==qn(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.vd.setMap(n),this.dd.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return Dr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.st},n.prototype.setExtent=function(t){this.st=t||null,this.bd(t),this.dispatchEvent(new hE(this.st))},n}(Mu);function yE(t){return(yE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var mE=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),bE=[0,0,0,0],wE=[],gE="modifystart",xE="modifyend",kE=function(t){function n(n,e,r){var i=t.call(this,n)||this;return i.features=e,i.mapBrowserEvent=r,i}return mE(n,t),n}(h);function _E(t,n){return t.index-n.index}function SE(t,n,e){var r=n.geometry;if(r.getType()===It.CIRCLE){var i=r;if(1===n.index){var o=Rr();o&&(i=i.clone().transform(o,e));var s=ar(i.getCenter(),Pr(t,e)),a=Math.sqrt(s)-i.getRadius();return a*a}}var u=Pr(t,e);return wE[0]=Pr(n.segment[0],e),wE[1]=Pr(n.segment[1],e),cr(u,wE)}function ME(t,n,e){var r=n.geometry;if(r.getType()===It.CIRCLE&&1===n.index){var i=r,o=Rr();return o&&(i=i.clone().transform(o,e)),Ir(i.getClosestPoint(Pr(t,e)),e)}var s=Pr(t,e);return wE[0]=Pr(n.segment[0],e),wE[1]=Pr(n.segment[1],e),Ir(nr(s,wE),e)}var jE=function(t){function n(n){var e,r,i=t.call(this,n)||this;if(i.on,i.once,i.un,i.wd=i.Hu.bind(i),i.Hr=n.condition?n.condition:Fu,i.gd=function(t){return Ou(t)&&Pu(t)},i.xd=n.deleteCondition?n.deleteCondition:i.gd,i.kd=n.insertVertexCondition?n.insertVertexCondition:Cu,i.ld=null,i._d=null,i.Sd=[0,0],i.Md=!1,i.jd=null,i.Od=new Jv,i.ud=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.fd=!1,i.Td=!1,i.Ed=[],i.Hv=new Ik({source:new Ad({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:(e=$v(),function(t,n){return e[It.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.Ad={Point:i.Cd.bind(i),LineString:i.Rd.bind(i),LinearRing:i.Rd.bind(i),Polygon:i.Id.bind(i),MultiPoint:i.Pd.bind(i),MultiLineString:i.Dd.bind(i),MultiPolygon:i.Nd.bind(i),Circle:i.zd.bind(i),GeometryCollection:i.Ld.bind(i)},i.kv=null,i.Fd=null,n.features?r=n.features:n.source&&(i.kv=n.source,r=new ht(i.kv.getFeatures()),i.kv.addEventListener(xd,i.Gd.bind(i)),i.kv.addEventListener(Sd,i.Ud.bind(i))),!r)throw new Error("The modify interaction requires features, a source or a layer");return n.hitDetection&&(i.Fd=n.hitDetection),i.zi=r,i.zi.forEach(i.Bd.bind(i)),i.zi.addEventListener(st,i.qd.bind(i)),i.zi.addEventListener(at,i.$d.bind(i)),i.Vd=null,i.Br=[0,0],i.Zd=void 0===n.snapToPointer?!i.Fd:n.snapToPointer,i}return mE(n,t),n.prototype.Bd=function(t){var n=t.getGeometry();if(n){var e=this.Ad[n.getType()];e&&e(t,n)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.Wd(this.Sd,r),t.addEventListener(D,this.wd)},n.prototype.Hd=function(t,n){if(!this.jd){this.jd=new ht;for(var e=this.jd.getArray(),r=0,i=n.length;r=0;--r){for(var i=e[r],o=this.Ed.length-1;o>=0;--o)this.Ed[o][0]===i&&this.Ed.splice(o,1);n.remove(i)}},n.prototype.setActive=function(n){this.ld&&!n&&(this.Hv.getSource().removeFeature(this.ld),this.ld=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Hv.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Hv},n.prototype.Gd=function(t){t.feature&&this.zi.push(t.feature)},n.prototype.Ud=function(t){t.feature&&this.zi.remove(t.feature)},n.prototype.qd=function(t){this.Bd(t.element)},n.prototype.Hu=function(t){if(!this.Td){var n=t.target;this.Kd(n),this.Bd(n)}},n.prototype.$d=function(t){var n=t.element;this.Kd(n)},n.prototype.Cd=function(t,n){var e=n.getCoordinates(),r={feature:t,geometry:n,segment:[e,e]};this.Od.insert(n.getExtent(),r)},n.prototype.Pd=function(t,n){for(var e=n.getCoordinates(),r=0,i=e.length;r=0;--y)this.Qd(i[y],s)}return!!this.ld},n.prototype.handleUpEvent=function(t){for(var n=this.Ed.length-1;n>=0;--n){var e=this.Ed[n][0],r=e.geometry;if(r.getType()===It.CIRCLE){var i=r.getCenter(),o=e.featureSegments[0],s=e.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.Od.update(Rn(i),o);var a=r,u=Rr();if(u){var c=t.map.getView().getProjection();a=Ki(a=a.clone().transform(u,c)).transform(c,u)}this.Od.update(a.getExtent(),s)}else this.Od.update(xn(e.segment),e)}return this.jd&&(this.dispatchEvent(new kE(xE,this.jd,t)),this.jd=null),!1},n.prototype.Hn=function(t){this.Sd=t.pixel,this.Wd(t.pixel,t.map,t.coordinate)},n.prototype.Wd=function(t,n,e){var r,i,s=this,a=e||n.getCoordinateFromPixel(t),u=n.getView().getProjection();if(this.Fd){var c="object"===yE(this.Fd)?function(t){return t===s.Fd}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,e){if((e=e||t.getGeometry()).getType()===It.POINT&&y(s.zi.getArray(),t)){i=e;var o=e.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:e,segment:[o,o]}]}return!0}),{layerFilter:c})}if(!r){var f=Dr(kn(Nr(Rn(a,bE),u),n.getView().getResolution()*this.ud,bE),u);r=this.Od.getInExtent(f)}if(r&&r.length>0){var h=r.sort((function(t,n){return SE(a,t,u)-SE(a,n,u)}))[0],l=h.segment,v=ME(a,h,u),d=n.getPixelFromCoordinate(v),p=ur(t,d);if(i||p<=this.ud){var m={};if(m[o(l)]=!0,this.Zd||(this.Br[0]=v[0]-a[0],this.Br[1]=v[1]-a[1]),h.geometry.getType()===It.CIRCLE&&1===h.index)this.fd=!0,this.Yd(v,[h.feature],[h.geometry]);else{var b=n.getPixelFromCoordinate(l[0]),w=n.getPixelFromCoordinate(l[1]),g=ar(d,b),x=ar(d,w);p=Math.sqrt(Math.min(g,x)),this.fd=p<=this.ud,this.fd&&(v=g>x?l[1]:l[0]),this.Yd(v,[h.feature],[h.geometry]);var k={};k[o(h.geometry)]=!0;for(var _=1,S=r.length;_=0;--i)h=o((f=(e=l[i])[0]).feature),f.depth&&(h+="-"+f.depth.join("-")),h in v||(v[h]={}),0===e[1]?(v[h].right=f,v[h].index=f.index):1==e[1]&&(v[h].left=f,v[h].index=f.index+1);for(h in v){switch(c=v[h].right,a=v[h].left,(u=(s=v[h].index)-1)<0&&(u=0),t=n=(r=(f=void 0!==a?a:c).geometry).getCoordinates(),d=!1,r.getType()){case It.MULTI_LINE_STRING:n[f.depth[0]].length>2&&(n[f.depth[0]].splice(s,1),d=!0);break;case It.LINE_STRING:n.length>2&&(n.splice(s,1),d=!0);break;case It.MULTI_POLYGON:t=t[f.depth[1]];case It.POLYGON:(t=t[f.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.Jd(r,n);var p=[];if(void 0!==a&&(this.Od.remove(a),p.push(a.segment[0])),void 0!==c&&(this.Od.remove(c),p.push(c.segment[1])),void 0!==a&&void 0!==c){var y={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:p};this.Od.insert(xn(y.segment),y)}this.tp(r,s,f.depth,-1),this.ld&&(this.Hv.getSource().removeFeature(this.ld),this.ld=null),l.length=0}}return d},n.prototype.Jd=function(t,n){this.Td=!0,t.setCoordinates(n),this.Td=!1},n.prototype.tp=function(t,n,e,r){this.Od.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===e||void 0===i.depth||x(i.depth,e))&&i.index>n&&(i.index+=r)}))},n}(Mu),OE=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),TE="select",EE=function(t){function n(n,e,r,i){var o=t.call(this,n)||this;return o.selected=e,o.deselected=r,o.mapBrowserEvent=i,o}return OE(n,t),n}(h),AE={};var CE=function(t){function n(n){var e=t.call(this)||this;e.on,e.once,e.un;var r,i,o=n||{};if(e.ep=e.Bd.bind(e),e.rp=e.Kd.bind(e),e.Hr=o.condition?o.condition:Pu,e.ip=o.addCondition?o.addCondition:Iu,e.op=o.removeCondition?o.removeCondition:Iu,e.sp=o.toggleCondition?o.toggleCondition:Nu,e.ap=!!o.multi&&o.multi,e.up=o.filter?o.filter:S,e.cp=o.hitTolerance?o.hitTolerance:0,e.K=void 0!==o.style?o.style:(w((r=$v())[It.POLYGON],r[It.LINE_STRING]),w(r[It.GEOMETRY_COLLECTION],r[It.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),e.zi=o.features||new ht,o.layers)if("function"==typeof o.layers)i=o.layers;else{var s=o.layers;i=function(t){return y(s,t)}}else i=S;return e.fp=i,e.hp={},e}return OE(n,t),n.prototype.lp=function(t,n){this.hp[o(t)]=n},n.prototype.getFeatures=function(){return this.zi},n.prototype.getHitTolerance=function(){return this.cp},n.prototype.getLayer=function(t){return this.hp[o(t)]},n.prototype.setHitTolerance=function(t){this.cp=t},n.prototype.setMap=function(n){this.getMap()&&this.K&&this.zi.forEach(this.vp.bind(this)),t.prototype.setMap.call(this,n),n?(this.zi.addEventListener(st,this.ep),this.zi.addEventListener(at,this.rp),this.K&&this.zi.forEach(this.dp.bind(this))):(this.zi.removeEventListener(st,this.ep),this.zi.removeEventListener(at,this.rp))},n.prototype.Bd=function(t){var n=t.element;if(this.K&&this.dp(n),!this.getLayer(n)){var e=this.getMap().getAllLayers().find((function(t){if(t instanceof Ik&&t.getSource()&&t.getSource().hasFeature(n))return t}));e&&this.lp(n,e)}},n.prototype.Kd=function(t){var n=t.element;this.K&&this.vp(n)},n.prototype.getStyle=function(){return this.K},n.prototype.dp=function(t){var n=o(t);n in AE||(AE[n]=t.getStyle()),t.setStyle(this.K)},n.prototype.vp=function(t){for(var e=this.getMap().getInteractions().getArray(),r=e.length-1;r>=0;--r){var i=e[r];if(i!==this&&i instanceof n&&i.getStyle()&&-1!==i.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(i.getStyle())}var s=o(t);t.setStyle(AE[s]),delete AE[s]},n.prototype.pp=function(t){delete this.hp[o(t)]},n.prototype.handleEvent=function(t){if(!this.Hr(t))return!0;var n=this.ip(t),e=this.op(t),r=this.sp(t),i=!n&&!e&&!r,o=t.map,s=this.getFeatures(),a=[],u=[];if(i){A(this.hp),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.up(t,n))return this.lp(t,n),u.push(t),!this.ap}.bind(this),{layerFilter:this.fp,hitTolerance:this.cp});for(var c=s.getLength()-1;c>=0;--c){var f=s.item(c),h=u.indexOf(f);h>-1?u.splice(h,1):(s.remove(f),a.push(f))}0!==u.length&&s.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.up(t,i))return!n&&!r||y(s.getArray(),t)?(e||r)&&y(s.getArray(),t)&&(a.push(t),this.pp(t)):(this.lp(t,i),u.push(t)),!this.ap}.bind(this),{layerFilter:this.fp,hitTolerance:this.cp});for(var l=a.length-1;l>=0;--l)s.remove(a[l]);s.extend(u)}return(u.length>0||a.length>0)&&this.dispatchEvent(new EE(TE,u,a,t)),!0},n}(gu),RE=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function IE(t){return t.feature?t.feature:t.element?t.element:void 0}var PE=[],DE=function(t){function n(n){var e=this,r=n||{},i=r;return i.handleDownEvent||(i.handleDownEvent=S),i.stopDown||(i.stopDown=M),(e=t.call(this,i)||this).kv=r.source?r.source:null,e.yp=void 0===r.vertex||r.vertex,e.mp=void 0===r.edge||r.edge,e.zi=r.features?r.features:null,e.bp=[],e.wp={},e.gp={},e.xp={},e.ud=void 0!==r.pixelTolerance?r.pixelTolerance:10,e.Od=new Jv,e.Ad={Point:e.Cd.bind(e),LineString:e.Rd.bind(e),LinearRing:e.Rd.bind(e),Polygon:e.Id.bind(e),MultiPoint:e.Pd.bind(e),MultiLineString:e.Dd.bind(e),MultiPolygon:e.Nd.bind(e),GeometryCollection:e.Ld.bind(e),Circle:e.zd.bind(e)},e}return RE(n,t),n.prototype.addFeature=function(t,n){var e=void 0===n||n,r=o(t),i=t.getGeometry();if(i){var s=this.Ad[i.getType()];s&&(this.gp[r]=i.getExtent([1/0,1/0,-1/0,-1/0]),s(t,i))}e&&(this.wp[r]=X(t,D,this.Hu,this))},n.prototype.kp=function(t){this.addFeature(t)},n.prototype._p=function(t){this.removeFeature(t)},n.prototype.Sp=function(){var t;return this.zi?t=this.zi:this.kv&&(t=this.kv.getFeatures()),t},n.prototype.handleEvent=function(n){var e=this.snapTo(n.pixel,n.coordinate,n.map);return e.snapped&&(n.coordinate=e.vertex.slice(0,2),n.pixel=e.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.qd=function(t){var n=IE(t);this.addFeature(n)},n.prototype.$d=function(t){var n=IE(t);this.removeFeature(n)},n.prototype.Hu=function(t){var n=t.target;if(this.handlingDownUpSequence){var e=o(n);e in this.xp||(this.xp[e]=n)}else this.Mp(n)},n.prototype.handleUpEvent=function(t){var n=C(this.xp);return n.length&&(n.forEach(this.Mp.bind(this)),this.xp={}),!1},n.prototype.removeFeature=function(t,n){var e=void 0===n||n,r=o(t),i=this.gp[r];if(i){var s=this.Od,a=[];s.forEachInExtent(i,(function(n){t===n.feature&&a.push(n)}));for(var u=a.length-1;u>=0;--u)s.remove(a[u])}e&&(J(this.wp[r]),delete this.wp[r])},n.prototype.setMap=function(n){var e=this.getMap(),r=this.bp,i=this.Sp();e&&(r.forEach(J),r.length=0,i.forEach(this._p.bind(this))),t.prototype.setMap.call(this,n),n&&(this.zi?r.push(X(this.zi,st,this.qd,this),X(this.zi,at,this.$d,this)):this.kv&&r.push(X(this.kv,xd,this.qd,this),X(this.kv,Sd,this.$d,this)),i.forEach(this.kp.bind(this)))},n.prototype.snapTo=function(t,n,e){var r=xn([e.getCoordinateFromPixel([t[0]-this.ud,t[1]+this.ud]),e.getCoordinateFromPixel([t[0]+this.ud,t[1]-this.ud])]),i=this.Od.getInExtent(r);this.yp&&!this.mp&&(i=i.filter((function(t){return t.feature.getGeometry().getType()!==It.CIRCLE})));var o=!1,s=null,a=null;if(0===i.length)return{snapped:o,vertex:s,vertexPixel:a};for(var u,c=e.getView().getProjection(),f=Pr(n,c),h=1/0,l=0;lw?p[1]:p[0],a=e.getPixelFromCoordinate(s))}else if(this.mp){var g=u.feature.getGeometry().getType()===It.CIRCLE;if(g){var x=u.feature.getGeometry(),k=Rr();k&&(x=x.clone().transform(k,c)),s=Ir(tr(f,x),c)}else PE[0]=Pr(p[0],c),PE[1]=Pr(p[1],c),s=Ir(nr(f,PE),c);if(ur(t,a=e.getPixelFromCoordinate(s))<=this.ud&&(o=!0,this.yp&&!g)){y=e.getPixelFromCoordinate(p[0]),m=e.getPixelFromCoordinate(p[1]),b=ar(a,y),w=ar(a,m);Math.sqrt(Math.min(b,w))<=this.ud&&(s=b>w?p[1]:p[0],a=e.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},n.prototype.Mp=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},n.prototype.zd=function(t,n){var e=this.getMap().getView().getProjection(),r=n,i=Rr();i&&(r=r.clone().transform(i,e));var o=Ki(r);i&&o.transform(e,i);for(var s=o.getCoordinates()[0],a=0,u=s.length-1;a=0;e--){var c=o[e][0];if(jn(new _i(c).getExtent(),new _i(a).getExtent())){o[e].push(a),u=!0;break}}u||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(i=It.POLYGON,t=E({},t,((e={}).rings=a[0],e))):(i=It.MULTI_POLYGON,t=E({},t,((r={}).rings=a,r)))}return Hk((0,$E[i])(t),!1,n)}function WE(t){var n=Et;return!0===t.hasZ&&!0===t.hasM?n=Rt:!0===t.hasZ?n=At:!0===t.hasM&&(n=Ct),n}function HE(t){var n=t.getLayout();return{hasZ:n===At||n===Rt,hasM:n===Ct||n===Rt}}function KE(t,n){return(0,VE[t.getType()])(Hk(t,!0,n),n)}VE[It.POINT]=function(t,n){var e,r=t.getCoordinates(),i=t.getLayout();i===At?e={x:r[0],y:r[1],z:r[2]}:i===Ct?e={x:r[0],y:r[1],m:r[2]}:i===Rt?e={x:r[0],y:r[1],z:r[2],m:r[3]}:i===Et?e={x:r[0],y:r[1]}:Mt(!1,34);return e},VE[It.LINE_STRING]=function(t,n){var e=HE(t);return{hasZ:e.hasZ,hasM:e.hasM,paths:[t.getCoordinates()]}},VE[It.POLYGON]=function(t,n){var e=HE(t);return{hasZ:e.hasZ,hasM:e.hasM,rings:t.getCoordinates(!1)}},VE[It.MULTI_POINT]=function(t,n){var e=HE(t);return{hasZ:e.hasZ,hasM:e.hasM,points:t.getCoordinates()}},VE[It.MULTI_LINE_STRING]=function(t,n){var e=HE(t);return{hasZ:e.hasZ,hasM:e.hasM,paths:t.getCoordinates()}},VE[It.MULTI_POLYGON]=function(t,n){for(var e=HE(t),r=t.getCoordinates(!1),i=[],o=0;o=0;s--)i.push(r[o][s]);return{hasZ:e.hasZ,hasM:e.hasM,rings:i}};var XE=function(t){function n(n){var e=this,r=n||{};return(e=t.call(this)||this).H=r.geometryName,e}return qE(n,t),n.prototype.readFeatureFromObject=function(t,n,e){var r=t,i=ZE(r.geometry,n),o=new Tt;if(this.H&&o.setGeometryName(this.H),o.setGeometry(i),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[e];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var e=n||{};if(t.features){for(var r=[],i=t.features,o=0,s=i.length;o0?e[0]:null},n.prototype.readFeatureFromNode=function(t,n){return null},n.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var e=mh(t);return this.readFeaturesFromDocument(e,n)}return ph(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},n.prototype.readFeaturesFromDocument=function(t,n){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&w(e,this.readFeaturesFromNode(r,n));return e},n.prototype.readFeaturesFromNode=function(t,n){return r()},n.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var e=mh(t);return this.readGeometryFromDocument(e,n)}return ph(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},n.prototype.readGeometryFromDocument=function(t,n){return null},n.prototype.readGeometryFromNode=function(t,n){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=mh(t);return this.readProjectionFromDocument(n)}return ph(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){var e=this.writeFeatureNode(t,n);return this.Cp.serializeToString(e)},n.prototype.writeFeatureNode=function(t,n){return null},n.prototype.writeFeatures=function(t,n){var e=this.writeFeaturesNode(t,n);return this.Cp.serializeToString(e)},n.prototype.writeFeaturesNode=function(t,n){return null},n.prototype.writeGeometry=function(t,n){var e=this.writeGeometryNode(t,n);return this.Cp.serializeToString(e)},n.prototype.writeGeometryNode=function(t,n){return null},n}(Wk),QE=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tA="http://www.opengis.net/gml",nA=/^[\s\xa0]*$/,eA=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.featureType=r.featureType,e.featureNS=r.featureNS,e.srsName=r.srsName,e.schemaLocation="",e.FEATURE_COLLECTION_PARSERS={},e.FEATURE_COLLECTION_PARSERS[e.namespace]={featureMember:wh(e.readFeaturesInternal),featureMembers:gh(e.readFeaturesInternal)},e.supportedMediaTypes=["application/gml+xml"],e}return QE(n,t),n.prototype.readFeaturesInternal=function(t,n){var e=t.localName,r=null;if("FeatureCollection"==e)r=Ah([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==e||"featureMember"==e||"member"==e){var i=n[0],o=i.featureType,s=i.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,u=t.childNodes.length;a0){i[a]={Rp:i[a]};for(var c=0;c0:h===It.POINT||h===It.MULTI_POINT}}a&&(u=o.get("name"),(a=a&&!!u)&&u.search(/&[^&]+;/)>-1&&(KC||(KC=document.createElement("textarea")),KC.innerHTML=u,u=KC.value));var l=e;if(t?l=t:n&&(l=tR(n,e,r)),a){var v=function(t,n){var e=[0,0],r="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();e[0]=s[0]*(o[0]-a[0]),e[1]=s[1]*(o[1]/2-a[1]),r="left"}}var u=t.getText();u?((u=u.clone()).setFont(u.getFont()||WC.getFont()),u.setScale(u.getScale()||WC.getScale()),u.setFill(u.getFill()||WC.getFill()),u.setStroke(u.getStroke()||VC)):u=WC.clone();return u.setText(n),u.setOffsetX(e[0]),u.setOffsetY(e[1]),u.setTextAlign(r),new Zv({image:i,text:u})}(l[0],u);return c.length>0?(v.setGeometry(new v_(c)),[v,new Zv({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(e.Style,e.styleUrl,this.Qp,this.ey,this.iy);r.setStyle(a)}return delete e.Style,r.setProperties(e,!0),r}},n.prototype.hy=function(t,n){var e=t.getAttribute("id");if(null!==e){var r=ER.call(this,t,n);if(r){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+e,o).href;else i="#"+e;this.ey[i]=r}}},n.prototype.ly=function(t,n){var e=t.getAttribute("id");if(null!==e){var r=aR.call(this,t,n);if(r){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+e,o).href;else i="#"+e;this.ey[i]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!y(PC,t.namespaceURI))return null;var e=this.uy(t,[this.getReadOptions(t,n)]);return e||null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(PC,t.namespaceURI))return[];var e,r=t.localName;if("Document"==r||"Folder"==r)return(e=this.sy(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var i=this.uy(t,[this.getReadOptions(t,n)]);return i?[i]:[]}if("kml"==r){e=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&w(e,s)}return e}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=mh(t);return this.readNameFromDocument(n)}return ph(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var e=this.readNameFromNode(n);if(e)return e}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(y(PC,n.namespaceURI)&&"name"==n.localName)return hA(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var e=n.localName;if(y(PC,n.namespaceURI)&&("Document"==e||"Folder"==e||"Placemark"==e||"kml"==e)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var e=mh(t);w(n,this.readNetworkLinksFromDocument(e))}else ph(t)?w(n,this.readNetworkLinksFromDocument(t)):w(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],e=t.firstChild;e;e=e.nextSibling)e.nodeType==Node.ELEMENT_NODE&&w(n,this.readNetworkLinksFromNode(e));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],e=t.firstElementChild;e;e=e.nextElementSibling)if(y(PC,e.namespaceURI)&&"NetworkLink"==e.localName){var r=Ah({},zC,e,[]);n.push(r)}for(e=t.firstElementChild;e;e=e.nextElementSibling){var i=e.localName;!y(PC,e.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||w(n,this.readNetworkLinksFromNode(e))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var e=mh(t);w(n,this.readRegionFromDocument(e))}else ph(t)?w(n,this.readRegionFromDocument(t)):w(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],e=t.firstChild;e;e=e.nextSibling)e.nodeType==Node.ELEMENT_NODE&&w(n,this.readRegionFromNode(e));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],e=t.firstElementChild;e;e=e.nextElementSibling)if(y(PC,e.namespaceURI)&&"Region"==e.localName){var r=Ah({},FC,e,[]);n.push(r)}for(e=t.firstElementChild;e;e=e.nextElementSibling){var i=e.localName;!y(PC,e.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||w(n,this.readRegionFromNode(e))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var e=lh(PC[4],"kml"),r="http://www.w3.org/2000/xmlns/";e.setAttributeNS(r,"xmlns:gx",IC[0]),e.setAttributeNS(r,"xmlns:xsi",hh),e.setAttributeNS(hh,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:e},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=GC[e.namespaceURI],a=Oh(o,s);return Rh(i,UC,jh,a,[n],s,this),e},n}(JE);function tR(t,n,e){return Array.isArray(t)?t:"string"==typeof t?tR(e[t],n,e):n}function nR(t){var n=vh(t,!1),e=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(e){var r=e[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function eR(t){var n=vh(t,!1),e=[];n=n.replace(/\s*,\s*/g,",");for(var r,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=i.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;e.push(o,s,a),n=n.substr(r[0].length)}if(""===n)return e}function rR(t){var n=vh(t,!1).trim(),e=t.baseURI;return e&&"about:blank"!=e||(e=window.location.href),e?new URL(n,e).href:n}function iR(t){var n=vh(t,!1).trim().replace(/^(?!.*#)/,"#"),e=t.baseURI;return e&&"about:blank"!=e||(e=window.location.href),e?new URL(n,e).href:n}function oR(t){return aA(t)}var sR=Th(PC,{Pair:function(t,n){var e=Ah({},DR,t,n,this);if(!e)return;var r=e.key;if(r&&"normal"==r){var i=e.styleUrl;i&&(n[n.length-1]=i);var o=e.Style;o&&(n[n.length-1]=o)}}});function aR(t,n){return Ah(void 0,sR,t,n,this)}var uR=Th(PC,{Icon:kh((function(t,n){var e=Ah({},mR,t,n);return e||null})),color:kh(nR),heading:kh(aA),hotSpot:kh((function(t){var n,e=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==e?"insetPixels"!==r?Ov:Ev:"insetPixels"!==r?Tv:Av,{x:parseFloat(t.getAttribute("x")),xunits:DC[e],y:parseFloat(t.getAttribute("y")),yunits:DC[r],origin:n}})),scale:kh(oR)});var cR=Th(PC,{color:kh(nR),scale:kh(oR)});var fR=Th(PC,{color:kh(nR),width:kh(aA)});var hR=Th(PC,{color:kh(nR),fill:kh(iA),outline:kh(iA)});var lR=Th(PC,{coordinates:gh(eR)});function vR(t,n){return Ah(null,lR,t,n)}var dR=Th(IC,{Track:wh(yR)});var pR=Th(PC,{when:function(t,n){var e=n[n.length-1].whens,r=vh(t,!1),i=Date.parse(r);e.push(isNaN(i)?0:i)}},Th(IC,{coord:function(t,n){var e=n[n.length-1].coordinates,r=vh(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);e.push([o,s,a])}else e.push([])}}));function yR(t,n){var e=Ah({coordinates:[],whens:[]},pR,t,n);if(e){for(var r=[],i=e.coordinates,o=e.whens,s=0,a=Math.min(i.length,o.length);s0){var r=n[n.length-1];r.push.apply(r,e)}},outerBoundaryIs:function(t,n){var e=Ah(void 0,GR,t,n);if(e){n[n.length-1][0]=e}}});function OR(t,n){var e=Ah({},gR,t,n),r=Ah([null],jR,t,n);if(r&&r[0]){for(var i=r[0],o=[i.length],s=1,a=r.length;s0,f=u.href;f?r=f:c&&(r=CC);var h,l=Ov,v=e.hotSpot;v?(i=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(i=OC,o=TC,s=EC):/arrow-reverse/.test(r)?(i=[54,42],o=TC,s=EC):/paddle/.test(r)&&(i=[32,1],o=TC,s=EC));var d,p=u.x,y=u.y;void 0!==p&&void 0!==y&&(h=[p,y]);var m,b=u.w,w=u.h;void 0!==b&&void 0!==w&&(d=[b,w]);var g=e.heading;void 0!==g&&(m=pe(g));var x=e.scale,k=e.color;if(c){r==CC&&(d=AC);var _=new zv({anchor:i,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.qt,offset:h,offsetOrigin:Ov,rotation:m,scale:x,size:d,src:this.oy(r),color:k}),S=_.getScaleArray()[0],M=_.getSize();if(null===M){var j=_.getImageState();if(j===lo||j===vo){_.listenImageChange((function t(){var n=_.getImageState();if(n!==lo&&n!==vo){var e=_.getSize();if(e&&2==e.length){var r=YC(e);_.setScale(S*r)}_.unlistenImageChange(t)}})),j===lo&&_.load()}}else if(2==M.length){var O=YC(M);_.setScale(S*O)}a.imageStyle=_}else a.imageStyle=qC}},LabelStyle:function(t,n){var e=Ah({},cR,t,n);if(e){var r=n[n.length-1],i=new Kv({fill:new Sv({color:"color"in e?e.color:jC}),scale:e.scale});r.textStyle=i}},LineStyle:function(t,n){var e=Ah({},fR,t,n);if(e){var r=n[n.length-1],i=new Lv({color:"color"in e?e.color:jC,width:"width"in e?e.width:1});r.strokeStyle=i}},PolyStyle:function(t,n){var e=Ah({},hR,t,n);if(e){var r=n[n.length-1],i=new Sv({color:"color"in e?e.color:jC});r.fillStyle=i;var o=e.fill;void 0!==o&&(r.fill=o);var s=e.outline;void 0!==s&&(r.outline=s)}}});function ER(t,n){var e=Ah({},TR,t,n,this);if(!e)return null;var r,i="fillStyle"in e?e.fillStyle:BC,o=e.fill;void 0===o||o||(i=null),"imageStyle"in e?e.imageStyle!=qC&&(r=e.imageStyle):r=$C;var s="textStyle"in e?e.textStyle:WC,a="strokeStyle"in e?e.strokeStyle:ZC,u=e.outline;return void 0===u||u?[new Zv({fill:i,image:r,stroke:a,text:s,zIndex:void 0})]:[new Zv({geometry:function(t){var n=t.getGeometry(),e=n.getType();return e===It.GEOMETRY_COLLECTION?new v_(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n!==It.POLYGON&&n!==It.MULTI_POLYGON}))):e!==It.POLYGON&&e!==It.MULTI_POLYGON?n:void 0},fill:i,image:r,stroke:a,text:s,zIndex:void 0}),new Zv({geometry:function(t){var n=t.getGeometry(),e=n.getType();return e===It.GEOMETRY_COLLECTION?new v_(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return n===It.POLYGON||n===It.MULTI_POLYGON}))):e===It.POLYGON||e===It.MULTI_POLYGON?n:void 0},fill:i,stroke:null,zIndex:void 0})]}function AR(t,n){var e,r,i,o=n.length,s=new Array(n.length),a=new Array(n.length),u=new Array(n.length);e=!1,r=!1,i=!1;for(var c=0;c0){var m=Oh(i,s);Rh(r,hI,vI,[{names:s,values:m}],e)}var b=e[0],w=n.getGeometry();w&&(w=Hk(w,!0,b)),Rh(r,hI,eI,[w],e)}var pI=Th(PC,["extrude","tessellate","altitudeMode","coordinates"]),yI=Th(PC,{extrude:_h(lA),tessellate:_h(lA),altitudeMode:_h(mA),coordinates:_h((function(t,n,e){var r,i=e[e.length-1],o=i.layout,s=i.stride;o==Et||o==Ct?r=2:o==At||o==Rt?r=3:Mt(!1,34);var a=n.length,u="";if(a>0){u+=n[0];for(var c=1;c>1):i>>1}return n}function cP(t){for(var n="",e=0,r=t.length;e=32;)n=63+(32|31&t),e+=String.fromCharCode(n),t>>=5;return n=t+63,e+=String.fromCharCode(n)}var lP=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.dataProjection=mr("EPSG:4326"),e.vy=r.factor?r.factor:1e5,e.py=r.geometryLayout?r.geometryLayout:Et,e}return eP(n,t),n.prototype.readFeatureFromText=function(t,n){var e=this.readGeometryFromText(t,n);return new Tt(e)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var e=Kr(this.py),r=iP(t,e,this.vy);BE(r,0,r.length,e,r);var i=yi(r,0,r.length,e);return Hk(new Ck(i,this.py),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var e=t.getGeometry();return e?this.writeGeometryText(e,n):(Mt(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var e=(t=Hk(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return BE(e,0,e.length,r,e),rP(e,r,this.vy)},n}(pC),vP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),dP=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.Yl=r.layerName,e.Gc=r.layers?r.layers:null,e.dataProjection=mr(r.dataProjection?r.dataProjection:"EPSG:4326"),e}return vP(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var e=t,r=void 0,i=null,o=null;e.transform&&(i=(r=e.transform).scale,o=r.translate);var s=e.arcs;r&&function(t,n,e){for(var r=0,i=t.length;r0&&r.pop(),e>=0)for(var s=0,a=(u=n[e]).length;s=0;--s)r.push(u[s].slice(0))}return r}function mP(t,n,e,r,i,o,s){for(var a=t.geometries,u=[],c=0,f=a.length;c=2,57),r}return _P(n,t),n}(kP),MP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),jP=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return MP(n,t),n}(SP),OP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),TP=function(t){function n(n,e,r){var i=t.call(this,"BBOX")||this;if(i.geometryName=n,i.extent=e,4!==e.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=r,i}return OP(n,t),n}(kP),EP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),AP=function(t){function n(n,e,r,i){var o=t.call(this,n)||this;return o.geometryName=e||"the_geom",o.geometry=r,o.srsName=i,o}return EP(n,t),n}(kP),CP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),RP=function(t){function n(n,e,r){return t.call(this,"Contains",n,e,r)||this}return CP(n,t),n}(AP),IP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),PP=function(t){function n(n,e,r,i,o){var s=t.call(this,"DWithin",n,e,o)||this;return s.distance=r,s.unit=i,s}return IP(n,t),n}(AP),DP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),NP=function(t){function n(n,e,r){return t.call(this,"Disjoint",n,e,r)||this}return DP(n,t),n}(AP),zP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),LP=function(t){function n(n,e){var r=t.call(this,n)||this;return r.propertyName=e,r}return zP(n,t),n}(kP),FP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),GP=function(t){function n(n,e,r){var i=t.call(this,"During",n)||this;return i.begin=e,i.end=r,i}return FP(n,t),n}(LP),UP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),BP=function(t){function n(n,e,r,i){var o=t.call(this,n,e)||this;return o.expression=r,o.matchCase=i,o}return UP(n,t),n}(LP),qP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),$P=function(t){function n(n,e,r){return t.call(this,"PropertyIsEqualTo",n,e,r)||this}return qP(n,t),n}(BP),VP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ZP=function(t){function n(n,e){return t.call(this,"PropertyIsGreaterThan",n,e)||this}return VP(n,t),n}(BP),WP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),HP=function(t){function n(n,e){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,e)||this}return WP(n,t),n}(BP),KP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),XP=function(t){function n(n,e,r){return t.call(this,"Intersects",n,e,r)||this}return KP(n,t),n}(AP),YP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),JP=function(t){function n(n,e,r){var i=t.call(this,"PropertyIsBetween",n)||this;return i.lowerBoundary=e,i.upperBoundary=r,i}return YP(n,t),n}(LP),QP=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),tD=function(t){function n(n,e,r,i,o,s){var a=t.call(this,"PropertyIsLike",n)||this;return a.pattern=e,a.wildCard=void 0!==r?r:"*",a.singleChar=void 0!==i?i:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return QP(n,t),n}(LP),nD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),eD=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return nD(n,t),n}(LP),rD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),iD=function(t){function n(n,e){return t.call(this,"PropertyIsLessThan",n,e)||this}return rD(n,t),n}(BP),oD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),sD=function(t){function n(n,e){return t.call(this,"PropertyIsLessThanOrEqualTo",n,e)||this}return oD(n,t),n}(BP),aD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),uD=function(t){function n(n){var e=t.call(this,"Not")||this;return e.condition=n,e}return aD(n,t),n}(kP),cD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),fD=function(t){function n(n,e,r){return t.call(this,"PropertyIsNotEqualTo",n,e,r)||this}return cD(n,t),n}(BP),hD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),lD=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return hD(n,t),n}(SP),vD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),dD=function(t){function n(n){var e=t.call(this,"ResourceId")||this;return e.rid=n,e}return vD(n,t),n}(kP),pD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),yD=function(t){function n(n,e,r){return t.call(this,"Within",n,e,r)||this}return pD(n,t),n}(AP);function mD(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(jP,n))}function bD(t,n,e){return new TP(t,n,e)}var wD=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),gD={"http://www.opengis.net/gml":{boundedBy:kh(rA.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:wh(rA.prototype.readFeaturesInternal)}},xD={"http://www.opengis.net/wfs":{totalInserted:kh(cA),totalUpdated:kh(cA),totalDeleted:kh(cA)},"http://www.opengis.net/wfs/2.0":{totalInserted:kh(cA),totalUpdated:kh(cA),totalDeleted:kh(cA)}},kD={"http://www.opengis.net/wfs":{TransactionSummary:kh(PD,"transactionSummary"),InsertResults:kh(LD,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:kh(PD,"transactionSummary"),InsertResults:kh(LD,"insertIds")}},_D={"http://www.opengis.net/wfs":{PropertyName:_h(mA)},"http://www.opengis.net/wfs/2.0":{PropertyName:_h(mA)}},SD={"http://www.opengis.net/wfs":{Insert:_h(FD),Update:_h(qD),Delete:_h(BD),Property:_h($D),Native:_h(VD)},"http://www.opengis.net/wfs/2.0":{Insert:_h(FD),Update:_h(qD),Delete:_h(BD),Property:_h($D),Native:_h(VD)}},MD="feature",jD="http://www.w3.org/2000/xmlns/",OD={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},TD={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},ED={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},AD={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},CD={"2.0.0":AA,"1.1.0":MA,"1.0.0":xA},RD=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.if=r.version?r.version:"1.1.0",e.wy=r.featureType,e.gy=r.featureNS,e.xy=r.gmlFormat?r.gmlFormat:new CD[e.if],e.ky=r.schemaLocation?r.schemaLocation:AD[e.if],e}return wD(n,t),n.prototype.getFeatureType=function(){return this.wy},n.prototype.setFeatureType=function(t){this.wy=t},n.prototype.readFeaturesFromNode=function(t,n){var e={node:t};E(e,{featureType:this.wy,featureNS:this.gy}),E(e,this.getReadOptions(t,n||{}));var r=[e],i=Ah([],"2.0.0"===this.if?gD:this.xy.FEATURE_COLLECTION_PARSERS,t,r,this.xy);return i||(i=[]),i},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=mh(t);return this.readTransactionResponseFromDocument(n)}return ph(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=mh(t);return this.readFeatureCollectionMetadataFromDocument(n)}return ph(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},e=fA(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=e,Ah(n,gD,t,[],this.xy)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return Ah({},kD,t,[])},n.prototype.writeGetFeature=function(t){var n=this,e=lh(TD[this.if],"GetFeature");e.setAttribute("service","WFS"),e.setAttribute("version",this.if),t.handle&&e.setAttribute("handle",t.handle),t.outputFormat&&e.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&e.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&e.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&e.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&e.setAttribute("count",String(t.count)),void 0!==t.viewParams&&e.setAttribute("viewParams",t.viewParams),e.setAttributeNS(hh,"xsi:schemaLocation",this.ky);var r={node:e};if(E(r,{version:this.if,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.gy,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Mt(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var i=t.filter;t.bbox&&(Mt(t.geometryName,12),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),E(r,{geometryName:t.geometryName,filter:i}),cN(e,t.featureTypes,[r])}else t.featureTypes.forEach((function(i){var o=n.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);E(r,{geometryName:i.geometryName,filter:o}),cN(e,[i.name],[r])}));return e},n.prototype.combineBboxAndFilter=function(t,n,e,r){var i=bD(t,n,e);return r?mD(r,i):i},n.prototype.writeTransaction=function(t,n,e,r){var i,o=[],s=r.version?r.version:this.if,a=lh(TD[s],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",s),r&&(i=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(hh,"xsi:schemaLocation",AD[s]);var u=function(t,n,e,r){var i,o=r.featurePrefix?r.featurePrefix:MD;"1.0.0"===e?i=2:"1.1.0"===e?i=3:"2.0.0"===e&&(i=3.2);return E({node:t},{version:e,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:i,hasZ:r.hasZ,srsName:r.srsName},n)}(a,i,s,r);return t&&ID("Insert",t,o,u),n&&ID("Update",n,o,u),e&&ID("Delete",e,o,u),r.nativeElements&&ID("Native",r.nativeElements,o,u),a},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var e=[{}];return this.xy.readGeometryElement(n,e),mr(e.pop().srsName)}return null},n}(JE);function ID(t,n,e,r){Rh(r,SD,Mh(t),n,e)}function PD(t,n){return Ah({},xD,t,n)}var DD={"http://www.opengis.net/ogc":{FeatureId:wh((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:wh((function(t,n){return t.getAttribute("fid")}))}};function ND(t,n){Eh(DD,t,n)}var zD={"http://www.opengis.net/wfs":{Feature:ND},"http://www.opengis.net/wfs/2.0":{Feature:ND}};function LD(t,n){return Ah([],zD,t,n)}function FD(t,n,e){var r=e[e.length-1],i=r.featureType,o=r.featureNS,s=r.gmlVersion,a=lh(o,i);t.appendChild(a),2===s?xA.prototype.writeFeatureElement(a,n,e):3===s?MA.prototype.writeFeatureElement(a,n,e):AA.prototype.writeFeatureElement(a,n,e)}function GD(t,n,e){var r=e[e.length-1].version,i=OD[r],o=lh(i,"Filter"),s=lh(i,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function UD(t,n){var e=(t=t||MD)+":";return 0===n.indexOf(e)?n:e+n}function BD(t,n,e){var r=e[e.length-1];Mt(void 0!==n.getId(),26);var i=r.featureType,o=r.featurePrefix,s=r.featureNS,a=UD(o,i);t.setAttribute("typeName",a),t.setAttributeNS(jD,"xmlns:"+o,s);var u=n.getId();void 0!==u&&GD(t,u,e)}function qD(t,n,e){var r=e[e.length-1];Mt(void 0!==n.getId(),27);var i=r.version,o=r.featureType,s=r.featurePrefix,a=r.featureNS,u=UD(s,o),c=n.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(jD,"xmlns:"+s,a);var f=n.getId();if(void 0!==f){for(var h=n.getKeys(),l=[],v=0,d=h.length;v0,e=this.readUint32(n),r=Math.floor((268435455&e)/1e3),i=Boolean(2147483648&e)||1===r||3===r,o=Boolean(1073741824&e)||2===r||3===r,s=Boolean(536870912&e),a=(268435455&e)%1e3,u=["XY",i?"Z":"",o?"M":""].join(""),c=s?this.readUint32(n):null;if(void 0!==t&&t!==a)throw new Error("Unexpected WKB geometry type "+a);if(this.My){if(this.jy!==n)throw new Error("Inconsistent endian");if(this.Ay!==u)throw new Error("Inconsistent geometry layout");if(c&&this.Ey!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.jy=n,this.Oy=i,this.Ty=o,this.Ay=u,this.Ey=c,this.My=!0;return a},t.prototype.readWkbPayload=function(t){switch(t){case vN:return this.readPoint();case dN:return this.readLineString();case pN:case kN:return this.readPolygon();case yN:return this.readMultiPoint();case mN:return this.readMultiLineString();case bN:case gN:case xN:return this.readMultiPolygon();case wN:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var e=this.readUint32(),r=[],i=0;i=0&&(t+=this.Cy?2147483648:1e3),this.Ay.indexOf("M")>=0&&(t+=this.Cy?1073741824:2e3),this.Cy&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.jy?1:0),this.writeUint32(t),this.Cy&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var e=0;e="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.By=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.qy=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.$y=function(){return this.wkt.charAt(++this.Gy)},t.prototype.nextToken=function(){var t,n=this.$y(),e=this.Gy,r=n;if("("==n)t=RN;else if(","==n)t=DN;else if(")"==n)t=IN;else if(this.By(n)||"-"==n)t=PN,r=this.Vy();else if(this.Uy(n))t=CN,r=this.Zy();else{if(this.qy(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=NN}return{position:e,value:r,type:t}},t.prototype.Vy=function(){var t,n=this.Gy,e=!1,r=!1;do{"."==t?e=!0:"e"!=t&&"E"!=t||(r=!0),t=this.$y()}while(this.By(t,e)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.Gy--))},t.prototype.Zy=function(){var t,n=this.Gy;do{t=this.$y()}while(this.Uy(t));return this.wkt.substring(n,this.Gy--).toUpperCase()},t}(),GN=function(){function t(t){this.Wy=t,this.Hy={position:0,type:AN},this.Ay=Et}return t.prototype.Ky=function(){this.Hy=this.Wy.nextToken()},t.prototype.isTokenType=function(t){return this.Hy.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.Ky(),n},t.prototype.parse=function(){return this.Ky(),this.Xy()},t.prototype.Yy=function(){var t=Et,n=this.Hy;if(this.isTokenType(CN)){var e=n.value;"Z"===e?t=At:"M"===e?t=Ct:"ZM"===e&&(t=Rt),t!==Et&&this.Ky()}return t},t.prototype.Jy=function(){if(this.match(RN)){var t=[];do{t.push(this.Xy())}while(this.match(DN));if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.tm=function(){if(this.match(RN)){var t=this.nm();if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.rm=function(){if(this.match(RN)){var t=this.im();if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.om=function(){if(this.match(RN)){var t=this.sm();if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.am=function(){if(this.match(RN)){var t=void 0;if(t=this.Hy.type==RN?this.um():this.im(),this.match(IN))return t}throw new Error(this.Qy())},t.prototype.fm=function(){if(this.match(RN)){var t=this.sm();if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.hm=function(){if(this.match(RN)){var t=this.lm();if(this.match(IN))return t}throw new Error(this.Qy())},t.prototype.nm=function(){for(var t=[],n=this.Ay.length,e=0;e0&&(n+=" "+r)}return 0===e.length?n+" "+EN:n+"("+e+")"}var WN=UN,HN=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),KN=[null,"http://www.opengis.net/wms"],XN=Th(KN,{Service:kh((function(t,n){return Ah({},QN,t,n)})),Capability:kh((function(t,n){return Ah({},YN,t,n)}))}),YN=Th(KN,{Request:kh((function(t,n){return Ah({},az,t,n)})),Exception:kh((function(t,n){return Ah([],rz,t,n)})),Layer:kh((function(t,n){var e=Ah({},iz,t,n);if(void 0===e.Layer)return Object.assign(e,dz(t,n));return e}))}),JN=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return HN(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=Ah({version:this.version},XN,t,[]);return n||null},n}(NI),QN=Th(KN,{Name:kh(hA),Title:kh(hA),Abstract:kh(hA),KeywordList:kh(bz),OnlineResource:kh(zI),ContactInformation:kh((function(t,n){return Ah({},tz,t,n)})),Fees:kh(hA),AccessConstraints:kh(hA),LayerLimit:kh(cA),MaxWidth:kh(cA),MaxHeight:kh(cA)}),tz=Th(KN,{ContactPersonPrimary:kh((function(t,n){return Ah({},nz,t,n)})),ContactPosition:kh(hA),ContactAddress:kh((function(t,n){return Ah({},ez,t,n)})),ContactVoiceTelephone:kh(hA),ContactFacsimileTelephone:kh(hA),ContactElectronicMailAddress:kh(hA)}),nz=Th(KN,{ContactPerson:kh(hA),ContactOrganization:kh(hA)}),ez=Th(KN,{AddressType:kh(hA),Address:kh(hA),City:kh(hA),StateOrProvince:kh(hA),PostCode:kh(hA),Country:kh(hA)}),rz=Th(KN,{Format:wh(hA)}),iz=Th(KN,{Name:kh(hA),Title:kh(hA),Abstract:kh(hA),KeywordList:kh(bz),CRS:xh(hA),EX_GeographicBoundingBox:kh((function(t,n){var e=Ah({},sz,t,n);if(!e)return;var r=e.westBoundLongitude,i=e.southBoundLatitude,o=e.eastBoundLongitude,s=e.northBoundLatitude;if(void 0===r||void 0===i||void 0===o||void 0===s)return;return[r,i,o,s]})),BoundingBox:xh((function(t,n){var e=[uA(t.getAttribute("minx")),uA(t.getAttribute("miny")),uA(t.getAttribute("maxx")),uA(t.getAttribute("maxy"))],r=[uA(t.getAttribute("resx")),uA(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:e,res:r}})),Dimension:xh((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:oA(t.getAttribute("multipleValues")),nearestValue:oA(t.getAttribute("nearestValue")),current:oA(t.getAttribute("current")),values:hA(t)}})),Attribution:kh((function(t,n){return Ah({},oz,t,n)})),AuthorityURL:xh((function(t,n){var e=pz(t,n);if(e)return e.name=t.getAttribute("name"),e;return})),Identifier:xh(hA),MetadataURL:xh((function(t,n){var e=pz(t,n);if(e)return e.type=t.getAttribute("type"),e;return})),DataURL:xh(pz),FeatureListURL:xh(pz),Style:xh((function(t,n){return Ah({},hz,t,n)})),MinScaleDenominator:kh(aA),MaxScaleDenominator:kh(aA),Layer:xh(dz)}),oz=Th(KN,{Title:kh(hA),OnlineResource:kh(zI),LogoURL:kh(mz)}),sz=Th(KN,{westBoundLongitude:kh(aA),eastBoundLongitude:kh(aA),southBoundLatitude:kh(aA),northBoundLatitude:kh(aA)}),az=Th(KN,{GetCapabilities:kh(yz),GetMap:kh(yz),GetFeatureInfo:kh(yz)}),uz=Th(KN,{Format:xh(hA),DCPType:xh((function(t,n){return Ah({},cz,t,n)}))}),cz=Th(KN,{HTTP:kh((function(t,n){return Ah({},fz,t,n)}))}),fz=Th(KN,{Get:kh(pz),Post:kh(pz)}),hz=Th(KN,{Name:kh(hA),Title:kh(hA),Abstract:kh(hA),LegendURL:xh(mz),StyleSheetURL:kh(pz),StyleURL:kh(pz)}),lz=Th(KN,{Format:kh(hA),OnlineResource:kh(zI)}),vz=Th(KN,{Keyword:wh(hA)});function dz(t,n){var e=n[n.length-1],r=Ah({},iz,t,n);if(r){var i=oA(t.getAttribute("queryable"));void 0===i&&(i=e.queryable),r.queryable=void 0!==i&&i;var o=fA(t.getAttribute("cascaded"));void 0===o&&(o=e.cascaded),r.cascaded=o;var s=oA(t.getAttribute("opaque"));void 0===s&&(s=e.opaque),r.opaque=void 0!==s&&s;var a=oA(t.getAttribute("noSubsets"));void 0===a&&(a=e.noSubsets),r.noSubsets=void 0!==a&&a;var u=uA(t.getAttribute("fixedWidth"));u||(u=e.fixedWidth),r.fixedWidth=u;var c=uA(t.getAttribute("fixedHeight"));c||(c=e.fixedHeight),r.fixedHeight=c;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in e){var n=r[t]||[];r[t]=n.concat(e[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=e[t];r[t]=n}})),r}}function pz(t,n){return Ah({},lz,t,n)}function yz(t,n){return Ah({},uz,t,n)}function mz(t,n){var e=pz(t,n);if(e){var r=[fA(t.getAttribute("width")),fA(t.getAttribute("height"))];return e.size=r,e}}function bz(t,n){return Ah([],vz,t,n)}var wz=JN,gz=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),xz=function(t){function n(n){var e=t.call(this)||this,r=n||{};return e.gy="http://mapserver.gis.umn.edu/mapserver",e.xy=new xA,e.Gc=r.layers?r.layers:null,e}return gz(n,t),n.prototype.getLayers=function(){return this.Gc},n.prototype.setLayers=function(t){this.Gc=t},n.prototype.ym=function(t,n){t.setAttribute("namespaceURI",this.gy);var e=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==e)for(var i=0,o=t.childNodes.length;if*Qz||c>h*Qz?this.Zm():jn(o,r)||this.Km()}}},n.prototype.Zm=function(){var t=this.getMap(),n=this.Um,e=t.getSize(),r=t.getView().calculateExtentInternal(e),i=n.getView(),o=Math.log(7.5)/Math.LN2;re(r,1/(Math.pow(2,o/2)*tL)),i.fitInternal(Hi(r))},n.prototype.Km=function(){var t=this.getMap(),n=this.Um,e=t.getView();n.getView().setCenterInternal(e.getCenterInternal())},n.prototype.Xm=function(){var t=this.getMap(),n=this.Um;if(t.isRendered()&&n.isRendered()){var e=t.getSize(),r=t.getView(),i=n.getView(),o=this.ua?0:-r.getRotation(),s=this.Bm,a=this.Bm.getElement(),u=r.getCenterInternal(),c=r.getResolution(),f=i.getResolution(),h=e[0]*c/f,l=e[1]*c/f;if(s.setPosition(u),a){a.style.width=h+"px",a.style.height=l+"px";var v="rotate("+o+"rad)";a.style.transform=v}}},n.prototype.Wm=function(){this.Ym||(this.Ym=Y(this.Um,ba,(function(t){delete this.Ym,this.Xm()}),this))},n.prototype.Cr=function(t){t.preventDefault(),this.Dr()},n.prototype.Dr=function(){this.element.classList.toggle(Os),this._r?jo(this.Tr,this.Er):jo(this.Er,this.Tr),this._r=!this._r;var t=this.Um;if(!this._r){if(t.isRendered())return this.Fm=void 0,void t.render();t.updateSize(),this.Zm(),this.Wm()}},n.prototype.getCollapsible=function(){return this.jr},n.prototype.setCollapsible=function(t){this.jr!==t&&(this.jr=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this._r&&this.Dr())},n.prototype.setCollapsed=function(t){this.jr&&this._r!==t&&this.Dr()},n.prototype.getCollapsed=function(){return this._r},n.prototype.getRotateWithView=function(){return this.ua},n.prototype.setRotateWithView=function(t){this.ua!==t&&(this.ua=t,0!==this.getMap().getView().getRotation()&&(this.ua?this.Lm():this.Um.getView().setRotation(0),this.Fm=void 0,this.Hm(),this.Xm()))},n.prototype.getOverviewMap=function(){return this.Um},n.prototype.render=function(t){this.Hm(),this.Xm()},n}(uu),rL=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),iL="units",oL="degrees",sL="imperial",aL="nautical",uL="metric",cL="us",fL=[1,2,5],hL=25.4/.28,lL=function(t){function n(n){var e=this,r=n||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(e=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,e.once,e.un,e.Jm=document.createElement("div"),e.Jm.className=i+"-inner",e.element.className=i+" "+Ss,e.element.appendChild(e.Jm),e.Qm=null,e.tb=void 0!==r.minWidth?r.minWidth:64,e.mn=!1,e.nb=void 0,e.Pm="",e.addChangeListener(iL,e.eb),e.setUnits(r.units||uL),e.rb=r.bar||!1,e.ib=r.steps||4,e.ob=r.text||!1,e.sb=r.dpi||void 0,e}return rL(n,t),n.prototype.getUnits=function(){return this.get(iL)},n.prototype.eb=function(){this.Pr()},n.prototype.setUnits=function(t){this.set(iL,t)},n.prototype.setDpi=function(t){this.sb=t},n.prototype.Pr=function(){var t=this.Qm;if(t){var n=t.center,e=t.projection,r=this.getUnits(),i=r==oL?Ft.DEGREES:Ft.METERS,o=br(e,t.resolution,n,i),s=this.tb*(this.sb||hL)/hL,a=s*o,u="";if(r==oL){var c=zt[Ft.DEGREES];(a*=c)=s)break;++d}v=this.rb?this.createScaleBar(h,f,u):f.toFixed(l<0?-l:0)+" "+u,this.Pm!=v&&(this.Jm.innerHTML=v,this.Pm=v),this.nb!=h&&(this.Jm.style.width=h+"px",this.nb=h),this.mn||(this.element.style.display="",this.mn=!0)}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.createScaleBar=function(t,n,e){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.ib,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.ib?this.createStepText(a,t,!1,n,e):"")+""),a===this.ib-1&&i.push(this.createStepText(a+1,t,!0,n,e)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.ob?'
'+r+"
":"")+i.join("")+"
"},n.prototype.createMarker=function(t,n){return'
'},n.prototype.createStepText=function(t,n,e,r,i){var o=(0===t?0:Math.round(r/this.ib*t*100)/100)+(0===t?"":" "+i);return'
'+o+"
"},n.prototype.getScaleForResolution=function(){var t=br(this.Qm.projection,this.Qm.resolution,this.Qm.center,Ft.METERS),n=this.sb||hL;return parseFloat(t.toString())*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.Qm=n?n.viewState:null,this.Pr()},n}(uu),vL=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),dL=0,pL=1,yL=function(t){function n(n){var e=this,r=n||{};(e=t.call(this,{element:document.createElement("div"),render:r.render})||this).Rn=[],e.ab=void 0,e.ub=dL,e.Cn,e.cb=0,e.fb=0,e.hb,e.lb,e.vb=null,e.pb=!1,e.zr=void 0!==r.duration?r.duration:200;var i=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb "+Ss;var s=e.element;return s.className=i+" "+"ol-unselectable "+js,s.appendChild(o),s.addEventListener(va,e.yb.bind(e),!1),s.addEventListener(la,e.mb.bind(e),!1),s.addEventListener(da,e.bb.bind(e),!1),s.addEventListener(F,e.wb.bind(e),!1),o.addEventListener(F,f,!1),e}return vL(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.gb=function(){var t=this.element,n=t.offsetWidth,e=t.offsetHeight;if(0===n&&0===e)return this.pb=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),e-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var i=t.firstElementChild,o=getComputedStyle(i),s=i.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),a=i.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.vb=[s,a],n>e?(this.ub=pL,this.fb=n-s):(this.ub=dL,this.cb=e-a),this.pb=!0},n.prototype.wb=function(t){var n=this.getMap().getView(),e=this.xb(t.offsetX-this.vb[0]/2,t.offsetY-this.vb[1]/2),r=this.kb(e),i=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:i,duration:this.zr,easing:bt})},n.prototype.yb=function(t){if(!this.Cn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.hb=t.clientX-parseFloat(n.style.left),this.lb=t.clientY-parseFloat(n.style.top),this.Cn=!0,0===this.Rn.length){var e=this.mb,r=this.bb,i=this.getMap().getOwnerDocument();this.Rn.push(X(i,la,e,this),X(i,da,r,this))}}},n.prototype.mb=function(t){if(this.Cn){var n=t.clientX-this.hb,e=t.clientY-this.lb,r=this.xb(n,e);this.ab=this.kb(r),this.getMap().getView().setResolution(this.ab)}},n.prototype.bb=function(t){this.Cn&&(this.getMap().getView().endInteraction(),this.Cn=!1,this.hb=void 0,this.lb=void 0,this.Rn.forEach(J),this.Rn.length=0)},n.prototype._b=function(t){var n=this.Sb(t),e=this.element.firstElementChild;this.ub==pL?e.style.left=this.fb*n+"px":e.style.top=this.cb*n+"px"},n.prototype.xb=function(t,n){return ue(this.ub===pL?t/this.fb:n/this.cb,0,1)},n.prototype.kb=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.Sb=function(t){return ue(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.pb||this.gb())){var n=t.frameState.viewState.resolution;this.ab=n,this._b(n)}},n}(uu),mL=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),bL=function(t){function n(n){var e=this,r=n||{};(e=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var i=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(F,e.Cr.bind(e),!1);var u=i+" "+"ol-unselectable "+js,c=e.element;return c.className=u,c.appendChild(a),e}return mL(n,t),n.prototype.Cr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Hi(n))},n}(uu),wL={};wL.AssertionError=c,wL.Collection=ht,wL.Collection.CollectionEvent=ft,wL.DataTile=St,wL.Disposable=v,wL.Feature=Tt,wL.Feature.createStyleFunction=Ot,wL.Geolocation=co,wL.Image=go,wL.Image.listenImage=wo,wL.ImageBase=ho,wL.ImageCanvas=ko,wL.ImageTile=Co,wL.Kinetic=Ro,wL.Map=wc,wL.MapBrowserEvent=fa,wL.MapBrowserEventHandler=ma,wL.MapEvent=ua,wL.Object=ot,wL.Object.ObjectEvent=it,wL.Observable=et,wL.Observable.unByKey=nt,wL.Overlay=Nc,wL.PluggableMap=su,wL.Tile=kt,wL.TileCache=Zc,wL.TileQueue=Ta,wL.TileQueue.getTilePriority=Ea,wL.TileRange=Kc,wL.TileRange.createOrUpdate=Hc,wL.VectorRenderTile=Jc,wL.VectorTile=tf,wL.View=Ja,wL.View.createCenterConstraint=Wa,wL.View.createResolutionConstraint=Ha,wL.View.createRotationConstraint=Ka,wL.View.isNoopAnimation=Xa,wL.array={},wL.array.binarySearch=d,wL.array.equals=x,wL.array.extend=w,wL.array.find=g,wL.array.findIndex=k,wL.array.includes=y,wL.array.isSorted=_,wL.array.linearFindNearest=m,wL.array.numberSafeCompareFunction=p,wL.array.remove=function(t,n){var e=t.indexOf(n),r=e>-1;return r&&t.splice(e,1),r},wL.array.reverseSubArray=b,wL.array.stableSort=function(t,n){var e,r=t.length,i=Array(t.length);for(e=0;e3&&!!wi(t,n,e,r)},wL.geom.flat.transform={},wL.geom.flat.transform.rotate=Br,wL.geom.flat.transform.scale=qr,wL.geom.flat.transform.transform2D=Ur,wL.geom.flat.transform.translate=$r,wL.has={},wL.has.DEVICE_PIXEL_RATIO=Vt,wL.has.FIREFOX=Ut,wL.has.IMAGE_DECODE=Wt,wL.has.MAC=$t,wL.has.PASSIVE_EVENT_LISTENERS=Ht,wL.has.SAFARI=Bt,wL.has.WEBKIT=qt,wL.has.WORKER_OFFSCREEN_CANVAS=Zt,wL.interaction={},wL.interaction.DoubleClickZoom=ku,wL.interaction.DragAndDrop=WT,wL.interaction.DragAndDrop.DragAndDropEvent=ZT,wL.interaction.DragBox=Ju,wL.interaction.DragBox.DragBoxEvent=Yu,wL.interaction.DragPan=Uu,wL.interaction.DragRotate=qu,wL.interaction.DragRotateAndZoom=KT,wL.interaction.DragZoom=tc,wL.interaction.Draw=uE,wL.interaction.Draw.DrawEvent=aE,wL.interaction.Draw.createBox=function(){return function(t,n,e){var r=xn([t[0],t[t.length-1]].map((function(t){return Pr(t,e)}))),i=[[$n(r),Vn(r),Jn(r),Yn(r),$n(r)]],o=n;o?o.setCoordinates(i):o=new Zi(i);var s=Rr();return s&&o.transform(e,s),o}},wL.interaction.Draw.createRegularPolygon=function(t,n){return function(e,r,i){var o=Pr(e[0],i),s=Pr(e[e.length-1],i),a=Math.sqrt(ar(o,s)),u=r||Ki(new JT(o),t),c=n;if(!n&&0!==n){var f=s[0]-o[0],h=s[1]-o[1];c=Math.atan2(h,f)}Xi(u,o,a,c);var l=Rr();return l&&u.transform(i,l),u}},wL.interaction.Extent=pE,wL.interaction.Extent.ExtentEvent=hE,wL.interaction.Interaction=gu,wL.interaction.Interaction.pan=bu,wL.interaction.Interaction.zoomByDelta=wu,wL.interaction.KeyboardPan=sc,wL.interaction.KeyboardZoom=uc,wL.interaction.Modify=jE,wL.interaction.Modify.ModifyEvent=kE,wL.interaction.MouseWheelZoom=lc,wL.interaction.PinchRotate=dc,wL.interaction.PinchZoom=yc,wL.interaction.Pointer=Mu,wL.interaction.Pointer.centroid=Su,wL.interaction.Select=CE,wL.interaction.Select.SelectEvent=EE,wL.interaction.Snap=DE,wL.interaction.Translate=UE,wL.interaction.Translate.TranslateEvent=GE,wL.interaction.defaults=mc,wL.layer={},wL.layer.Base=is,wL.layer.BaseImage=_g,wL.layer.BaseTile=Ig,wL.layer.BaseVector=Sx,wL.layer.Graticule=Gk,wL.layer.Group=sa,wL.layer.Group.GroupEvent=ia,wL.layer.Heatmap=Zk,wL.layer.Image=Eg,wL.layer.Layer=ys,wL.layer.Layer.inView=ps,wL.layer.MapboxVector=DT,wL.layer.MapboxVector.getMapboxPath=TT,wL.layer.MapboxVector.normalizeGlyphsUrl=AT,wL.layer.MapboxVector.normalizeSourceUrl=RT,wL.layer.MapboxVector.normalizeSpriteUrl=ET,wL.layer.MapboxVector.normalizeStyleUrl=CT,wL.layer.Tile=Fg,wL.layer.Vector=Ik,wL.layer.VectorImage=zT,wL.layer.VectorTile=f_,wL.layer.WebGLPoints=FT,wL.layer.WebGLTile=qT,wL.loadingstrategy={},wL.loadingstrategy.all=ff,wL.loadingstrategy.bbox=function(t,n){return[t]},wL.loadingstrategy.tile=function(t){return function(n,e,r){var i=t.getZForResolution(Lr(e,r)),o=t.getTileRangeForExtentAndZ(Nr(n,r),i),s=[],a=[i,0,0];for(a[1]=o.minX;a[1]<=o.maxX;++a[1])for(a[2]=o.minY;a[2]<=o.maxY;++a[2])s.push(Dr(t.getTileCoordExtent(a),r));return s}},wL.math={},wL.math.ceil=xe,wL.math.clamp=ue,wL.math.cosh=ce,wL.math.floor=ge,wL.math.lerp=me,wL.math.log2=fe,wL.math.modulo=ye,wL.math.round=we,wL.math.solveLinearSystem=ve,wL.math.squaredDistance=le,wL.math.squaredSegmentDistance=he,wL.math.toDegrees=de,wL.math.toFixed=be,wL.math.toRadians=pe,wL.net={},wL.net.ClientError=pf,wL.net.ResponseError=df,wL.net.getJSON=yf,wL.net.jsonp=lf,wL.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&(vf=XMLHttpRequest),global.XMLHttpRequest=t},wL.net.resolveUrl=mf,wL.net.restoreXHR=function(){global.XMLHttpRequest=vf},wL.obj={},wL.obj.assign=E,wL.obj.clear=A,wL.obj.getValues=C,wL.obj.isEmpty=R,wL.proj={},wL.proj.Projection=ae,wL.proj.Units={},wL.proj.Units.METERS_PER_UNIT=zt,wL.proj.Units.fromCode=Nt,wL.proj.addCommon=Gr,wL.proj.addCoordinateTransforms=_r,wL.proj.addEquivalentProjections=wr,wL.proj.addEquivalentTransforms=gr,wL.proj.addProjection=pr,wL.proj.addProjections=yr,wL.proj.clearAllProjections=function(){Fe(),qe()},wL.proj.clearUserProjection=function(){Ar=null},wL.proj.cloneTransform=vr,wL.proj.createProjection=xr,wL.proj.createSafeCoordinateTransform=Fr,wL.proj.createTransformFromCoordinateTransform=kr,wL.proj.epsg3857={},wL.proj.epsg3857.EXTENT=Me,wL.proj.epsg3857.HALF_SIZE=Se,wL.proj.epsg3857.MAX_SAFE_Y=Oe,wL.proj.epsg3857.PROJECTIONS=Ee,wL.proj.epsg3857.RADIUS=_e,wL.proj.epsg3857.WORLD_EXTENT=je,wL.proj.epsg3857.fromEPSG4326=Ae,wL.proj.epsg3857.toEPSG4326=Ce,wL.proj.epsg4326={},wL.proj.epsg4326.EXTENT=Pe,wL.proj.epsg4326.METERS_PER_UNIT=De,wL.proj.epsg4326.PROJECTIONS=ze,wL.proj.epsg4326.RADIUS=Ie,wL.proj.equivalent=Mr,wL.proj.fromLonLat=Sr,wL.proj.fromUserCoordinate=Pr,wL.proj.fromUserExtent=Nr,wL.proj.fromUserResolution=Lr,wL.proj.get=mr,wL.proj.getPointResolution=br,wL.proj.getTransform=Or,wL.proj.getTransformFromProjections=jr,wL.proj.getUserProjection=Rr,wL.proj.identityTransform=dr,wL.proj.proj4={},wL.proj.proj4.register=function(t){var n,e,r=Object.keys(t.defs),i=r.length;for(n=0;n180)&&(e[0]=ye(r+180,360)-180),e},wL.proj.toUserCoordinate=Ir,wL.proj.toUserExtent=Dr,wL.proj.toUserResolution=zr,wL.proj.transform=Tr,wL.proj.transformExtent=Er,wL.proj.transformWithProjections=function(t,n,e){return jr(n,e)(t)},wL.proj.transforms={},wL.proj.transforms.add=$e,wL.proj.transforms.clear=qe,wL.proj.transforms.get=Ve,wL.proj.transforms.remove=function(t,n){var e=t.getCode(),r=n.getCode(),i=Be[e][r];return delete Be[e][r],R(Be[e])&&delete Be[e],i},wL.proj.useGeographic=function(){Cr("EPSG:4326")},wL.render={},wL.render.Box=Vu,wL.render.Event=xs,wL.render.Feature=Ek,wL.render.VectorContext=bf,wL.render.canvas={},wL.render.canvas.Builder=Px,wL.render.canvas.BuilderGroup=Zx,wL.render.canvas.Executor=rk,wL.render.canvas.ExecutorGroup=uk,wL.render.canvas.ExecutorGroup.getPixelIndexArray=ak,wL.render.canvas.ImageBuilder=Nx,wL.render.canvas.Immediate=gf,wL.render.canvas.Instruction={},wL.render.canvas.Instruction.beginPathInstruction=Ax,wL.render.canvas.Instruction.closePathInstruction=Cx,wL.render.canvas.Instruction.fillInstruction=Tx,wL.render.canvas.Instruction.strokeInstruction=Ex,wL.render.canvas.LineStringBuilder=Lx,wL.render.canvas.PolygonBuilder=Gx,wL.render.canvas.TextBuilder=$x,wL.render.canvas.checkedFonts=Bs,wL.render.canvas.defaultFillStyle=Is,wL.render.canvas.defaultFont=Rs,wL.render.canvas.defaultLineCap=Ps,wL.render.canvas.defaultLineDash=Ds,wL.render.canvas.defaultLineDashOffset=0,wL.render.canvas.defaultLineJoin=Ns,wL.render.canvas.defaultLineWidth=1,wL.render.canvas.defaultMiterLimit=zs,wL.render.canvas.defaultPadding=Us,wL.render.canvas.defaultStrokeStyle=Ls,wL.render.canvas.defaultTextAlign=Fs,wL.render.canvas.defaultTextBaseline=Gs,wL.render.canvas.drawImageOrLabel=ta,wL.render.canvas.hitdetect={},wL.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=ck,wL.render.canvas.hitdetect.createHitDetectionImageData=fk,wL.render.canvas.hitdetect.hitDetect=hk,wL.render.canvas.labelCache=qs,wL.render.canvas.measureAndCacheTextWidth=Js,wL.render.canvas.measureTextHeight=Ks,wL.render.canvas.measureTextWidth=Ys,wL.render.canvas.measureTextWidths=Qs,wL.render.canvas.registerFont=Hs,wL.render.canvas.rotateAtOffset=function(t,n,e,r){0!==n&&(t.translate(e,r),t.rotate(n),t.translate(-e,-r))},wL.render.canvas.textHeights=Ws,wL.render.getRenderPixel=function(t,n){return nn(t.inversePixelTransform,n.slice(0))},wL.render.getVectorContext=If,wL.render.toContext=function(t,n){var e=t.canvas,r=n||{},i=r.pixelRatio||Vt,o=r.size;o&&(e.width=o[0]*i,e.height=o[1]*i,e.style.width=o[0]+"px",e.style.height=o[1]+"px");var s=[0,0,e.width,e.height],a=rn([1,0,0,1,0,0],i,i);return new gf(t,i,s,a,0)},wL.renderer={},wL.renderer.Composite=ea,wL.renderer.Layer=ml,wL.renderer.Map=ws,wL.renderer.canvas={},wL.renderer.canvas.ImageLayer=Og,wL.renderer.canvas.Layer=Mg,wL.renderer.canvas.TileLayer=zg,wL.renderer.canvas.VectorImageLayer=pk,wL.renderer.canvas.VectorLayer=vk,wL.renderer.canvas.VectorTileLayer=kk,wL.renderer.canvas.common={},wL.renderer.canvas.common.IMAGE_SMOOTHING_DISABLED=Df,wL.renderer.canvas.common.IMAGE_SMOOTHING_ENABLED=Nf,wL.renderer.vector={},wL.renderer.vector.defaultOrder=Tf,wL.renderer.vector.getSquaredTolerance=Ef,wL.renderer.vector.getTolerance=Af,wL.renderer.vector.renderFeature=Cf,wL.renderer.webgl={},wL.renderer.webgl.Layer=jl,wL.renderer.webgl.Layer.colorDecodeId=Ml,wL.renderer.webgl.Layer.colorEncodeId=Sl,wL.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},wL.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,e,r,i,o){var s=3+i,a=t[n+0],u=t[n+1],c=xl;c.length=i;for(var f=0;f1?k(e.TileMatrixSetLink,"projection"in n?function(t,e,r){var o=g(i,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=mr(o),a=mr(n.projection);return s&&a?Mr(s,a):o==n.projection}:function(t,e,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=e.TileMatrixSetLink[r].TileMatrixSet,s=e.TileMatrixSetLink[r].TileMatrixSetLimits,a=e.Format[0];"format"in n&&(a=n.format),(r=k(e.Style,(function(t,e,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var u=e.Style[r].Identifier,c={};"Dimension"in e&&e.Dimension.forEach((function(t,n,e){var r=t.Identifier,i=t.Default;void 0===i&&(i=t.Value[0]),c[r]=i}));var f,h=g(t.Contents.TileMatrixSet,(function(t,n,e){return t.Identifier==o})),l=h.SupportedCRS;if(l&&(f=mr(l)),"projection"in n){var v=mr(n.projection);v&&(f&&!Mr(v,f)||(f=v))}var d=!1,p="ne"==f.getAxisOrientation().substr(0,2),m=h.TileMatrix[0],b={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(s){b=s[s.length-1];var w=g(h.TileMatrix,(function(t){return t.Identifier===b.TileMatrix||h.Identifier+":"+t.Identifier===b.TileMatrix}));w&&(m=w)}var x=28e-5*m.ScaleDenominator/f.getMetersPerUnit(),_=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,S=m.TileWidth*x,M=m.TileHeight*x,j=h.BoundingBox,O=[_[0]+S*b.MinTileCol,_[1]-M*(1+b.MaxTileRow),_[0]+S*(1+b.MaxTileCol),_[1]-M*b.MinTileRow];if(void 0!==j&&!jn(j,O)){var T=e.WGS84BoundingBox,E=mr("EPSG:4326").getExtent();if(O=j,T)d=T[0]===E[0]&&T[2]===E[2];else{var A=Er(j,h.SupportedCRS,"EPSG:4326");d=A[0]-1e-10<=E[0]&&A[2]+1e-10>=E[2]}}var C=bv(h,O,s),R=[],I=n.requestEncoding;if(I=void 0!==I?I:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var P=t.OperationsMetadata.GetTile.DCP.HTTP.Get,D=0,N=P.length;D */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var fontWeights = {\n thin: 100,\n hairline: 100,\n 'ultra-light': 100,\n 'extra-light': 100,\n light: 200,\n book: 300,\n regular: 400,\n normal: 400,\n plain: 400,\n roman: 400,\n standard: 400,\n medium: 500,\n 'semi-bold': 600,\n 'demi-bold': 600,\n bold: 700,\n heavy: 800,\n black: 800,\n 'extra-bold': 800,\n 'ultra-black': 900,\n 'extra-black': 900,\n 'ultra-bold': 900,\n 'heavy-black': 900,\n fat: 900,\n poster: 900\n};\nvar sp = ' ';\nvar italicRE = /(italic|oblique)$/i;\n\nvar fontCache = {};\n\nmodule.exports = function(fonts, size, lineHeight) {\n var cssData = fontCache[fonts];\n if (!cssData) {\n if (!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n var weight = 400;\n var style = 'normal';\n var fontFamilies = [];\n var haveWeight, haveStyle;\n for (var i = 0, ii = fonts.length; i < ii; ++i) {\n var font = fonts[i];\n var parts = font.split(' ');\n var maybeWeight = parts[parts.length - 1].toLowerCase();\n if (maybeWeight == 'normal' || maybeWeight == 'italic' || maybeWeight == 'oblique') {\n style = haveStyle ? style : maybeWeight;\n parts.pop();\n maybeWeight = parts[parts.length - 1].toLowerCase();\n } else if (italicRE.test(maybeWeight)) {\n maybeWeight = maybeWeight.replace(italicRE, '');\n style = haveStyle ? style : parts[parts.length - 1].replace(maybeWeight, '');\n }\n for (var w in fontWeights) {\n if (maybeWeight == w || maybeWeight == w.replace('-', '') || maybeWeight == w.replace('-', sp)) {\n weight = haveWeight ? weight : fontWeights[w];\n parts.pop();\n break;\n }\n }\n if (!haveWeight && typeof maybeWeight == 'number') {\n weight = maybeWeight;\n }\n var fontFamily = parts.join(sp)\n .replace('Klokantech Noto Sans', 'Noto Sans');\n if (fontFamily.indexOf(sp) !== -1) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies.push(fontFamily);\n }\n // CSS font property: font-style font-weight font-size/line-height font-family\n cssData = fontCache[fonts] = [style, weight, fontFamilies];\n }\n return cssData[0] + sp + cssData[1] + sp + size + 'px' + (lineHeight ? '/' + lineHeight : '') + sp + cssData[2];\n};\n","'use strict';\n\nmodule.exports = Pbf;\n\nvar ieee754 = require('ieee754');\n\nfunction Pbf(buf) {\n this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);\n this.pos = 0;\n this.type = 0;\n this.length = this.buf.length;\n}\n\nPbf.Varint = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nPbf.Fixed64 = 1; // 64-bit: double, fixed64, sfixed64\nPbf.Bytes = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nPbf.Fixed32 = 5; // 32-bit: float, fixed32, sfixed32\n\nvar SHIFT_LEFT_32 = (1 << 16) * (1 << 16),\n SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;\n\n// Threshold chosen based on both benchmarking and knowledge about browser string\n// data structures (which currently switch structure types at 12 bytes or more)\nvar TEXT_DECODER_MIN_LENGTH = 12;\nvar utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf8');\n\nPbf.prototype = {\n\n destroy: function() {\n this.buf = null;\n },\n\n // === READING =================================================================\n\n readFields: function(readField, result, end) {\n end = end || this.length;\n\n while (this.pos < end) {\n var val = this.readVarint(),\n tag = val >> 3,\n startPos = this.pos;\n\n this.type = val & 0x7;\n readField(tag, result, this);\n\n if (this.pos === startPos) this.skip(val);\n }\n return result;\n },\n\n readMessage: function(readField, result) {\n return this.readFields(readField, result, this.readVarint() + this.pos);\n },\n\n readFixed32: function() {\n var val = readUInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n },\n\n readSFixed32: function() {\n var val = readInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n },\n\n // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)\n\n readFixed64: function() {\n var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n this.pos += 8;\n return val;\n },\n\n readSFixed64: function() {\n var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n this.pos += 8;\n return val;\n },\n\n readFloat: function() {\n var val = ieee754.read(this.buf, this.pos, true, 23, 4);\n this.pos += 4;\n return val;\n },\n\n readDouble: function() {\n var val = ieee754.read(this.buf, this.pos, true, 52, 8);\n this.pos += 8;\n return val;\n },\n\n readVarint: function(isSigned) {\n var buf = this.buf,\n val, b;\n\n b = buf[this.pos++]; val = b & 0x7f; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 7; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;\n b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;\n b = buf[this.pos]; val |= (b & 0x0f) << 28;\n\n return readVarintRemainder(val, isSigned, this);\n },\n\n readVarint64: function() { // for compatibility with v2.0.1\n return this.readVarint(true);\n },\n\n readSVarint: function() {\n var num = this.readVarint();\n return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n },\n\n readBoolean: function() {\n return Boolean(this.readVarint());\n },\n\n readString: function() {\n var end = this.readVarint() + this.pos;\n var pos = this.pos;\n this.pos = end;\n\n if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {\n // longer strings are fast with the built-in browser TextDecoder API\n return readUtf8TextDecoder(this.buf, pos, end);\n }\n // short strings are fast with our custom implementation\n return readUtf8(this.buf, pos, end);\n },\n\n readBytes: function() {\n var end = this.readVarint() + this.pos,\n buffer = this.buf.subarray(this.pos, end);\n this.pos = end;\n return buffer;\n },\n\n // verbose for performance reasons; doesn't affect gzipped size\n\n readPackedVarint: function(arr, isSigned) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readVarint(isSigned));\n return arr;\n },\n readPackedSVarint: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSVarint());\n return arr;\n },\n readPackedBoolean: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readBoolean());\n return arr;\n },\n readPackedFloat: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFloat());\n return arr;\n },\n readPackedDouble: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readDouble());\n return arr;\n },\n readPackedFixed32: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFixed32());\n return arr;\n },\n readPackedSFixed32: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSFixed32());\n return arr;\n },\n readPackedFixed64: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readFixed64());\n return arr;\n },\n readPackedSFixed64: function(arr) {\n if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());\n var end = readPackedEnd(this);\n arr = arr || [];\n while (this.pos < end) arr.push(this.readSFixed64());\n return arr;\n },\n\n skip: function(val) {\n var type = val & 0x7;\n if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {}\n else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;\n else if (type === Pbf.Fixed32) this.pos += 4;\n else if (type === Pbf.Fixed64) this.pos += 8;\n else throw new Error('Unimplemented type: ' + type);\n },\n\n // === WRITING =================================================================\n\n writeTag: function(tag, type) {\n this.writeVarint((tag << 3) | type);\n },\n\n realloc: function(min) {\n var length = this.length || 16;\n\n while (length < this.pos + min) length *= 2;\n\n if (length !== this.length) {\n var buf = new Uint8Array(length);\n buf.set(this.buf);\n this.buf = buf;\n this.length = length;\n }\n },\n\n finish: function() {\n this.length = this.pos;\n this.pos = 0;\n return this.buf.subarray(0, this.length);\n },\n\n writeFixed32: function(val) {\n this.realloc(4);\n writeInt32(this.buf, val, this.pos);\n this.pos += 4;\n },\n\n writeSFixed32: function(val) {\n this.realloc(4);\n writeInt32(this.buf, val, this.pos);\n this.pos += 4;\n },\n\n writeFixed64: function(val) {\n this.realloc(8);\n writeInt32(this.buf, val & -1, this.pos);\n writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n this.pos += 8;\n },\n\n writeSFixed64: function(val) {\n this.realloc(8);\n writeInt32(this.buf, val & -1, this.pos);\n writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n this.pos += 8;\n },\n\n writeVarint: function(val) {\n val = +val || 0;\n\n if (val > 0xfffffff || val < 0) {\n writeBigVarint(val, this);\n return;\n }\n\n this.realloc(4);\n\n this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n this.buf[this.pos++] = (val >>> 7) & 0x7f;\n },\n\n writeSVarint: function(val) {\n this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n },\n\n writeBoolean: function(val) {\n this.writeVarint(Boolean(val));\n },\n\n writeString: function(str) {\n str = String(str);\n this.realloc(str.length * 4);\n\n this.pos++; // reserve 1 byte for short string length\n\n var startPos = this.pos;\n // write the string directly to the buffer and see how much was written\n this.pos = writeUtf8(this.buf, str, this.pos);\n var len = this.pos - startPos;\n\n if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n // finally, write the message length in the reserved place and restore the position\n this.pos = startPos - 1;\n this.writeVarint(len);\n this.pos += len;\n },\n\n writeFloat: function(val) {\n this.realloc(4);\n ieee754.write(this.buf, val, this.pos, true, 23, 4);\n this.pos += 4;\n },\n\n writeDouble: function(val) {\n this.realloc(8);\n ieee754.write(this.buf, val, this.pos, true, 52, 8);\n this.pos += 8;\n },\n\n writeBytes: function(buffer) {\n var len = buffer.length;\n this.writeVarint(len);\n this.realloc(len);\n for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n },\n\n writeRawMessage: function(fn, obj) {\n this.pos++; // reserve 1 byte for short message length\n\n // write the message directly to the buffer and see how much was written\n var startPos = this.pos;\n fn(obj, this);\n var len = this.pos - startPos;\n\n if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n // finally, write the message length in the reserved place and restore the position\n this.pos = startPos - 1;\n this.writeVarint(len);\n this.pos += len;\n },\n\n writeMessage: function(tag, fn, obj) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeRawMessage(fn, obj);\n },\n\n writePackedVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedVarint, arr); },\n writePackedSVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSVarint, arr); },\n writePackedBoolean: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedBoolean, arr); },\n writePackedFloat: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFloat, arr); },\n writePackedDouble: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedDouble, arr); },\n writePackedFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed32, arr); },\n writePackedSFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr); },\n writePackedFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed64, arr); },\n writePackedSFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr); },\n\n writeBytesField: function(tag, buffer) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeBytes(buffer);\n },\n writeFixed32Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeFixed32(val);\n },\n writeSFixed32Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeSFixed32(val);\n },\n writeFixed64Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeFixed64(val);\n },\n writeSFixed64Field: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeSFixed64(val);\n },\n writeVarintField: function(tag, val) {\n this.writeTag(tag, Pbf.Varint);\n this.writeVarint(val);\n },\n writeSVarintField: function(tag, val) {\n this.writeTag(tag, Pbf.Varint);\n this.writeSVarint(val);\n },\n writeStringField: function(tag, str) {\n this.writeTag(tag, Pbf.Bytes);\n this.writeString(str);\n },\n writeFloatField: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed32);\n this.writeFloat(val);\n },\n writeDoubleField: function(tag, val) {\n this.writeTag(tag, Pbf.Fixed64);\n this.writeDouble(val);\n },\n writeBooleanField: function(tag, val) {\n this.writeVarintField(tag, Boolean(val));\n }\n};\n\nfunction readVarintRemainder(l, s, p) {\n var buf = p.buf,\n h, b;\n\n b = buf[p.pos++]; h = (b & 0x70) >> 4; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 3; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);\n b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);\n\n throw new Error('Expected varint not more than 10 bytes');\n}\n\nfunction readPackedEnd(pbf) {\n return pbf.type === Pbf.Bytes ?\n pbf.readVarint() + pbf.pos : pbf.pos + 1;\n}\n\nfunction toNum(low, high, isSigned) {\n if (isSigned) {\n return high * 0x100000000 + (low >>> 0);\n }\n\n return ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\nfunction writeBigVarint(val, pbf) {\n var low, high;\n\n if (val >= 0) {\n low = (val % 0x100000000) | 0;\n high = (val / 0x100000000) | 0;\n } else {\n low = ~(-val % 0x100000000);\n high = ~(-val / 0x100000000);\n\n if (low ^ 0xffffffff) {\n low = (low + 1) | 0;\n } else {\n low = 0;\n high = (high + 1) | 0;\n }\n }\n\n if (val >= 0x10000000000000000 || val < -0x10000000000000000) {\n throw new Error('Given varint doesn\\'t fit into 10 bytes');\n }\n\n pbf.realloc(10);\n\n writeBigVarintLow(low, high, pbf);\n writeBigVarintHigh(high, pbf);\n}\n\nfunction writeBigVarintLow(low, high, pbf) {\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n pbf.buf[pbf.pos] = low & 0x7f;\n}\n\nfunction writeBigVarintHigh(high, pbf) {\n var lsb = (high & 0x07) << 4;\n\n pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n pbf.buf[pbf.pos++] = high & 0x7f;\n}\n\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n var extraLen =\n len <= 0x3fff ? 1 :\n len <= 0x1fffff ? 2 :\n len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));\n\n // if 1 byte isn't enough for encoding message length, shift the data to the right\n pbf.realloc(extraLen);\n for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\nfunction writePackedVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]); }\nfunction writePackedSVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]); }\nfunction writePackedFloat(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]); }\nfunction writePackedDouble(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]); }\nfunction writePackedBoolean(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]); }\nfunction writePackedFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]); }\nfunction writePackedSFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]); }\nfunction writePackedFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]); }\nfunction writePackedSFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]); }\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\nfunction readUInt32(buf, pos) {\n return ((buf[pos]) |\n (buf[pos + 1] << 8) |\n (buf[pos + 2] << 16)) +\n (buf[pos + 3] * 0x1000000);\n}\n\nfunction writeInt32(buf, val, pos) {\n buf[pos] = val;\n buf[pos + 1] = (val >>> 8);\n buf[pos + 2] = (val >>> 16);\n buf[pos + 3] = (val >>> 24);\n}\n\nfunction readInt32(buf, pos) {\n return ((buf[pos]) |\n (buf[pos + 1] << 8) |\n (buf[pos + 2] << 16)) +\n (buf[pos + 3] << 24);\n}\n\nfunction readUtf8(buf, pos, end) {\n var str = '';\n var i = pos;\n\n while (i < end) {\n var b0 = buf[i];\n var c = null; // codepoint\n var bytesPerSequence =\n b0 > 0xEF ? 4 :\n b0 > 0xDF ? 3 :\n b0 > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence > end) break;\n\n var b1, b2, b3;\n\n if (bytesPerSequence === 1) {\n if (b0 < 0x80) {\n c = b0;\n }\n } else if (bytesPerSequence === 2) {\n b1 = buf[i + 1];\n if ((b1 & 0xC0) === 0x80) {\n c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);\n if (c <= 0x7F) {\n c = null;\n }\n }\n } else if (bytesPerSequence === 3) {\n b1 = buf[i + 1];\n b2 = buf[i + 2];\n if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {\n c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);\n if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {\n c = null;\n }\n }\n } else if (bytesPerSequence === 4) {\n b1 = buf[i + 1];\n b2 = buf[i + 2];\n b3 = buf[i + 3];\n if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);\n if (c <= 0xFFFF || c >= 0x110000) {\n c = null;\n }\n }\n }\n\n if (c === null) {\n c = 0xFFFD;\n bytesPerSequence = 1;\n\n } else if (c > 0xFFFF) {\n c -= 0x10000;\n str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);\n c = 0xDC00 | c & 0x3FF;\n }\n\n str += String.fromCharCode(c);\n i += bytesPerSequence;\n }\n\n return str;\n}\n\nfunction readUtf8TextDecoder(buf, pos, end) {\n return utf8TextDecoder.decode(buf.subarray(pos, end));\n}\n\nfunction writeUtf8(buf, str, pos) {\n for (var i = 0, c, lead; i < str.length; i++) {\n c = str.charCodeAt(i); // code point\n\n if (c > 0xD7FF && c < 0xE000) {\n if (lead) {\n if (c < 0xDC00) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n lead = c;\n continue;\n } else {\n c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;\n lead = null;\n }\n } else {\n if (c > 0xDBFF || (i + 1 === str.length)) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n } else {\n lead = c;\n }\n continue;\n }\n } else if (lead) {\n buf[pos++] = 0xEF;\n buf[pos++] = 0xBF;\n buf[pos++] = 0xBD;\n lead = null;\n }\n\n if (c < 0x80) {\n buf[pos++] = c;\n } else {\n if (c < 0x800) {\n buf[pos++] = c >> 0x6 | 0xC0;\n } else {\n if (c < 0x10000) {\n buf[pos++] = c >> 0xC | 0xE0;\n } else {\n buf[pos++] = c >> 0x12 | 0xF0;\n buf[pos++] = c >> 0xC & 0x3F | 0x80;\n }\n buf[pos++] = c >> 0x6 & 0x3F | 0x80;\n }\n buf[pos++] = c & 0x3F | 0x80;\n }\n }\n return pos;\n}\n","!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=t||self).RBush=i()}(this,function(){\"use strict\";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return ti?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n","// Generated by CoffeeScript 1.10.0\n(function() {\n var families;\n\n module.exports = {\n icon: 'icons/google.svg',\n name: 'google',\n title: 'Google Fonts',\n link: 'google.com/fonts',\n getNames: function() {\n return families;\n },\n getLink: function(name) {\n return \"https://fonts.google.com/specimen/\" + (name.replace(/( )/g, '+'));\n },\n normalizeName: function(name) {\n return name;\n }\n };\n\n families = [\"ABeeZee\", \"Abel\", \"Abril Fatface\", \"Aclonica\", \"Acme\", \"Actor\", \"Adamina\", \"Advent Pro\", \"Aguafina Script\", \"Akronim\", \"Aladin\", \"Aldrich\", \"Alef\", \"Alegreya\", \"Alegreya SC\", \"Alegreya Sans\", \"Alegreya Sans SC\", \"Alex Brush\", \"Alfa Slab One\", \"Alice\", \"Alike\", \"Alike Angular\", \"Allan\", \"Allerta\", \"Allerta Stencil\", \"Allura\", \"Almendra\", \"Almendra Display\", \"Almendra SC\", \"Amarante\", \"Amaranth\", \"Amatic SC\", \"Amethysta\", \"Amiri\", \"Amita\", \"Anaheim\", \"Andada\", \"Andika\", \"Angkor\", \"Annie Use Your Telescope\", \"Anonymous Pro\", \"Antic\", \"Antic Didone\", \"Antic Slab\", \"Anton\", \"Arapey\", \"Arbutus\", \"Arbutus Slab\", \"Architects Daughter\", \"Archivo Black\", \"Archivo Narrow\", \"Arimo\", \"Arizonia\", \"Armata\", \"Artifika\", \"Arvo\", \"Arya\", \"Asap\", \"Asar\", \"Asset\", \"Astloch\", \"Asul\", \"Atomic Age\", \"Aubrey\", \"Audiowide\", \"Autour One\", \"Average\", \"Average Sans\", \"Averia Gruesa Libre\", \"Averia Libre\", \"Averia Sans Libre\", \"Averia Serif Libre\", \"Bad Script\", \"Balthazar\", \"Bangers\", \"Basic\", \"Battambang\", \"Baumans\", \"Bayon\", \"Belgrano\", \"Belleza\", \"BenchNine\", \"Bentham\", \"Berkshire Swash\", \"Bevan\", \"Bigelow Rules\", \"Bigshot One\", \"Bilbo\", \"Bilbo Swash Caps\", \"Biryani\", \"Bitter\", \"Black Ops One\", \"Bokor\", \"Bonbon\", \"Boogaloo\", \"Bowlby One\", \"Bowlby One SC\", \"Brawler\", \"Bree Serif\", \"Bubblegum Sans\", \"Bubbler One\", \"Buda\", \"Buenard\", \"Butcherman\", \"Butterfly Kids\", \"Cabin\", \"Cabin Condensed\", \"Cabin Sketch\", \"Caesar Dressing\", \"Cagliostro\", \"Calligraffitti\", \"Cambay\", \"Cambo\", \"Candal\", \"Cantarell\", \"Cantata One\", \"Cantora One\", \"Capriola\", \"Cardo\", \"Carme\", \"Carrois Gothic\", \"Carrois Gothic SC\", \"Carter One\", \"Catamaran\", \"Caudex\", \"Caveat\", \"Caveat Brush\", \"Cedarville Cursive\", \"Ceviche One\", \"Changa One\", \"Chango\", \"Chau Philomene One\", \"Chela One\", \"Chelsea Market\", \"Chenla\", \"Cherry Cream Soda\", \"Cherry Swash\", \"Chewy\", \"Chicle\", \"Chivo\", \"Chonburi\", \"Cinzel\", \"Cinzel Decorative\", \"Clicker Script\", \"Coda\", \"Coda Caption\", \"Codystar\", \"Combo\", \"Comfortaa\", \"Coming Soon\", \"Concert One\", \"Condiment\", \"Content\", \"Contrail One\", \"Convergence\", \"Cookie\", \"Copse\", \"Corben\", \"Courgette\", \"Cousine\", \"Coustard\", \"Covered By Your Grace\", \"Crafty Girls\", \"Creepster\", \"Crete Round\", \"Crimson Text\", \"Croissant One\", \"Crushed\", \"Cuprum\", \"Cutive\", \"Cutive Mono\", \"Damion\", \"Dancing Script\", \"Dangrek\", \"Dawning of a New Day\", \"Days One\", \"Dekko\", \"Delius\", \"Delius Swash Caps\", \"Delius Unicase\", \"Della Respira\", \"Denk One\", \"Devonshire\", \"Dhurjati\", \"Didact Gothic\", \"Diplomata\", \"Diplomata SC\", \"Domine\", \"Donegal One\", \"Doppio One\", \"Dorsa\", \"Dosis\", \"Dr Sugiyama\", \"Droid Sans\", \"Droid Sans Mono\", \"Droid Serif\", \"Duru Sans\", \"Dynalight\", \"EB Garamond\", \"Eagle Lake\", \"Eater\", \"Economica\", \"Eczar\", \"Ek Mukta\", \"Electrolize\", \"Elsie\", \"Elsie Swash Caps\", \"Emblema One\", \"Emilys Candy\", \"Engagement\", \"Englebert\", \"Enriqueta\", \"Erica One\", \"Esteban\", \"Euphoria Script\", \"Ewert\", \"Exo\", \"Exo 2\", \"Expletus Sans\", \"Fanwood Text\", \"Fascinate\", \"Fascinate Inline\", \"Faster One\", \"Fasthand\", \"Fauna One\", \"Federant\", \"Federo\", \"Felipa\", \"Fenix\", \"Finger Paint\", \"Fira Mono\", \"Fira Sans\", \"Fjalla One\", \"Fjord One\", \"Flamenco\", \"Flavors\", \"Fondamento\", \"Fontdiner Swanky\", \"Forum\", \"Francois One\", \"Freckle Face\", \"Fredericka the Great\", \"Fredoka One\", \"Freehand\", \"Fresca\", \"Frijole\", \"Fruktur\", \"Fugaz One\", \"GFS Didot\", \"GFS Neohellenic\", \"Gabriela\", \"Gafata\", \"Galdeano\", \"Galindo\", \"Gentium Basic\", \"Gentium Book Basic\", \"Geo\", \"Geostar\", \"Geostar Fill\", \"Germania One\", \"Gidugu\", \"Gilda Display\", \"Give You Glory\", \"Glass Antiqua\", \"Glegoo\", \"Gloria Hallelujah\", \"Goblin One\", \"Gochi Hand\", \"Gorditas\", \"Goudy Bookletter 1911\", \"Graduate\", \"Grand Hotel\", \"Gravitas One\", \"Great Vibes\", \"Griffy\", \"Gruppo\", \"Gudea\", \"Gurajada\", \"Habibi\", \"Halant\", \"Hammersmith One\", \"Hanalei\", \"Hanalei Fill\", \"Handlee\", \"Hanuman\", \"Happy Monkey\", \"Headland One\", \"Henny Penny\", \"Herr Von Muellerhoff\", \"Hind\", \"Hind Siliguri\", \"Hind Vadodara\", \"Holtwood One SC\", \"Homemade Apple\", \"Homenaje\", \"IM Fell DW Pica\", \"IM Fell DW Pica SC\", \"IM Fell Double Pica\", \"IM Fell Double Pica SC\", \"IM Fell English\", \"IM Fell English SC\", \"IM Fell French Canon\", \"IM Fell French Canon SC\", \"IM Fell Great Primer\", \"IM Fell Great Primer SC\", \"Iceberg\", \"Iceland\", \"Imprima\", \"Inconsolata\", \"Inder\", \"Indie Flower\", \"Inika\", \"Inknut Antiqua\", \"Irish Grover\", \"Istok Web\", \"Italiana\", \"Italianno\", \"Itim\", \"Jacques Francois\", \"Jacques Francois Shadow\", \"Jaldi\", \"Jim Nightshade\", \"Jockey One\", \"Jolly Lodger\", \"Josefin Sans\", \"Josefin Slab\", \"Joti One\", \"Judson\", \"Julee\", \"Julius Sans One\", \"Junge\", \"Jura\", \"Just Another Hand\", \"Just Me Again Down Here\", \"Kadwa\", \"Kalam\", \"Kameron\", \"Kantumruy\", \"Karla\", \"Karma\", \"Kaushan Script\", \"Kavoon\", \"Kdam Thmor\", \"Keania One\", \"Kelly Slab\", \"Kenia\", \"Khand\", \"Khmer\", \"Khula\", \"Kite One\", \"Knewave\", \"Kotta One\", \"Koulen\", \"Kranky\", \"Kreon\", \"Kristi\", \"Krona One\", \"Kurale\", \"La Belle Aurore\", \"Laila\", \"Lakki Reddy\", \"Lancelot\", \"Lateef\", \"Lato\", \"League Script\", \"Leckerli One\", \"Ledger\", \"Lekton\", \"Lemon\", \"Libre Baskerville\", \"Life Savers\", \"Lilita One\", \"Lily Script One\", \"Limelight\", \"Linden Hill\", \"Lobster\", \"Lobster Two\", \"Londrina Outline\", \"Londrina Shadow\", \"Londrina Sketch\", \"Londrina Solid\", \"Lora\", \"Love Ya Like A Sister\", \"Loved by the King\", \"Lovers Quarrel\", \"Luckiest Guy\", \"Lusitana\", \"Lustria\", \"Macondo\", \"Macondo Swash Caps\", \"Magra\", \"Maiden Orange\", \"Mako\", \"Mallanna\", \"Mandali\", \"Marcellus\", \"Marcellus SC\", \"Marck Script\", \"Margarine\", \"Marko One\", \"Marmelad\", \"Martel\", \"Martel Sans\", \"Marvel\", \"Mate\", \"Mate SC\", \"Maven Pro\", \"McLaren\", \"Meddon\", \"MedievalSharp\", \"Medula One\", \"Megrim\", \"Meie Script\", \"Merienda\", \"Merienda One\", \"Merriweather\", \"Merriweather Sans\", \"Metal\", \"Metal Mania\", \"Metamorphous\", \"Metrophobic\", \"Michroma\", \"Milonga\", \"Miltonian\", \"Miltonian Tattoo\", \"Miniver\", \"Miss Fajardose\", \"Modak\", \"Modern Antiqua\", \"Molengo\", \"Molle\", \"Monda\", \"Monofett\", \"Monoton\", \"Monsieur La Doulaise\", \"Montaga\", \"Montez\", \"Montserrat\", \"Montserrat Alternates\", \"Montserrat Subrayada\", \"Moul\", \"Moulpali\", \"Mountains of Christmas\", \"Mouse Memoirs\", \"Mr Bedfort\", \"Mr Dafoe\", \"Mr De Haviland\", \"Mrs Saint Delafield\", \"Mrs Sheppards\", \"Muli\", \"Mystery Quest\", \"NTR\", \"Neucha\", \"Neuton\", \"New Rocker\", \"News Cycle\", \"Niconne\", \"Nixie One\", \"Nobile\", \"Nokora\", \"Norican\", \"Nosifer\", \"Nothing You Could Do\", \"Noticia Text\", \"Noto Sans\", \"Noto Serif\", \"Nova Cut\", \"Nova Flat\", \"Nova Mono\", \"Nova Oval\", \"Nova Round\", \"Nova Script\", \"Nova Slim\", \"Nova Square\", \"Numans\", \"Nunito\", \"Odor Mean Chey\", \"Offside\", \"Old Standard TT\", \"Oldenburg\", \"Oleo Script\", \"Oleo Script Swash Caps\", \"Open Sans\", \"Open Sans Condensed\", \"Oranienbaum\", \"Orbitron\", \"Oregano\", \"Orienta\", \"Original Surfer\", \"Oswald\", \"Over the Rainbow\", \"Overlock\", \"Overlock SC\", \"Ovo\", \"Oxygen\", \"Oxygen Mono\", \"PT Mono\", \"PT Sans\", \"PT Sans Caption\", \"PT Sans Narrow\", \"PT Serif\", \"PT Serif Caption\", \"Pacifico\", \"Palanquin\", \"Palanquin Dark\", \"Paprika\", \"Parisienne\", \"Passero One\", \"Passion One\", \"Pathway Gothic One\", \"Patrick Hand\", \"Patrick Hand SC\", \"Patua One\", \"Paytone One\", \"Peddana\", \"Peralta\", \"Permanent Marker\", \"Petit Formal Script\", \"Petrona\", \"Philosopher\", \"Piedra\", \"Pinyon Script\", \"Pirata One\", \"Plaster\", \"Play\", \"Playball\", \"Playfair Display\", \"Playfair Display SC\", \"Podkova\", \"Poiret One\", \"Poller One\", \"Poly\", \"Pompiere\", \"Pontano Sans\", \"Poppins\", \"Port Lligat Sans\", \"Port Lligat Slab\", \"Pragati Narrow\", \"Prata\", \"Preahvihear\", \"Press Start 2P\", \"Princess Sofia\", \"Prociono\", \"Prosto One\", \"Puritan\", \"Purple Purse\", \"Quando\", \"Quantico\", \"Quattrocento\", \"Quattrocento Sans\", \"Questrial\", \"Quicksand\", \"Quintessential\", \"Qwigley\", \"Racing Sans One\", \"Radley\", \"Rajdhani\", \"Raleway\", \"Raleway Dots\", \"Ramabhadra\", \"Ramaraja\", \"Rambla\", \"Rammetto One\", \"Ranchers\", \"Rancho\", \"Ranga\", \"Rationale\", \"Ravi Prakash\", \"Redressed\", \"Reenie Beanie\", \"Revalia\", \"Rhodium Libre\", \"Ribeye\", \"Ribeye Marrow\", \"Righteous\", \"Risque\", \"Roboto\", \"Roboto Condensed\", \"Roboto Mono\", \"Roboto Slab\", \"Rochester\", \"Rock Salt\", \"Rokkitt\", \"Romanesco\", \"Ropa Sans\", \"Rosario\", \"Rosarivo\", \"Rouge Script\", \"Rozha One\", \"Rubik\", \"Rubik Mono One\", \"Rubik One\", \"Ruda\", \"Rufina\", \"Ruge Boogie\", \"Ruluko\", \"Rum Raisin\", \"Ruslan Display\", \"Russo One\", \"Ruthie\", \"Rye\", \"Sacramento\", \"Sahitya\", \"Sail\", \"Salsa\", \"Sanchez\", \"Sancreek\", \"Sansita One\", \"Sarala\", \"Sarina\", \"Sarpanch\", \"Satisfy\", \"Scada\", \"Scheherazade\", \"Schoolbell\", \"Seaweed Script\", \"Sevillana\", \"Seymour One\", \"Shadows Into Light\", \"Shadows Into Light Two\", \"Shanti\", \"Share\", \"Share Tech\", \"Share Tech Mono\", \"Shojumaru\", \"Short Stack\", \"Siemreap\", \"Sigmar One\", \"Signika\", \"Signika Negative\", \"Simonetta\", \"Sintony\", \"Sirin Stencil\", \"Six Caps\", \"Skranji\", \"Slabo 13px\", \"Slabo 27px\", \"Slackey\", \"Smokum\", \"Smythe\", \"Sniglet\", \"Snippet\", \"Snowburst One\", \"Sofadi One\", \"Sofia\", \"Sonsie One\", \"Sorts Mill Goudy\", \"Source Code Pro\", \"Source Sans Pro\", \"Source Serif Pro\", \"Special Elite\", \"Spicy Rice\", \"Spinnaker\", \"Spirax\", \"Squada One\", \"Sree Krushnadevaraya\", \"Stalemate\", \"Stalinist One\", \"Stardos Stencil\", \"Stint Ultra Condensed\", \"Stint Ultra Expanded\", \"Stoke\", \"Strait\", \"Sue Ellen Francisco\", \"Sumana\", \"Sunshiney\", \"Supermercado One\", \"Sura\", \"Suranna\", \"Suravaram\", \"Suwannaphum\", \"Swanky and Moo Moo\", \"Syncopate\", \"Tangerine\", \"Taprom\", \"Tauri\", \"Teko\", \"Telex\", \"Tenali Ramakrishna\", \"Tenor Sans\", \"Text Me One\", \"The Girl Next Door\", \"Tienne\", \"Tillana\", \"Timmana\", \"Tinos\", \"Titan One\", \"Titillium Web\", \"Trade Winds\", \"Trocchi\", \"Trochut\", \"Trykker\", \"Tulpen One\", \"Ubuntu\", \"Ubuntu Condensed\", \"Ubuntu Mono\", \"Ultra\", \"Uncial Antiqua\", \"Underdog\", \"Unica One\", \"UnifrakturCook\", \"UnifrakturMaguntia\", \"Unkempt\", \"Unlock\", \"Unna\", \"VT323\", \"Vampiro One\", \"Varela\", \"Varela Round\", \"Vast Shadow\", \"Vesper Libre\", \"Vibur\", \"Vidaloka\", \"Viga\", \"Voces\", \"Volkhov\", \"Vollkorn\", \"Voltaire\", \"Waiting for the Sunrise\", \"Wallpoet\", \"Walter Turncoat\", \"Warnes\", \"Wellfleet\", \"Wendy One\", \"Wire One\", \"Work Sans\", \"Yanone Kaffeesatz\", \"Yantramanav\", \"Yellowtail\", \"Yeseva One\", \"Yesteryear\", \"Zeyada\"];\n\n}).call(this);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/**\n * @module ol/util\n */\n/**\n * @return {?} Any return.\n */\nexport function abstract() {\n return /** @type {?} */ ((function () {\n throw new Error('Unimplemented abstract method.');\n })());\n}\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nvar uidCounter_ = 0;\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {string} The unique ID for the object.\n * @api\n */\nexport function getUid(obj) {\n return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));\n}\n/**\n * OpenLayers version.\n * @type {string}\n */\nexport var VERSION = '6.6.0';\n//# sourceMappingURL=util.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/AssertionError\n */\nimport { VERSION } from './util.js';\n/**\n * Error object thrown when an assertion failed. This is an ECMA-262 Error,\n * extended with a `code` property.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.\n */\nvar AssertionError = /** @class */ (function (_super) {\n __extends(AssertionError, _super);\n /**\n * @param {number} code Error code.\n */\n function AssertionError(code) {\n var _this = this;\n var path = VERSION === 'latest' ? VERSION : 'v' + VERSION.split('-')[0];\n var message = 'Assertion failed. See https://openlayers.org/en/' +\n path +\n '/doc/errors/#' +\n code +\n ' for details.';\n _this = _super.call(this, message) || this;\n /**\n * Error code. The meaning of the code can be found on\n * https://openlayers.org/en/latest/doc/errors/ (replace `latest` with\n * the version found in the OpenLayers script's header comment if a version\n * other than the latest is used).\n * @type {number}\n * @api\n */\n _this.code = code;\n /**\n * @type {string}\n */\n _this.name = 'AssertionError';\n // Re-assign message, see https://github.com/Rich-Harris/buble/issues/40\n _this.message = message;\n return _this;\n }\n return AssertionError;\n}(Error));\nexport default AssertionError;\n//# sourceMappingURL=AssertionError.js.map","/**\n * @module ol/events/Event\n */\n/**\n * @classdesc\n * Stripped down implementation of the W3C DOM Level 2 Event interface.\n * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.\n *\n * This implementation only provides `type` and `target` properties, and\n * `stopPropagation` and `preventDefault` methods. It is meant as base class\n * for higher level events defined in the library, and works with\n * {@link module:ol/events/Target~Target}.\n */\nvar BaseEvent = /** @class */ (function () {\n /**\n * @param {string} type Type.\n */\n function BaseEvent(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n /**\n * @type {boolean}\n */\n this.defaultPrevented;\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n /**\n * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events\n * will be fired.\n * @api\n */\n BaseEvent.prototype.preventDefault = function () {\n this.defaultPrevented = true;\n };\n /**\n * Stop event propagation.\n * @api\n */\n BaseEvent.prototype.stopPropagation = function () {\n this.propagationStopped = true;\n };\n return BaseEvent;\n}());\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function stopPropagation(evt) {\n evt.stopPropagation();\n}\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function preventDefault(evt) {\n evt.preventDefault();\n}\nexport default BaseEvent;\n//# sourceMappingURL=Event.js.map","/**\n * @module ol/ObjectEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a property is changed.\n * @event module:ol/Object.ObjectEvent#propertychange\n * @api\n */\n PROPERTYCHANGE: 'propertychange',\n};\n/**\n * @typedef {'propertychange'} Types\n */\n//# sourceMappingURL=ObjectEventType.js.map","/**\n * @module ol/Disposable\n */\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nvar Disposable = /** @class */ (function () {\n function Disposable() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @protected\n */\n this.disposed = false;\n }\n /**\n * Clean up.\n */\n Disposable.prototype.dispose = function () {\n if (!this.disposed) {\n this.disposed = true;\n this.disposeInternal();\n }\n };\n /**\n * Extension point for disposable objects.\n * @protected\n */\n Disposable.prototype.disposeInternal = function () { };\n return Disposable;\n}());\nexport default Disposable;\n//# sourceMappingURL=Disposable.js.map","/**\n * @module ol/array\n */\n/**\n * Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.\n * https://github.com/darkskyapp/binary-search\n *\n * @param {Array<*>} haystack Items to search through.\n * @param {*} needle The item to look for.\n * @param {Function} [opt_comparator] Comparator function.\n * @return {number} The index of the item if found, -1 if not.\n */\nexport function binarySearch(haystack, needle, opt_comparator) {\n var mid, cmp;\n var comparator = opt_comparator || numberSafeCompareFunction;\n var low = 0;\n var high = haystack.length;\n var found = false;\n while (low < high) {\n /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n * to double (which gives the wrong results). */\n mid = low + ((high - low) >> 1);\n cmp = +comparator(haystack[mid], needle);\n if (cmp < 0.0) {\n /* Too low. */\n low = mid + 1;\n }\n else {\n /* Key found or too high */\n high = mid;\n found = !cmp;\n }\n }\n /* Key not found. */\n return found ? low : ~low;\n}\n/**\n * Compare function for array sort that is safe for numbers.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is less than, equal to, or greater than the second.\n */\nexport function numberSafeCompareFunction(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}\n/**\n * Whether the array contains the given object.\n * @param {Array<*>} arr The array to test for the presence of the element.\n * @param {*} obj The object for which to test.\n * @return {boolean} The object is in the array.\n */\nexport function includes(arr, obj) {\n return arr.indexOf(obj) >= 0;\n}\n/**\n * {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution} can use a function\n * of this type to determine which nearest resolution to use.\n *\n * This function takes a `{number}` representing a value between two array entries,\n * a `{number}` representing the value of the nearest higher entry and\n * a `{number}` representing the value of the nearest lower entry\n * as arguments and returns a `{number}`. If a negative number or zero is returned\n * the lower value will be used, if a positive number is returned the higher value\n * will be used.\n * @typedef {function(number, number, number): number} NearestDirectionFunction\n * @api\n */\n/**\n * @param {Array} arr Array in desccending order.\n * @param {number} target Target.\n * @param {number|NearestDirectionFunction} direction\n * 0 means return the nearest,\n * > 0 means return the largest nearest,\n * < 0 means return the smallest nearest.\n * @return {number} Index.\n */\nexport function linearFindNearest(arr, target, direction) {\n var n = arr.length;\n if (arr[0] <= target) {\n return 0;\n }\n else if (target <= arr[n - 1]) {\n return n - 1;\n }\n else {\n var i = void 0;\n if (direction > 0) {\n for (i = 1; i < n; ++i) {\n if (arr[i] < target) {\n return i - 1;\n }\n }\n }\n else if (direction < 0) {\n for (i = 1; i < n; ++i) {\n if (arr[i] <= target) {\n return i;\n }\n }\n }\n else {\n for (i = 1; i < n; ++i) {\n if (arr[i] == target) {\n return i;\n }\n else if (arr[i] < target) {\n if (typeof direction === 'function') {\n if (direction(target, arr[i - 1], arr[i]) > 0) {\n return i - 1;\n }\n else {\n return i;\n }\n }\n else if (arr[i - 1] - target < target - arr[i]) {\n return i - 1;\n }\n else {\n return i;\n }\n }\n }\n }\n return n - 1;\n }\n}\n/**\n * @param {Array<*>} arr Array.\n * @param {number} begin Begin index.\n * @param {number} end End index.\n */\nexport function reverseSubArray(arr, begin, end) {\n while (begin < end) {\n var tmp = arr[begin];\n arr[begin] = arr[end];\n arr[end] = tmp;\n ++begin;\n --end;\n }\n}\n/**\n * @param {Array} arr The array to modify.\n * @param {!Array|VALUE} data The elements or arrays of elements to add to arr.\n * @template VALUE\n */\nexport function extend(arr, data) {\n var extension = Array.isArray(data) ? data : [data];\n var length = extension.length;\n for (var i = 0; i < length; i++) {\n arr[arr.length] = extension[i];\n }\n}\n/**\n * @param {Array} arr The array to modify.\n * @param {VALUE} obj The element to remove.\n * @template VALUE\n * @return {boolean} If the element was removed.\n */\nexport function remove(arr, obj) {\n var i = arr.indexOf(obj);\n var found = i > -1;\n if (found) {\n arr.splice(i, 1);\n }\n return found;\n}\n/**\n * @param {Array} arr The array to search in.\n * @param {function(VALUE, number, ?) : boolean} func The function to compare.\n * @template VALUE\n * @return {VALUE|null} The element found or null.\n */\nexport function find(arr, func) {\n var length = arr.length >>> 0;\n var value;\n for (var i = 0; i < length; i++) {\n value = arr[i];\n if (func(value, i, arr)) {\n return value;\n }\n }\n return null;\n}\n/**\n * @param {Array|Uint8ClampedArray} arr1 The first array to compare.\n * @param {Array|Uint8ClampedArray} arr2 The second array to compare.\n * @return {boolean} Whether the two arrays are equal.\n */\nexport function equals(arr1, arr2) {\n var len1 = arr1.length;\n if (len1 !== arr2.length) {\n return false;\n }\n for (var i = 0; i < len1; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Sort the passed array such that the relative order of equal elements is preverved.\n * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.\n * @param {Array<*>} arr The array to sort (modifies original).\n * @param {!function(*, *): number} compareFnc Comparison function.\n * @api\n */\nexport function stableSort(arr, compareFnc) {\n var length = arr.length;\n var tmp = Array(arr.length);\n var i;\n for (i = 0; i < length; i++) {\n tmp[i] = { index: i, value: arr[i] };\n }\n tmp.sort(function (a, b) {\n return compareFnc(a.value, b.value) || a.index - b.index;\n });\n for (i = 0; i < arr.length; i++) {\n arr[i] = tmp[i].value;\n }\n}\n/**\n * @param {Array<*>} arr The array to search in.\n * @param {Function} func Comparison function.\n * @return {number} Return index.\n */\nexport function findIndex(arr, func) {\n var index;\n var found = !arr.every(function (el, idx) {\n index = idx;\n return !func(el, idx, arr);\n });\n return found ? index : -1;\n}\n/**\n * @param {Array<*>} arr The array to test.\n * @param {Function} [opt_func] Comparison function.\n * @param {boolean} [opt_strict] Strictly sorted (default false).\n * @return {boolean} Return index.\n */\nexport function isSorted(arr, opt_func, opt_strict) {\n var compare = opt_func || numberSafeCompareFunction;\n return arr.every(function (currentVal, index) {\n if (index === 0) {\n return true;\n }\n var res = compare(arr[index - 1], currentVal);\n return !(res > 0 || (opt_strict && res === 0));\n });\n}\n//# sourceMappingURL=array.js.map","/**\n * @module ol/functions\n */\nimport { equals as arrayEquals } from './array.js';\n/**\n * Always returns true.\n * @return {boolean} true.\n */\nexport function TRUE() {\n return true;\n}\n/**\n * Always returns false.\n * @return {boolean} false.\n */\nexport function FALSE() {\n return false;\n}\n/**\n * A reusable function, used e.g. as a default for callbacks.\n *\n * @return {void} Nothing.\n */\nexport function VOID() { }\n/**\n * Wrap a function in another function that remembers the last return. If the\n * returned function is called twice in a row with the same arguments and the same\n * this object, it will return the value from the first call in the second call.\n *\n * @param {function(...any): ReturnType} fn The function to memoize.\n * @return {function(...any): ReturnType} The memoized function.\n * @template ReturnType\n */\nexport function memoizeOne(fn) {\n var called = false;\n /** @type {ReturnType} */\n var lastResult;\n /** @type {Array} */\n var lastArgs;\n var lastThis;\n return function () {\n var nextArgs = Array.prototype.slice.call(arguments);\n if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {\n called = true;\n lastThis = this;\n lastArgs = nextArgs;\n lastResult = fn.apply(this, arguments);\n }\n return lastResult;\n };\n}\n//# sourceMappingURL=functions.js.map","/**\n * @module ol/obj\n */\n/**\n * Polyfill for Object.assign(). Assigns enumerable and own properties from\n * one or more source objects to a target object.\n * See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign.\n *\n * @param {!Object} target The target object.\n * @param {...Object} var_sources The source object(s).\n * @return {!Object} The modified target object.\n */\nexport var assign = typeof Object.assign === 'function'\n ? Object.assign\n : function (target, var_sources) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var output = Object(target);\n for (var i = 1, ii = arguments.length; i < ii; ++i) {\n var source = arguments[i];\n if (source !== undefined && source !== null) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n output[key] = source[key];\n }\n }\n }\n }\n return output;\n };\n/**\n * Removes all properties from an object.\n * @param {Object} object The object to clear.\n */\nexport function clear(object) {\n for (var property in object) {\n delete object[property];\n }\n}\n/**\n * Polyfill for Object.values(). Get an array of property values from an object.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values\n *\n * @param {!Object} object The object from which to get the values.\n * @return {!Array} The property values.\n * @template K,V\n */\nexport var getValues = typeof Object.values === 'function'\n ? Object.values\n : function (object) {\n var values = [];\n for (var property in object) {\n values.push(object[property]);\n }\n return values;\n };\n/**\n * Determine if an object has any properties.\n * @param {Object} object The object to check.\n * @return {boolean} The object is empty.\n */\nexport function isEmpty(object) {\n var property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n//# sourceMappingURL=obj.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/events/Target\n */\nimport Disposable from '../Disposable.js';\nimport Event from './Event.js';\nimport { VOID } from '../functions.js';\nimport { clear } from '../obj.js';\n/**\n * @typedef {EventTarget|Target} EventTargetLike\n */\n/**\n * @classdesc\n * A simplified implementation of the W3C DOM Level 2 EventTarget interface.\n * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.\n *\n * There are two important simplifications compared to the specification:\n *\n * 1. The handling of `useCapture` in `addEventListener` and\n * `removeEventListener`. There is no real capture model.\n * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.\n * There is no event target hierarchy. When a listener calls\n * `stopPropagation` or `preventDefault` on an event object, it means that no\n * more listeners after this one will be called. Same as when the listener\n * returns false.\n */\nvar Target = /** @class */ (function (_super) {\n __extends(Target, _super);\n /**\n * @param {*} [opt_target] Default event target for dispatched events.\n */\n function Target(opt_target) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {*}\n */\n _this.eventTarget_ = opt_target;\n /**\n * @private\n * @type {Object}\n */\n _this.pendingRemovals_ = null;\n /**\n * @private\n * @type {Object}\n */\n _this.dispatching_ = null;\n /**\n * @private\n * @type {Object>}\n */\n _this.listeners_ = null;\n return _this;\n }\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n Target.prototype.addEventListener = function (type, listener) {\n if (!type || !listener) {\n return;\n }\n var listeners = this.listeners_ || (this.listeners_ = {});\n var listenersForType = listeners[type] || (listeners[type] = []);\n if (listenersForType.indexOf(listener) === -1) {\n listenersForType.push(listener);\n }\n };\n /**\n * Dispatches an event and calls all listeners listening for events\n * of this type. The event parameter can either be a string or an\n * Object with a `type` property.\n *\n * @param {import(\"./Event.js\").default|string} event Event object.\n * @return {boolean|undefined} `false` if anyone called preventDefault on the\n * event object or if any of the listeners returned false.\n * @api\n */\n Target.prototype.dispatchEvent = function (event) {\n /** @type {import(\"./Event.js\").default|Event} */\n var evt = typeof event === 'string' ? new Event(event) : event;\n var type = evt.type;\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n var listeners = this.listeners_ && this.listeners_[type];\n var propagate;\n if (listeners) {\n var dispatching = this.dispatching_ || (this.dispatching_ = {});\n var pendingRemovals = this.pendingRemovals_ || (this.pendingRemovals_ = {});\n if (!(type in dispatching)) {\n dispatching[type] = 0;\n pendingRemovals[type] = 0;\n }\n ++dispatching[type];\n for (var i = 0, ii = listeners.length; i < ii; ++i) {\n if ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */ (listeners[i]).handleEvent(evt);\n }\n else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */ (listeners[i]).call(this, evt);\n }\n if (propagate === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n --dispatching[type];\n if (dispatching[type] === 0) {\n var pr = pendingRemovals[type];\n delete pendingRemovals[type];\n while (pr--) {\n this.removeEventListener(type, VOID);\n }\n delete dispatching[type];\n }\n return propagate;\n }\n };\n /**\n * Clean up.\n */\n Target.prototype.disposeInternal = function () {\n this.listeners_ && clear(this.listeners_);\n };\n /**\n * Get the listeners for a specified event type. Listeners are returned in the\n * order that they will be called in.\n *\n * @param {string} type Type.\n * @return {Array|undefined} Listeners.\n */\n Target.prototype.getListeners = function (type) {\n return (this.listeners_ && this.listeners_[type]) || undefined;\n };\n /**\n * @param {string} [opt_type] Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n Target.prototype.hasListener = function (opt_type) {\n if (!this.listeners_) {\n return false;\n }\n return opt_type\n ? opt_type in this.listeners_\n : Object.keys(this.listeners_).length > 0;\n };\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n Target.prototype.removeEventListener = function (type, listener) {\n var listeners = this.listeners_ && this.listeners_[type];\n if (listeners) {\n var index = listeners.indexOf(listener);\n if (index !== -1) {\n if (this.pendingRemovals_ && type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = VOID;\n ++this.pendingRemovals_[type];\n }\n else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n };\n return Target;\n}(Disposable));\nexport default Target;\n//# sourceMappingURL=Target.js.map","/**\n * @module ol/events/EventType\n */\n/**\n * @enum {string}\n * @const\n */\nexport default {\n /**\n * Generic change event. Triggered when the revision counter is increased.\n * @event module:ol/events/Event~BaseEvent#change\n * @api\n */\n CHANGE: 'change',\n /**\n * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\n BLUR: 'blur',\n CLEAR: 'clear',\n CONTEXTMENU: 'contextmenu',\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n DRAGENTER: 'dragenter',\n DRAGOVER: 'dragover',\n DROP: 'drop',\n FOCUS: 'focus',\n KEYDOWN: 'keydown',\n KEYPRESS: 'keypress',\n LOAD: 'load',\n RESIZE: 'resize',\n TOUCHMOVE: 'touchmove',\n WHEEL: 'wheel',\n};\n//# sourceMappingURL=EventType.js.map","/**\n * @module ol/events\n */\nimport { clear } from './obj.js';\n/**\n * Key to use with {@link module:ol/Observable~Observable#unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener Listener.\n * @property {import(\"./events/Target.js\").EventTargetLike} target Target.\n * @property {string} type Type.\n * @api\n */\n/**\n * Listener function. This function is called with an event object as argument.\n * When the function returns `false`, event propagation will stop.\n *\n * @typedef {function((Event|import(\"./events/Event.js\").default)): (void|boolean)} ListenerFunction\n * @api\n */\n/**\n * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent HandleEvent listener function.\n */\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\n */\n/**\n * Registers an event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` to a `this` object, and returns\n * a key for use with {@link module:ol/events.unlistenByKey}.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [opt_this] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean} [opt_once] If true, add the listener as one-off listener.\n * @return {EventsKey} Unique key for the listener.\n */\nexport function listen(target, type, listener, opt_this, opt_once) {\n if (opt_this && opt_this !== target) {\n listener = listener.bind(opt_this);\n }\n if (opt_once) {\n var originalListener_1 = listener;\n listener = function () {\n target.removeEventListener(type, listener);\n originalListener_1.apply(this, arguments);\n };\n }\n var eventsKey = {\n target: target,\n type: type,\n listener: listener,\n };\n target.addEventListener(type, listener);\n return eventsKey;\n}\n/**\n * Registers a one-off event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` as self-unregistering listener\n * to a `this` object, and returns a key for use with\n * {@link module:ol/events.unlistenByKey} in case the listener needs to be\n * unregistered before it is called.\n *\n * When {@link module:ol/events.listen} is called with the same arguments after this\n * function, the self-unregistering listener will be turned into a permanent\n * listener.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [opt_this] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @return {EventsKey} Key for unlistenByKey.\n */\nexport function listenOnce(target, type, listener, opt_this) {\n return listen(target, type, listener, opt_this, true);\n}\n/**\n * Unregisters event listeners on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * The argument passed to this function is the key returned from\n * {@link module:ol/events.listen} or {@link module:ol/events.listenOnce}.\n *\n * @param {EventsKey} key The key.\n */\nexport function unlistenByKey(key) {\n if (key && key.target) {\n key.target.removeEventListener(key.type, key.listener);\n clear(key);\n }\n}\n//# sourceMappingURL=events.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Observable\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport { listen, listenOnce, unlistenByKey } from './events.js';\n/***\n * @template {string} Type\n * @template {Event|import(\"./events/Event.js\").default} EventClass\n * @template Return\n * @typedef {(type: Type|Type[], listener: (event: EventClass) => (void|boolean)) => Return} OnSignature\n */\n/***\n * @template {string} Type\n * @template Return\n * @typedef {(type: Type[], listener: (event: Event|import(\"./events/Event\").default) => (void|boolean)) => Return} CombinedOnSignature\n */\n/***\n * @typedef {import(\"./events\").EventsKey|Array} OnReturn\n */\n/**\n * @typedef {'change'|'error'} EventTypes\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * An event target providing convenient methods for listener registration\n * and unregistration. A generic `change` event is always available through\n * {@link module:ol/Observable~Observable#changed}.\n *\n * @fires import(\"./events/Event.js\").default\n * @api\n */\nvar Observable = /** @class */ (function (_super) {\n __extends(Observable, _super);\n function Observable() {\n var _this = _super.call(this) || this;\n /***\n * @type {OnSignature}\n */\n _this.on = _this.onInternal;\n /***\n * @type {OnSignature}\n */\n _this.once = _this.onceInternal;\n /***\n * @type {OnSignature}\n */\n _this.un = _this.unInternal;\n /**\n * @private\n * @type {number}\n */\n _this.revision_ = 0;\n return _this;\n }\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n Observable.prototype.changed = function () {\n ++this.revision_;\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * Get the version number for this object. Each time the object is modified,\n * its version number will be incremented.\n * @return {number} Revision.\n * @api\n */\n Observable.prototype.getRevision = function () {\n return this.revision_;\n };\n /**\n * @param {string|Array} type Type.\n * @param {function(?): (void|boolean)} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array} Event key.\n * @protected\n */\n Observable.prototype.onInternal = function (type, listener) {\n if (Array.isArray(type)) {\n var len = type.length;\n var keys = new Array(len);\n for (var i = 0; i < len; ++i) {\n keys[i] = listen(this, type[i], listener);\n }\n return keys;\n }\n else {\n return listen(this, /** @type {string} */ (type), listener);\n }\n };\n /**\n * @param {string|Array} type Type.\n * @param {function(?): (void|boolean)} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array} Event key.\n * @protected\n */\n Observable.prototype.onceInternal = function (type, listener) {\n var key;\n if (Array.isArray(type)) {\n var len = type.length;\n key = new Array(len);\n for (var i = 0; i < len; ++i) {\n key[i] = listenOnce(this, type[i], listener);\n }\n }\n else {\n key = listenOnce(this, /** @type {string} */ (type), listener);\n }\n /** @type {Object} */ (listener).ol_key = key;\n return key;\n };\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array} type Type.\n * @param {function(?): (void|boolean)} listener Listener.\n * @protected\n */\n Observable.prototype.unInternal = function (type, listener) {\n var key = /** @type {Object} */ (listener).ol_key;\n if (key) {\n unByKey(key);\n }\n else if (Array.isArray(type)) {\n for (var i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n }\n else {\n this.removeEventListener(type, listener);\n }\n };\n return Observable;\n}(EventTarget));\n/**\n * Listen for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): (void|boolean)} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.on;\n/**\n * Listen once for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): (void|boolean)} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.once;\n/**\n * Unlisten for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): (void|boolean)} listener The listener function.\n * @api\n */\nObservable.prototype.un;\n/**\n * Removes an event listener using the key returned by `on()` or `once()`.\n * @param {import(\"./events.js\").EventsKey|Array} key The key returned by `on()`\n * or `once()` (or an array of keys).\n * @api\n */\nexport function unByKey(key) {\n if (Array.isArray(key)) {\n for (var i = 0, ii = key.length; i < ii; ++i) {\n unlistenByKey(key[i]);\n }\n }\n else {\n unlistenByKey(/** @type {import(\"./events.js\").EventsKey} */ (key));\n }\n}\nexport default Observable;\n//# sourceMappingURL=Observable.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Object\n */\nimport Event from './events/Event.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport Observable from './Observable.js';\nimport { assign, isEmpty } from './obj.js';\nimport { getUid } from './util.js';\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nvar ObjectEvent = /** @class */ (function (_super) {\n __extends(ObjectEvent, _super);\n /**\n * @param {string} type The event type.\n * @param {string} key The property name.\n * @param {*} oldValue The old value for `key`.\n */\n function ObjectEvent(type, key, oldValue) {\n var _this = _super.call(this, type) || this;\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n _this.key = key;\n /**\n * The old value. To get the new value use `e.target.get(e.key)` where\n * `e` is the event object.\n * @type {*}\n * @api\n */\n _this.oldValue = oldValue;\n return _this;\n }\n return ObjectEvent;\n}(Event));\nexport { ObjectEvent };\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} ObjectOnSignature\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Most non-trivial classes inherit from this.\n *\n * This extends {@link module:ol/Observable} with observable\n * properties, where each property is observable as well as the object as a\n * whole.\n *\n * Classes that inherit from this have pre-defined properties, to which you can\n * add your owns. The pre-defined properties are listed in this documentation as\n * 'Observable Properties', and have their own accessors; for example,\n * {@link module:ol/Map~Map} has a `target` property, accessed with\n * `getTarget()` and changed with `setTarget()`. Not all properties are however\n * settable. There are also general-purpose accessors `get()` and `set()`. For\n * example, `get('target')` is equivalent to `getTarget()`.\n *\n * The `set` accessors trigger a change event, and you can monitor this by\n * registering a listener. For example, {@link module:ol/View~View} has a\n * `center` property, so `view.on('change:center', function(evt) {...});` would\n * call the function whenever the value of the center property changes. Within\n * the function, `evt.target` would be the view, so `evt.target.getCenter()`\n * would return the new center.\n *\n * You can add your own observable properties with\n * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.\n * You can listen for changes on that property value with\n * `object.on('change:prop', listener)`. You can get a list of all\n * properties with {@link module:ol/Object~BaseObject#getProperties}.\n *\n * Note that the observable properties are separate from standard JS properties.\n * You can, for example, give your map object a title with\n * `map.title='New title'` and with `map.set('title', 'Another title')`. The\n * first will be a `hasOwnProperty`; the second will appear in\n * `getProperties()`. Only the second is observable.\n *\n * Properties can be deleted by using the unset method. E.g.\n * object.unset('foo').\n *\n * @fires ObjectEvent\n * @api\n */\nvar BaseObject = /** @class */ (function (_super) {\n __extends(BaseObject, _super);\n /**\n * @param {Object} [opt_values] An object with key-value pairs.\n */\n function BaseObject(opt_values) {\n var _this = _super.call(this) || this;\n /***\n * @type {ObjectOnSignature}\n */\n _this.on;\n /***\n * @type {ObjectOnSignature}\n */\n _this.once;\n /***\n * @type {ObjectOnSignature}\n */\n _this.un;\n // Call {@link module:ol/util.getUid} to ensure that the order of objects' ids is\n // the same as the order in which they were created. This also helps to\n // ensure that object properties are always added in the same order, which\n // helps many JavaScript engines generate faster code.\n getUid(_this);\n /**\n * @private\n * @type {Object}\n */\n _this.values_ = null;\n if (opt_values !== undefined) {\n _this.setProperties(opt_values);\n }\n return _this;\n }\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n BaseObject.prototype.get = function (key) {\n var value;\n if (this.values_ && this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n };\n /**\n * Get a list of object property names.\n * @return {Array} List of property names.\n * @api\n */\n BaseObject.prototype.getKeys = function () {\n return (this.values_ && Object.keys(this.values_)) || [];\n };\n /**\n * Get an object of all property names and values.\n * @return {Object} Object.\n * @api\n */\n BaseObject.prototype.getProperties = function () {\n return (this.values_ && assign({}, this.values_)) || {};\n };\n /**\n * @return {boolean} The object has properties.\n */\n BaseObject.prototype.hasProperties = function () {\n return !!this.values_;\n };\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n BaseObject.prototype.notify = function (key, oldValue) {\n var eventType;\n eventType = \"change:\" + key;\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n eventType = ObjectEventType.PROPERTYCHANGE;\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n };\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n BaseObject.prototype.addChangeListener = function (key, listener) {\n this.addEventListener(\"change:\" + key, listener);\n };\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n BaseObject.prototype.removeChangeListener = function (key, listener) {\n this.removeEventListener(\"change:\" + key, listener);\n };\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean} [opt_silent] Update without triggering an event.\n * @api\n */\n BaseObject.prototype.set = function (key, value, opt_silent) {\n var values = this.values_ || (this.values_ = {});\n if (opt_silent) {\n values[key] = value;\n }\n else {\n var oldValue = values[key];\n values[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\n }\n }\n };\n /**\n * Sets a collection of key-value pairs. Note that this changes any existing\n * properties and adds new ones (it does not remove any existing properties).\n * @param {Object} values Values.\n * @param {boolean} [opt_silent] Update without triggering an event.\n * @api\n */\n BaseObject.prototype.setProperties = function (values, opt_silent) {\n for (var key in values) {\n this.set(key, values[key], opt_silent);\n }\n };\n /**\n * Apply any properties from another object without triggering events.\n * @param {BaseObject} source The source object.\n * @protected\n */\n BaseObject.prototype.applyProperties = function (source) {\n if (!source.values_) {\n return;\n }\n assign(this.values_ || (this.values_ = {}), source.values_);\n };\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean} [opt_silent] Unset without triggering an event.\n * @api\n */\n BaseObject.prototype.unset = function (key, opt_silent) {\n if (this.values_ && key in this.values_) {\n var oldValue = this.values_[key];\n delete this.values_[key];\n if (isEmpty(this.values_)) {\n this.values_ = null;\n }\n if (!opt_silent) {\n this.notify(key, oldValue);\n }\n }\n };\n return BaseObject;\n}(Observable));\nexport default BaseObject;\n//# sourceMappingURL=Object.js.map","/**\n * @module ol/CollectionEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when an item is added to the collection.\n * @event module:ol/Collection.CollectionEvent#add\n * @api\n */\n ADD: 'add',\n /**\n * Triggered when an item is removed from the collection.\n * @event module:ol/Collection.CollectionEvent#remove\n * @api\n */\n REMOVE: 'remove',\n};\n//# sourceMappingURL=CollectionEventType.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Collection\n */\nimport AssertionError from './AssertionError.js';\nimport BaseObject from './Object.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport Event from './events/Event.js';\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n LENGTH: 'length',\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n */\nvar CollectionEvent = /** @class */ (function (_super) {\n __extends(CollectionEvent, _super);\n /**\n * @param {import(\"./CollectionEventType.js\").default} type Type.\n * @param {*} [opt_element] Element.\n * @param {number} [opt_index] The index of the added or removed element.\n */\n function CollectionEvent(type, opt_element, opt_index) {\n var _this = _super.call(this, type) || this;\n /**\n * The element that is added to or removed from the collection.\n * @type {*}\n * @api\n */\n _this.element = opt_element;\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n _this.index = opt_index;\n return _this;\n }\n return CollectionEvent;\n}(Event));\nexport { CollectionEvent };\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature<'add'|'remove', CollectionEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature} CollectionOnSignature\n */\n/**\n * @typedef {Object} Options\n * @property {boolean} [unique=false] Disallow the same item from being added to\n * the collection twice.\n */\n/**\n * @classdesc\n * An expanded version of standard JS Array, adding convenience methods for\n * manipulation. Add and remove changes to the Collection trigger a Collection\n * event. Note that this does not cover changes to the objects _within_ the\n * Collection; they trigger events on the appropriate object, not on the\n * Collection as a whole.\n *\n * @fires CollectionEvent\n *\n * @template T\n * @api\n */\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n /**\n * @param {Array} [opt_array] Array.\n * @param {Options} [opt_options] Collection options.\n */\n function Collection(opt_array, opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {CollectionOnSignature}\n */\n _this.on;\n /***\n * @type {CollectionOnSignature}\n */\n _this.once;\n /***\n * @type {CollectionOnSignature}\n */\n _this.un;\n var options = opt_options || {};\n /**\n * @private\n * @type {boolean}\n */\n _this.unique_ = !!options.unique;\n /**\n * @private\n * @type {!Array}\n */\n _this.array_ = opt_array ? opt_array : [];\n if (_this.unique_) {\n for (var i = 0, ii = _this.array_.length; i < ii; ++i) {\n _this.assertUnique_(_this.array_[i], i);\n }\n }\n _this.updateLength_();\n return _this;\n }\n /**\n * Remove all elements from the collection.\n * @api\n */\n Collection.prototype.clear = function () {\n while (this.getLength() > 0) {\n this.pop();\n }\n };\n /**\n * Add elements to the collection. This pushes each item in the provided array\n * to the end of the collection.\n * @param {!Array} arr Array.\n * @return {Collection} This collection.\n * @api\n */\n Collection.prototype.extend = function (arr) {\n for (var i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\n };\n /**\n * Iterate over each element, calling the provided callback.\n * @param {function(T, number, Array): *} f The function to call\n * for every element. This function takes 3 arguments (the element, the\n * index and the array). The return value is ignored.\n * @api\n */\n Collection.prototype.forEach = function (f) {\n var array = this.array_;\n for (var i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\n }\n };\n /**\n * Get a reference to the underlying Array object. Warning: if the array\n * is mutated, no events will be dispatched by the collection, and the\n * collection's \"length\" property won't be in sync with the actual length\n * of the array.\n * @return {!Array} Array.\n * @api\n */\n Collection.prototype.getArray = function () {\n return this.array_;\n };\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n Collection.prototype.item = function (index) {\n return this.array_[index];\n };\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n Collection.prototype.getLength = function () {\n return this.get(Property.LENGTH);\n };\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n Collection.prototype.insertAt = function (index, elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD, elem, index));\n };\n /**\n * Remove the last element of the collection and return it.\n * Return `undefined` if the collection is empty.\n * @return {T|undefined} Element.\n * @api\n */\n Collection.prototype.pop = function () {\n return this.removeAt(this.getLength() - 1);\n };\n /**\n * Insert the provided element at the end of the collection.\n * @param {T} elem Element.\n * @return {number} New length of the collection.\n * @api\n */\n Collection.prototype.push = function (elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n var n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\n };\n /**\n * Remove the first occurrence of an element from the collection.\n * @param {T} elem Element.\n * @return {T|undefined} The removed element or undefined if none found.\n * @api\n */\n Collection.prototype.remove = function (elem) {\n var arr = this.array_;\n for (var i = 0, ii = arr.length; i < ii; ++i) {\n if (arr[i] === elem) {\n return this.removeAt(i);\n }\n }\n return undefined;\n };\n /**\n * Remove the element at the provided index and return it.\n * Return `undefined` if the collection does not contain this index.\n * @param {number} index Index.\n * @return {T|undefined} Value.\n * @api\n */\n Collection.prototype.removeAt = function (index) {\n var prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE, prev, index));\n return prev;\n };\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n Collection.prototype.setAt = function (index, elem) {\n var n = this.getLength();\n if (index < n) {\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n var prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE, prev, index));\n this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD, elem, index));\n }\n else {\n for (var j = n; j < index; ++j) {\n this.insertAt(j, undefined);\n }\n this.insertAt(index, elem);\n }\n };\n /**\n * @private\n */\n Collection.prototype.updateLength_ = function () {\n this.set(Property.LENGTH, this.array_.length);\n };\n /**\n * @private\n * @param {T} elem Element.\n * @param {number} [opt_except] Optional index to ignore.\n */\n Collection.prototype.assertUnique_ = function (elem, opt_except) {\n for (var i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== opt_except) {\n throw new AssertionError(58);\n }\n }\n };\n return Collection;\n}(BaseObject));\nexport default Collection;\n//# sourceMappingURL=Collection.js.map","/**\n * @module ol/asserts\n */\nimport AssertionError from './AssertionError.js';\n/**\n * @param {*} assertion Assertion we expected to be truthy.\n * @param {number} errorCode Error code.\n */\nexport function assert(assertion, errorCode) {\n if (!assertion) {\n throw new AssertionError(errorCode);\n }\n}\n//# sourceMappingURL=asserts.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Feature\n */\nimport BaseObject from './Object.js';\nimport EventType from './events/EventType.js';\nimport { assert } from './asserts.js';\nimport { listen, unlistenByKey } from './events.js';\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\n */\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} FeatureOnSignature\n */\n/**\n * @classdesc\n * A vector object for geographic features with a geometry and other\n * attribute properties, similar to the features in vector file formats like\n * GeoJSON.\n *\n * Features can be styled individually with `setStyle`; otherwise they use the\n * style of their vector layer.\n *\n * Note that attribute properties are set as {@link module:ol/Object} properties on\n * the feature object, so they are observable, and have get/set accessors.\n *\n * Typically, a feature has a single geometry property. You can set the\n * geometry using the `setGeometry` method and get it with `getGeometry`.\n * It is possible to store more than one geometry on a feature using attribute\n * properties. By default, the geometry used for rendering is identified by\n * the property name `geometry`. If you want to use another geometry property\n * for rendering, use the `setGeometryName` method to change the attribute\n * property associated with the geometry for the feature. For example:\n *\n * ```js\n *\n * import Feature from 'ol/Feature';\n * import Polygon from 'ol/geom/Polygon';\n * import Point from 'ol/geom/Point';\n *\n * var feature = new Feature({\n * geometry: new Polygon(polyCoords),\n * labelPoint: new Point(labelCoords),\n * name: 'My Polygon'\n * });\n *\n * // get the polygon geometry\n * var poly = feature.getGeometry();\n *\n * // Render the feature as a point using the coordinates from labelPoint\n * feature.setGeometryName('labelPoint');\n *\n * // get the point geometry\n * var point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} Geometry\n */\nvar Feature = /** @class */ (function (_super) {\n __extends(Feature, _super);\n /**\n * @param {Geometry|Object} [opt_geometryOrProperties]\n * You may pass a Geometry object directly, or an object literal containing\n * properties. If you pass an object literal, you may include a Geometry\n * associated with a `geometry` key.\n */\n function Feature(opt_geometryOrProperties) {\n var _this = _super.call(this) || this;\n /***\n * @type {FeatureOnSignature}\n */\n _this.on;\n /***\n * @type {FeatureOnSignature}\n */\n _this.once;\n /***\n * @type {FeatureOnSignature}\n */\n _this.un;\n /**\n * @private\n * @type {number|string|undefined}\n */\n _this.id_ = undefined;\n /**\n * @type {string}\n * @private\n */\n _this.geometryName_ = 'geometry';\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n _this.style_ = null;\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n _this.styleFunction_ = undefined;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.geometryChangeKey_ = null;\n _this.addChangeListener(_this.geometryName_, _this.handleGeometryChanged_);\n if (opt_geometryOrProperties) {\n if (typeof (\n /** @type {?} */ (opt_geometryOrProperties).getSimplifiedGeometry) === 'function') {\n var geometry = /** @type {Geometry} */ (opt_geometryOrProperties);\n _this.setGeometry(geometry);\n }\n else {\n /** @type {Object} */\n var properties = opt_geometryOrProperties;\n _this.setProperties(properties);\n }\n }\n return _this;\n }\n /**\n * Clone this feature. If the original feature has a geometry it\n * is also cloned. The feature id is not set in the clone.\n * @return {Feature} The clone.\n * @api\n */\n Feature.prototype.clone = function () {\n var clone = new Feature(this.hasProperties() ? this.getProperties() : null);\n clone.setGeometryName(this.getGeometryName());\n var geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(geometry.clone());\n }\n var style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\n };\n /**\n * Get the feature's default geometry. A feature may have any number of named\n * geometries. The \"default\" geometry (the one that is rendered by default) is\n * set when calling {@link module:ol/Feature~Feature#setGeometry}.\n * @return {Geometry|undefined} The default geometry for the feature.\n * @api\n * @observable\n */\n Feature.prototype.getGeometry = function () {\n return /** @type {Geometry|undefined} */ (this.get(this.geometryName_));\n };\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is either set when reading data from a remote source or set explicitly by\n * calling {@link module:ol/Feature~Feature#setId}.\n * @return {number|string|undefined} Id.\n * @api\n */\n Feature.prototype.getId = function () {\n return this.id_;\n };\n /**\n * Get the name of the feature's default geometry. By default, the default\n * geometry is named `geometry`.\n * @return {string} Get the property name associated with the default geometry\n * for this feature.\n * @api\n */\n Feature.prototype.getGeometryName = function () {\n return this.geometryName_;\n };\n /**\n * Get the feature's style. Will return what was provided to the\n * {@link module:ol/Feature~Feature#setStyle} method.\n * @return {import(\"./style/Style.js\").StyleLike|undefined} The feature style.\n * @api\n */\n Feature.prototype.getStyle = function () {\n return this.style_;\n };\n /**\n * Get the feature's style function.\n * @return {import(\"./style/Style.js\").StyleFunction|undefined} Return a function\n * representing the current style of this feature.\n * @api\n */\n Feature.prototype.getStyleFunction = function () {\n return this.styleFunction_;\n };\n /**\n * @private\n */\n Feature.prototype.handleGeometryChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n Feature.prototype.handleGeometryChanged_ = function () {\n if (this.geometryChangeKey_) {\n unlistenByKey(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n var geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = listen(geometry, EventType.CHANGE, this.handleGeometryChange_, this);\n }\n this.changed();\n };\n /**\n * Set the default geometry for the feature. This will update the property\n * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.\n * @param {Geometry|undefined} geometry The new geometry.\n * @api\n * @observable\n */\n Feature.prototype.setGeometry = function (geometry) {\n this.set(this.geometryName_, geometry);\n };\n /**\n * Set the style for the feature to override the layer style. This can be a\n * single style object, an array of styles, or a function that takes a\n * resolution and returns an array of styles. To unset the feature style, call\n * `setStyle()` without arguments or a falsey value.\n * @param {import(\"./style/Style.js\").StyleLike} [opt_style] Style for this feature.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n Feature.prototype.setStyle = function (opt_style) {\n this.style_ = opt_style;\n this.styleFunction_ = !opt_style\n ? undefined\n : createStyleFunction(opt_style);\n this.changed();\n };\n /**\n * Set the feature id. The feature id is considered stable and may be used when\n * requesting features or comparing identifiers returned from a remote source.\n * The feature id can be used with the\n * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.\n * @param {number|string|undefined} id The feature id.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n Feature.prototype.setId = function (id) {\n this.id_ = id;\n this.changed();\n };\n /**\n * Set the property name to be used when getting the feature's default geometry.\n * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with\n * this name will be returned.\n * @param {string} name The property name of the default geometry.\n * @api\n */\n Feature.prototype.setGeometryName = function (name) {\n this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n };\n return Feature;\n}(BaseObject));\n/**\n * Convert the provided object into a feature style function. Functions passed\n * through unchanged. Arrays of Style or single style objects wrapped\n * in a new feature style function.\n * @param {!import(\"./style/Style.js\").StyleFunction|!Array|!import(\"./style/Style.js\").default} obj\n * A feature style function, a single style, or an array of styles.\n * @return {import(\"./style/Style.js\").StyleFunction} A style function.\n */\nexport function createStyleFunction(obj) {\n if (typeof obj === 'function') {\n return obj;\n }\n else {\n /**\n * @type {Array}\n */\n var styles_1;\n if (Array.isArray(obj)) {\n styles_1 = obj;\n }\n else {\n assert(typeof ( /** @type {?} */(obj).getZIndex) === 'function', 41); // Expected an `import(\"./style/Style.js\").Style` or an array of `import(\"./style/Style.js\").Style`\n var style = /** @type {import(\"./style/Style.js\").default} */ (obj);\n styles_1 = [style];\n }\n return function () {\n return styles_1;\n };\n }\n}\nexport default Feature;\n//# sourceMappingURL=Feature.js.map","/**\n * @module ol/geom/GeometryLayout\n */\n/**\n * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z')\n * or measure ('M') coordinate is available. Supported values are `'XY'`,\n * `'XYZ'`, `'XYM'`, `'XYZM'`.\n * @enum {string}\n */\nexport default {\n XY: 'XY',\n XYZ: 'XYZ',\n XYM: 'XYM',\n XYZM: 'XYZM',\n};\n//# sourceMappingURL=GeometryLayout.js.map","/**\n * @module ol/geom/GeometryType\n */\n/**\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`,\n * `'GeometryCollection'`, `'Circle'`.\n * @enum {string}\n */\nexport default {\n POINT: 'Point',\n LINE_STRING: 'LineString',\n LINEAR_RING: 'LinearRing',\n POLYGON: 'Polygon',\n MULTI_POINT: 'MultiPoint',\n MULTI_LINE_STRING: 'MultiLineString',\n MULTI_POLYGON: 'MultiPolygon',\n GEOMETRY_COLLECTION: 'GeometryCollection',\n CIRCLE: 'Circle',\n};\n//# sourceMappingURL=GeometryType.js.map","/**\n * @module ol/proj/Units\n */\n/**\n * Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or\n * `'us-ft'`.\n * @enum {string}\n */\nvar Units = {\n /**\n * Degrees\n * @api\n */\n DEGREES: 'degrees',\n /**\n * Feet\n * @api\n */\n FEET: 'ft',\n /**\n * Meters\n * @api\n */\n METERS: 'm',\n /**\n * Pixels\n * @api\n */\n PIXELS: 'pixels',\n /**\n * Tile Pixels\n * @api\n */\n TILE_PIXELS: 'tile-pixels',\n /**\n * US Feet\n * @api\n */\n USFEET: 'us-ft',\n};\n/**\n * Meters per unit lookup table.\n * @const\n * @type {Object}\n * @api\n */\nexport var METERS_PER_UNIT = {};\n// use the radius of the Normal sphere\nMETERS_PER_UNIT[Units.DEGREES] = (2 * Math.PI * 6370997) / 360;\nMETERS_PER_UNIT[Units.FEET] = 0.3048;\nMETERS_PER_UNIT[Units.METERS] = 1;\nMETERS_PER_UNIT[Units.USFEET] = 1200 / 3937;\nexport default Units;\n//# sourceMappingURL=Units.js.map","/**\n * @module ol/transform\n */\nimport { WORKER_OFFSCREEN_CANVAS } from './has.js';\nimport { assert } from './asserts.js';\n/**\n * An array representing an affine 2d transformation for use with\n * {@link module:ol/transform} functions. The array has 6 elements.\n * @typedef {!Array} Transform\n * @api\n */\n/**\n * Collection of affine 2d transformation functions. The functions work on an\n * array of 6 elements. The element order is compatible with the [SVGMatrix\n * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is\n * a subset (elements a to f) of a 3×3 matrix:\n * ```\n * [ a c e ]\n * [ b d f ]\n * [ 0 0 1 ]\n * ```\n */\n/**\n * @private\n * @type {Transform}\n */\nvar tmp_ = new Array(6);\n/**\n * Create an identity transform.\n * @return {!Transform} Identity transform.\n */\nexport function create() {\n return [1, 0, 0, 1, 0, 0];\n}\n/**\n * Resets the given transform to an identity transform.\n * @param {!Transform} transform Transform.\n * @return {!Transform} Transform.\n */\nexport function reset(transform) {\n return set(transform, 1, 0, 0, 1, 0, 0);\n}\n/**\n * Multiply the underlying matrices of two transforms and return the result in\n * the first transform.\n * @param {!Transform} transform1 Transform parameters of matrix 1.\n * @param {!Transform} transform2 Transform parameters of matrix 2.\n * @return {!Transform} transform1 multiplied with transform2.\n */\nexport function multiply(transform1, transform2) {\n var a1 = transform1[0];\n var b1 = transform1[1];\n var c1 = transform1[2];\n var d1 = transform1[3];\n var e1 = transform1[4];\n var f1 = transform1[5];\n var a2 = transform2[0];\n var b2 = transform2[1];\n var c2 = transform2[2];\n var d2 = transform2[3];\n var e2 = transform2[4];\n var f2 = transform2[5];\n transform1[0] = a1 * a2 + c1 * b2;\n transform1[1] = b1 * a2 + d1 * b2;\n transform1[2] = a1 * c2 + c1 * d2;\n transform1[3] = b1 * c2 + d1 * d2;\n transform1[4] = a1 * e2 + c1 * f2 + e1;\n transform1[5] = b1 * e2 + d1 * f2 + f1;\n return transform1;\n}\n/**\n * Set the transform components a-f on a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} a The a component of the transform.\n * @param {number} b The b component of the transform.\n * @param {number} c The c component of the transform.\n * @param {number} d The d component of the transform.\n * @param {number} e The e component of the transform.\n * @param {number} f The f component of the transform.\n * @return {!Transform} Matrix with transform applied.\n */\nexport function set(transform, a, b, c, d, e, f) {\n transform[0] = a;\n transform[1] = b;\n transform[2] = c;\n transform[3] = d;\n transform[4] = e;\n transform[5] = f;\n return transform;\n}\n/**\n * Set transform on one matrix from another matrix.\n * @param {!Transform} transform1 Matrix to set transform to.\n * @param {!Transform} transform2 Matrix to set transform from.\n * @return {!Transform} transform1 with transform from transform2 applied.\n */\nexport function setFromArray(transform1, transform2) {\n transform1[0] = transform2[0];\n transform1[1] = transform2[1];\n transform1[2] = transform2[2];\n transform1[3] = transform2[3];\n transform1[4] = transform2[4];\n transform1[5] = transform2[5];\n return transform1;\n}\n/**\n * Transforms the given coordinate with the given transform returning the\n * resulting, transformed coordinate. The coordinate will be modified in-place.\n *\n * @param {Transform} transform The transformation.\n * @param {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} coordinate The coordinate to transform.\n * @return {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} return coordinate so that operations can be\n * chained together.\n */\nexport function apply(transform, coordinate) {\n var x = coordinate[0];\n var y = coordinate[1];\n coordinate[0] = transform[0] * x + transform[2] * y + transform[4];\n coordinate[1] = transform[1] * x + transform[3] * y + transform[5];\n return coordinate;\n}\n/**\n * Applies rotation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} angle Angle in radians.\n * @return {!Transform} The rotated transform.\n */\nexport function rotate(transform, angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0));\n}\n/**\n * Applies scale to a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scaled transform.\n */\nexport function scale(transform, x, y) {\n return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0));\n}\n/**\n * Creates a scale transform.\n * @param {!Transform} target Transform to overwrite.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scale transform.\n */\nexport function makeScale(target, x, y) {\n return set(target, x, 0, 0, y, 0, 0);\n}\n/**\n * Applies translation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} dx Translation x.\n * @param {number} dy Translation y.\n * @return {!Transform} The translated transform.\n */\nexport function translate(transform, dx, dy) {\n return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy));\n}\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative).\n * @param {!Transform} transform The transform (will be modified in place).\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {!Transform} The composite transform.\n */\nexport function compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) {\n var sin = Math.sin(angle);\n var cos = Math.cos(angle);\n transform[0] = sx * cos;\n transform[1] = sy * sin;\n transform[2] = -sx * sin;\n transform[3] = sy * cos;\n transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1;\n transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1;\n return transform;\n}\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative). The resulting transform\n * string can be applied as `transform` property of an HTMLElement's style.\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {string} The composite css transform.\n * @api\n */\nexport function composeCssTransform(dx1, dy1, sx, sy, angle, dx2, dy2) {\n return toString(compose(create(), dx1, dy1, sx, sy, angle, dx2, dy2));\n}\n/**\n * Invert the given transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (source) transform.\n */\nexport function invert(source) {\n return makeInverse(source, source);\n}\n/**\n * Invert the given transform.\n * @param {!Transform} target Transform to be set as the inverse of\n * the source transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (target) transform.\n */\nexport function makeInverse(target, source) {\n var det = determinant(source);\n assert(det !== 0, 32); // Transformation matrix cannot be inverted\n var a = source[0];\n var b = source[1];\n var c = source[2];\n var d = source[3];\n var e = source[4];\n var f = source[5];\n target[0] = d / det;\n target[1] = -b / det;\n target[2] = -c / det;\n target[3] = a / det;\n target[4] = (c * f - d * e) / det;\n target[5] = -(a * f - b * e) / det;\n return target;\n}\n/**\n * Returns the determinant of the given matrix.\n * @param {!Transform} mat Matrix.\n * @return {number} Determinant.\n */\nexport function determinant(mat) {\n return mat[0] * mat[3] - mat[1] * mat[2];\n}\n/**\n * @type {HTMLElement}\n * @private\n */\nvar transformStringDiv;\n/**\n * A rounded string version of the transform. This can be used\n * for CSS transforms.\n * @param {!Transform} mat Matrix.\n * @return {string} The transform as a string.\n */\nexport function toString(mat) {\n var transformString = 'matrix(' + mat.join(', ') + ')';\n if (WORKER_OFFSCREEN_CANVAS) {\n return transformString;\n }\n var node = transformStringDiv || (transformStringDiv = document.createElement('div'));\n node.style.transform = transformString;\n return node.style.transform;\n}\n//# sourceMappingURL=transform.js.map","/**\n * @module ol/has\n */\nvar ua = typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined'\n ? navigator.userAgent.toLowerCase()\n : '';\n/**\n * User agent string says we are dealing with Firefox as browser.\n * @type {boolean}\n */\nexport var FIREFOX = ua.indexOf('firefox') !== -1;\n/**\n * User agent string says we are dealing with Safari as browser.\n * @type {boolean}\n */\nexport var SAFARI = ua.indexOf('safari') !== -1 && ua.indexOf('chrom') == -1;\n/**\n * User agent string says we are dealing with a WebKit engine.\n * @type {boolean}\n */\nexport var WEBKIT = ua.indexOf('webkit') !== -1 && ua.indexOf('edge') == -1;\n/**\n * User agent string says we are dealing with a Mac as platform.\n * @type {boolean}\n */\nexport var MAC = ua.indexOf('macintosh') !== -1;\n/**\n * The ratio between physical pixels and device-independent pixels\n * (dips) on the device (`window.devicePixelRatio`).\n * @const\n * @type {number}\n * @api\n */\nexport var DEVICE_PIXEL_RATIO = typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;\n/**\n * The execution context is a worker with OffscreenCanvas available.\n * @const\n * @type {boolean}\n */\nexport var WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope !== 'undefined' &&\n typeof OffscreenCanvas !== 'undefined' &&\n self instanceof WorkerGlobalScope; //eslint-disable-line\n/**\n * Image.prototype.decode() is supported.\n * @type {boolean}\n */\nexport var IMAGE_DECODE = typeof Image !== 'undefined' && Image.prototype.decode;\n/**\n * @type {boolean}\n */\nexport var PASSIVE_EVENT_LISTENERS = (function () {\n var passive = false;\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function () {\n passive = true;\n },\n });\n window.addEventListener('_', null, options);\n window.removeEventListener('_', null, options);\n }\n catch (error) {\n // passive not supported\n }\n return passive;\n})();\n//# sourceMappingURL=has.js.map","/**\n * @module ol/extent/Corner\n */\n/**\n * Extent corner.\n * @enum {string}\n */\nexport default {\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_RIGHT: 'bottom-right',\n TOP_LEFT: 'top-left',\n TOP_RIGHT: 'top-right',\n};\n//# sourceMappingURL=Corner.js.map","/**\n * @module ol/extent/Relationship\n */\n/**\n * Relationship to an extent.\n * @enum {number}\n */\nexport default {\n UNKNOWN: 0,\n INTERSECTING: 1,\n ABOVE: 2,\n RIGHT: 4,\n BELOW: 8,\n LEFT: 16,\n};\n//# sourceMappingURL=Relationship.js.map","/**\n * @module ol/extent\n */\nimport Corner from './extent/Corner.js';\nimport Relationship from './extent/Relationship.js';\nimport { assert } from './asserts.js';\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array} Extent\n * @api\n */\n/**\n * Build an extent that includes all given coordinates.\n *\n * @param {Array} coordinates Coordinates.\n * @return {Extent} Bounding extent.\n * @api\n */\nexport function boundingExtent(coordinates) {\n var extent = createEmpty();\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n/**\n * @param {Array} xs Xs.\n * @param {Array} ys Ys.\n * @param {Extent} [opt_extent] Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, opt_extent) {\n var minX = Math.min.apply(null, xs);\n var minY = Math.min.apply(null, ys);\n var maxX = Math.max.apply(null, xs);\n var maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, opt_extent);\n}\n/**\n * Return extent increased by the provided value.\n * @param {Extent} extent Extent.\n * @param {number} value The amount by which the extent should be buffered.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function buffer(extent, value, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0] - value;\n opt_extent[1] = extent[1] - value;\n opt_extent[2] = extent[2] + value;\n opt_extent[3] = extent[3] + value;\n return opt_extent;\n }\n else {\n return [\n extent[0] - value,\n extent[1] - value,\n extent[2] + value,\n extent[3] + value,\n ];\n }\n}\n/**\n * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} The clone.\n */\nexport function clone(extent, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0];\n opt_extent[1] = extent[1];\n opt_extent[2] = extent[2];\n opt_extent[3] = extent[3];\n return opt_extent;\n }\n else {\n return extent.slice();\n }\n}\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {number} Closest squared distance.\n */\nexport function closestSquaredDistanceXY(extent, x, y) {\n var dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n }\n else if (extent[2] < x) {\n dx = x - extent[2];\n }\n else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n }\n else if (extent[3] < y) {\n dy = y - extent[3];\n }\n else {\n dy = 0;\n }\n return dx * dx + dy * dy;\n}\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} The coordinate is contained in the extent.\n * @api\n */\nexport function containsCoordinate(extent, coordinate) {\n return containsXY(extent, coordinate[0], coordinate[1]);\n}\n/**\n * Check if one extent contains another.\n *\n * An extent is deemed contained if it lies completely within the other extent,\n * including if they share one or more edges.\n *\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The second extent is contained by or on the edge of the\n * first.\n * @api\n */\nexport function containsExtent(extent1, extent2) {\n return (extent1[0] <= extent2[0] &&\n extent2[2] <= extent1[2] &&\n extent1[1] <= extent2[1] &&\n extent2[3] <= extent1[3]);\n}\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n * @return {boolean} The x, y values are contained in the extent.\n * @api\n */\nexport function containsXY(extent, x, y) {\n return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];\n}\n/**\n * Get the relationship between a coordinate and extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate The coordinate.\n * @return {import(\"./extent/Relationship.js\").default} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nexport function coordinateRelationship(extent, coordinate) {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var x = coordinate[0];\n var y = coordinate[1];\n var relationship = Relationship.UNKNOWN;\n if (x < minX) {\n relationship = relationship | Relationship.LEFT;\n }\n else if (x > maxX) {\n relationship = relationship | Relationship.RIGHT;\n }\n if (y < minY) {\n relationship = relationship | Relationship.BELOW;\n }\n else if (y > maxY) {\n relationship = relationship | Relationship.ABOVE;\n }\n if (relationship === Relationship.UNKNOWN) {\n relationship = Relationship.INTERSECTING;\n }\n return relationship;\n}\n/**\n * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nexport function createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\n}\n/**\n * Create a new extent or update the provided extent.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {Extent} [opt_extent] Destination extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = minX;\n opt_extent[1] = minY;\n opt_extent[2] = maxX;\n opt_extent[3] = maxY;\n return opt_extent;\n }\n else {\n return [minX, minY, maxX, maxY];\n }\n}\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateEmpty(opt_extent) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, opt_extent);\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinate(coordinate, opt_extent) {\n var x = coordinate[0];\n var y = coordinate[1];\n return createOrUpdate(x, y, x, y, opt_extent);\n}\n/**\n * @param {Array} coordinates Coordinates.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinates(coordinates, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendCoordinates(extent, coordinates);\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n/**\n * @param {Array>} rings Rings.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromRings(rings, opt_extent) {\n var extent = createOrUpdateEmpty(opt_extent);\n return extendRings(extent, rings);\n}\n/**\n * Determine if two extents are equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The two extents are equivalent.\n * @api\n */\nexport function equals(extent1, extent2) {\n return (extent1[0] == extent2[0] &&\n extent1[2] == extent2[2] &&\n extent1[1] == extent2[1] &&\n extent1[3] == extent2[3]);\n}\n/**\n * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nexport function approximatelyEquals(extent1, extent2, tolerance) {\n return (Math.abs(extent1[0] - extent2[0]) < tolerance &&\n Math.abs(extent1[2] - extent2[2]) < tolerance &&\n Math.abs(extent1[1] - extent2[1]) < tolerance &&\n Math.abs(extent1[3] - extent2[3]) < tolerance);\n}\n/**\n * Modify an extent to include another extent.\n * @param {Extent} extent1 The extent to be modified.\n * @param {Extent} extent2 The extent that will be included in the first.\n * @return {Extent} A reference to the first (extended) extent.\n * @api\n */\nexport function extend(extent1, extent2) {\n if (extent2[0] < extent1[0]) {\n extent1[0] = extent2[0];\n }\n if (extent2[2] > extent1[2]) {\n extent1[2] = extent2[2];\n }\n if (extent2[1] < extent1[1]) {\n extent1[1] = extent2[1];\n }\n if (extent2[3] > extent1[3]) {\n extent1[3] = extent2[3];\n }\n return extent1;\n}\n/**\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n */\nexport function extendCoordinate(extent, coordinate) {\n if (coordinate[0] < extent[0]) {\n extent[0] = coordinate[0];\n }\n if (coordinate[0] > extent[2]) {\n extent[2] = coordinate[0];\n }\n if (coordinate[1] < extent[1]) {\n extent[1] = coordinate[1];\n }\n if (coordinate[1] > extent[3]) {\n extent[3] = coordinate[1];\n }\n}\n/**\n * @param {Extent} extent Extent.\n * @param {Array} coordinates Coordinates.\n * @return {Extent} Extent.\n */\nexport function extendCoordinates(extent, coordinates) {\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n/**\n * @param {Extent} extent Extent.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Extent} Extent.\n */\nexport function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\n}\n/**\n * @param {Extent} extent Extent.\n * @param {Array>} rings Rings.\n * @return {Extent} Extent.\n */\nexport function extendRings(extent, rings) {\n for (var i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\n}\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n */\nexport function extendXY(extent, x, y) {\n extent[0] = Math.min(extent[0], x);\n extent[1] = Math.min(extent[1], y);\n extent[2] = Math.max(extent[2], x);\n extent[3] = Math.max(extent[3], y);\n}\n/**\n * This function calls `callback` for each corner of the extent. If the\n * callback returns a truthy value the function returns that value\n * immediately. Otherwise the function returns `false`.\n * @param {Extent} extent Extent.\n * @param {function(import(\"./coordinate.js\").Coordinate): S} callback Callback.\n * @return {S|boolean} Value.\n * @template S\n */\nexport function forEachCorner(extent, callback) {\n var val;\n val = callback(getBottomLeft(extent));\n if (val) {\n return val;\n }\n val = callback(getBottomRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopLeft(extent));\n if (val) {\n return val;\n }\n return false;\n}\n/**\n * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nexport function getArea(extent) {\n var area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\n}\n/**\n * Get the bottom left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom left coordinate.\n * @api\n */\nexport function getBottomLeft(extent) {\n return [extent[0], extent[1]];\n}\n/**\n * Get the bottom right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom right coordinate.\n * @api\n */\nexport function getBottomRight(extent) {\n return [extent[2], extent[1]];\n}\n/**\n * Get the center coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Center.\n * @api\n */\nexport function getCenter(extent) {\n return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];\n}\n/**\n * Get a corner coordinate of an extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./extent/Corner.js\").default} corner Corner.\n * @return {import(\"./coordinate.js\").Coordinate} Corner coordinate.\n */\nexport function getCorner(extent, corner) {\n var coordinate;\n if (corner === Corner.BOTTOM_LEFT) {\n coordinate = getBottomLeft(extent);\n }\n else if (corner === Corner.BOTTOM_RIGHT) {\n coordinate = getBottomRight(extent);\n }\n else if (corner === Corner.TOP_LEFT) {\n coordinate = getTopLeft(extent);\n }\n else if (corner === Corner.TOP_RIGHT) {\n coordinate = getTopRight(extent);\n }\n else {\n assert(false, 13); // Invalid corner\n }\n return coordinate;\n}\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Enlarged area.\n */\nexport function getEnlargedArea(extent1, extent2) {\n var minX = Math.min(extent1[0], extent2[0]);\n var minY = Math.min(extent1[1], extent2[1]);\n var maxX = Math.max(extent1[2], extent2[2]);\n var maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @param {Extent} [opt_extent] Destination extent.\n * @return {Extent} Extent.\n */\nexport function getForViewAndSize(center, resolution, rotation, size, opt_extent) {\n var dx = (resolution * size[0]) / 2;\n var dy = (resolution * size[1]) / 2;\n var cosRotation = Math.cos(rotation);\n var sinRotation = Math.sin(rotation);\n var xCos = dx * cosRotation;\n var xSin = dx * sinRotation;\n var yCos = dy * cosRotation;\n var ySin = dy * sinRotation;\n var x = center[0];\n var y = center[1];\n var x0 = x - xCos + ySin;\n var x1 = x - xCos - ySin;\n var x2 = x + xCos - ySin;\n var x3 = x + xCos + ySin;\n var y0 = y - xSin - yCos;\n var y1 = y - xSin + yCos;\n var y2 = y + xSin + yCos;\n var y3 = y + xSin - yCos;\n return createOrUpdate(Math.min(x0, x1, x2, x3), Math.min(y0, y1, y2, y3), Math.max(x0, x1, x2, x3), Math.max(y0, y1, y2, y3), opt_extent);\n}\n/**\n * Get the height of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Height.\n * @api\n */\nexport function getHeight(extent) {\n return extent[3] - extent[1];\n}\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nexport function getIntersectionArea(extent1, extent2) {\n var intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent} [opt_extent] Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nexport function getIntersection(extent1, extent2, opt_extent) {\n var intersection = opt_extent ? opt_extent : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n }\n else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n }\n else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n }\n else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n }\n else {\n intersection[3] = extent2[3];\n }\n }\n else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\n}\n/**\n * @param {Extent} extent Extent.\n * @return {number} Margin.\n */\nexport function getMargin(extent) {\n return getWidth(extent) + getHeight(extent);\n}\n/**\n * Get the size (width, height) of an extent.\n * @param {Extent} extent The extent.\n * @return {import(\"./size.js\").Size} The extent size.\n * @api\n */\nexport function getSize(extent) {\n return [extent[2] - extent[0], extent[3] - extent[1]];\n}\n/**\n * Get the top left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top left coordinate.\n * @api\n */\nexport function getTopLeft(extent) {\n return [extent[0], extent[3]];\n}\n/**\n * Get the top right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top right coordinate.\n * @api\n */\nexport function getTopRight(extent) {\n return [extent[2], extent[3]];\n}\n/**\n * Get the width of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Width.\n * @api\n */\nexport function getWidth(extent) {\n return extent[2] - extent[0];\n}\n/**\n * Determine if one extent intersects another.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent.\n * @return {boolean} The two extents intersect.\n * @api\n */\nexport function intersects(extent1, extent2) {\n return (extent1[0] <= extent2[2] &&\n extent1[2] >= extent2[0] &&\n extent1[1] <= extent2[3] &&\n extent1[3] >= extent2[1]);\n}\n/**\n * Determine if an extent is empty.\n * @param {Extent} extent Extent.\n * @return {boolean} Is empty.\n * @api\n */\nexport function isEmpty(extent) {\n return extent[2] < extent[0] || extent[3] < extent[1];\n}\n/**\n * @param {Extent} extent Extent.\n * @param {Extent} [opt_extent] Extent.\n * @return {Extent} Extent.\n */\nexport function returnOrUpdate(extent, opt_extent) {\n if (opt_extent) {\n opt_extent[0] = extent[0];\n opt_extent[1] = extent[1];\n opt_extent[2] = extent[2];\n opt_extent[3] = extent[3];\n return opt_extent;\n }\n else {\n return extent;\n }\n}\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nexport function scaleFromCenter(extent, value) {\n var deltaX = ((extent[2] - extent[0]) / 2) * (value - 1);\n var deltaY = ((extent[3] - extent[1]) / 2) * (value - 1);\n extent[0] -= deltaX;\n extent[2] += deltaX;\n extent[1] -= deltaY;\n extent[3] += deltaY;\n}\n/**\n * Determine if the segment between two coordinates intersects (crosses,\n * touches, or is contained by) the provided extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} start Segment start coordinate.\n * @param {import(\"./coordinate.js\").Coordinate} end Segment end coordinate.\n * @return {boolean} The segment intersects the extent.\n */\nexport function intersectsSegment(extent, start, end) {\n var intersects = false;\n var startRel = coordinateRelationship(extent, start);\n var endRel = coordinateRelationship(extent, end);\n if (startRel === Relationship.INTERSECTING ||\n endRel === Relationship.INTERSECTING) {\n intersects = true;\n }\n else {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var startX = start[0];\n var startY = start[1];\n var endX = end[0];\n var endY = end[1];\n var slope = (endY - startY) / (endX - startX);\n var x = void 0, y = void 0;\n if (!!(endRel & Relationship.ABOVE) && !(startRel & Relationship.ABOVE)) {\n // potentially intersects top\n x = endX - (endY - maxY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects &&\n !!(endRel & Relationship.RIGHT) &&\n !(startRel & Relationship.RIGHT)) {\n // potentially intersects right\n y = endY - (endX - maxX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n if (!intersects &&\n !!(endRel & Relationship.BELOW) &&\n !(startRel & Relationship.BELOW)) {\n // potentially intersects bottom\n x = endX - (endY - minY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects &&\n !!(endRel & Relationship.LEFT) &&\n !(startRel & Relationship.LEFT)) {\n // potentially intersects left\n y = endY - (endX - minX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\n}\n/**\n * Apply a transform function to the extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./proj.js\").TransformFunction} transformFn Transform function.\n * Called with `[minX, minY, maxX, maxY]` extent coordinates.\n * @param {Extent} [opt_extent] Destination extent.\n * @param {number} [opt_stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, opt_extent, opt_stops) {\n var coordinates = [];\n if (opt_stops > 1) {\n var width = extent[2] - extent[0];\n var height = extent[3] - extent[1];\n for (var i = 0; i < opt_stops; ++i) {\n coordinates.push(extent[0] + (width * i) / opt_stops, extent[1], extent[2], extent[1] + (height * i) / opt_stops, extent[2] - (width * i) / opt_stops, extent[3], extent[0], extent[3] - (height * i) / opt_stops);\n }\n }\n else {\n coordinates = [\n extent[0],\n extent[1],\n extent[2],\n extent[1],\n extent[2],\n extent[3],\n extent[0],\n extent[3],\n ];\n }\n transformFn(coordinates, coordinates, 2);\n var xs = [];\n var ys = [];\n for (var i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, opt_extent);\n}\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nexport function wrapX(extent, projection) {\n var projectionExtent = projection.getExtent();\n var center = getCenter(extent);\n if (projection.canWrapX() &&\n (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])) {\n var worldWidth = getWidth(projectionExtent);\n var worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);\n var offset = worldsAway * worldWidth;\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return extent;\n}\n//# sourceMappingURL=extent.js.map","/**\n * @module ol/proj/Projection\n */\nimport { METERS_PER_UNIT } from './Units.js';\n/**\n * @typedef {Object} Options\n * @property {string} code The SRS identifier code, e.g. `EPSG:4326`.\n * @property {import(\"./Units.js\").default|string} [units] Units. Required unless a\n * proj4 projection is defined for `code`.\n * @property {import(\"../extent.js\").Extent} [extent] The validity extent for the SRS.\n * @property {string} [axisOrientation='enu'] The axis orientation as specified in Proj4.\n * @property {boolean} [global=false] Whether the projection is valid for the whole globe.\n * @property {number} [metersPerUnit] The meters per unit for the SRS.\n * If not provided, the `units` are used to get the meters per unit from the {@link module:ol/proj/Units~METERS_PER_UNIT}\n * lookup table.\n * @property {import(\"../extent.js\").Extent} [worldExtent] The world extent for the SRS.\n * @property {function(number, import(\"../coordinate.js\").Coordinate):number} [getPointResolution]\n * Function to determine resolution at a point. The function is called with a\n * `number` view resolution and a {@link module:ol/coordinate~Coordinate Coordinate} as arguments, and returns\n * the `number` resolution in projection units at the passed coordinate. If this is `undefined`,\n * the default {@link module:ol/proj.getPointResolution getPointResolution()} function will be used.\n */\n/**\n * @classdesc\n * Projection definition class. One of these is created for each projection\n * supported in the application and stored in the {@link module:ol/proj} namespace.\n * You can use these in applications, but this is not required, as API params\n * and options use {@link module:ol/proj~ProjectionLike} which means the simple string\n * code will suffice.\n *\n * You can use {@link module:ol/proj.get} to retrieve the object for a particular\n * projection.\n *\n * The library includes definitions for `EPSG:4326` and `EPSG:3857`, together\n * with the following aliases:\n * * `EPSG:4326`: CRS:84, urn:ogc:def:crs:EPSG:6.6:4326,\n * urn:ogc:def:crs:OGC:1.3:CRS84, urn:ogc:def:crs:OGC:2:84,\n * http://www.opengis.net/gml/srs/epsg.xml#4326,\n * urn:x-ogc:def:crs:EPSG:4326\n * * `EPSG:3857`: EPSG:102100, EPSG:102113, EPSG:900913,\n * urn:ogc:def:crs:EPSG:6.18:3:3857,\n * http://www.opengis.net/gml/srs/epsg.xml#3857\n *\n * If you use [proj4js](https://github.com/proj4js/proj4js), aliases can\n * be added using `proj4.defs()`. After all required projection definitions are\n * added, call the {@link module:ol/proj/proj4.register} function.\n *\n * @api\n */\nvar Projection = /** @class */ (function () {\n /**\n * @param {Options} options Projection options.\n */\n function Projection(options) {\n /**\n * @private\n * @type {string}\n */\n this.code_ = options.code;\n /**\n * Units of projected coordinates. When set to `TILE_PIXELS`, a\n * `this.extent_` and `this.worldExtent_` must be configured properly for each\n * tile.\n * @private\n * @type {import(\"./Units.js\").default}\n */\n this.units_ = /** @type {import(\"./Units.js\").default} */ (options.units);\n /**\n * Validity extent of the projection in projected coordinates. For projections\n * with `TILE_PIXELS` units, this is the extent of the tile in\n * tile pixel space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = options.extent !== undefined ? options.extent : null;\n /**\n * Extent of the world in EPSG:4326. For projections with\n * `TILE_PIXELS` units, this is the extent of the tile in\n * projected coordinate space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.worldExtent_ =\n options.worldExtent !== undefined ? options.worldExtent : null;\n /**\n * @private\n * @type {string}\n */\n this.axisOrientation_ =\n options.axisOrientation !== undefined ? options.axisOrientation : 'enu';\n /**\n * @private\n * @type {boolean}\n */\n this.global_ = options.global !== undefined ? options.global : false;\n /**\n * @private\n * @type {boolean}\n */\n this.canWrapX_ = !!(this.global_ && this.extent_);\n /**\n * @private\n * @type {function(number, import(\"../coordinate.js\").Coordinate):number|undefined}\n */\n this.getPointResolutionFunc_ = options.getPointResolution;\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n this.defaultTileGrid_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n this.metersPerUnit_ = options.metersPerUnit;\n }\n /**\n * @return {boolean} The projection is suitable for wrapping the x-axis\n */\n Projection.prototype.canWrapX = function () {\n return this.canWrapX_;\n };\n /**\n * Get the code for this projection, e.g. 'EPSG:4326'.\n * @return {string} Code.\n * @api\n */\n Projection.prototype.getCode = function () {\n return this.code_;\n };\n /**\n * Get the validity extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n Projection.prototype.getExtent = function () {\n return this.extent_;\n };\n /**\n * Get the units of this projection.\n * @return {import(\"./Units.js\").default} Units.\n * @api\n */\n Projection.prototype.getUnits = function () {\n return this.units_;\n };\n /**\n * Get the amount of meters per unit of this projection. If the projection is\n * not configured with `metersPerUnit` or a units identifier, the return is\n * `undefined`.\n * @return {number|undefined} Meters.\n * @api\n */\n Projection.prototype.getMetersPerUnit = function () {\n return this.metersPerUnit_ || METERS_PER_UNIT[this.units_];\n };\n /**\n * Get the world extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n Projection.prototype.getWorldExtent = function () {\n return this.worldExtent_;\n };\n /**\n * Get the axis orientation of this projection.\n * Example values are:\n * enu - the default easting, northing, elevation.\n * neu - northing, easting, up - useful for \"lat/long\" geographic coordinates,\n * or south orientated transverse mercator.\n * wnu - westing, northing, up - some planetary coordinate systems have\n * \"west positive\" coordinate systems\n * @return {string} Axis orientation.\n * @api\n */\n Projection.prototype.getAxisOrientation = function () {\n return this.axisOrientation_;\n };\n /**\n * Is this projection a global projection which spans the whole world?\n * @return {boolean} Whether the projection is global.\n * @api\n */\n Projection.prototype.isGlobal = function () {\n return this.global_;\n };\n /**\n * Set if the projection is a global projection which spans the whole world\n * @param {boolean} global Whether the projection is global.\n * @api\n */\n Projection.prototype.setGlobal = function (global) {\n this.global_ = global;\n this.canWrapX_ = !!(global && this.extent_);\n };\n /**\n * @return {import(\"../tilegrid/TileGrid.js\").default} The default tile grid.\n */\n Projection.prototype.getDefaultTileGrid = function () {\n return this.defaultTileGrid_;\n };\n /**\n * @param {import(\"../tilegrid/TileGrid.js\").default} tileGrid The default tile grid.\n */\n Projection.prototype.setDefaultTileGrid = function (tileGrid) {\n this.defaultTileGrid_ = tileGrid;\n };\n /**\n * Set the validity extent for this projection.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n Projection.prototype.setExtent = function (extent) {\n this.extent_ = extent;\n this.canWrapX_ = !!(this.global_ && extent);\n };\n /**\n * Set the world extent for this projection.\n * @param {import(\"../extent.js\").Extent} worldExtent World extent\n * [minlon, minlat, maxlon, maxlat].\n * @api\n */\n Projection.prototype.setWorldExtent = function (worldExtent) {\n this.worldExtent_ = worldExtent;\n };\n /**\n * Set the getPointResolution function (see {@link module:ol/proj.getPointResolution}\n * for this projection.\n * @param {function(number, import(\"../coordinate.js\").Coordinate):number} func Function\n * @api\n */\n Projection.prototype.setGetPointResolution = function (func) {\n this.getPointResolutionFunc_ = func;\n };\n /**\n * Get the custom point resolution function for this projection (if set).\n * @return {function(number, import(\"../coordinate.js\").Coordinate):number|undefined} The custom point\n * resolution function (if set).\n */\n Projection.prototype.getPointResolutionFunc = function () {\n return this.getPointResolutionFunc_;\n };\n return Projection;\n}());\nexport default Projection;\n//# sourceMappingURL=Projection.js.map","/**\n * @module ol/math\n */\n/**\n * Takes a number and clamps it to within the provided bounds.\n * @param {number} value The input number.\n * @param {number} min The minimum value to return.\n * @param {number} max The maximum value to return.\n * @return {number} The input number if it is within bounds, or the nearest\n * number within the bounds.\n */\nexport function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n/**\n * Return the hyperbolic cosine of a given number. The method will use the\n * native `Math.cosh` function if it is available, otherwise the hyperbolic\n * cosine will be calculated via the reference implementation of the Mozilla\n * developer network.\n *\n * @param {number} x X.\n * @return {number} Hyperbolic cosine of x.\n */\nexport var cosh = (function () {\n // Wrapped in a iife, to save the overhead of checking for the native\n // implementation on every invocation.\n var cosh;\n if ('cosh' in Math) {\n // The environment supports the native Math.cosh function, use it…\n cosh = Math.cosh;\n }\n else {\n // … else, use the reference implementation of MDN:\n cosh = function (x) {\n var y = /** @type {Math} */ (Math).exp(x);\n return (y + 1 / y) / 2;\n };\n }\n return cosh;\n})();\n/**\n * Return the base 2 logarithm of a given number. The method will use the\n * native `Math.log2` function if it is available, otherwise the base 2\n * logarithm will be calculated via the reference implementation of the\n * Mozilla developer network.\n *\n * @param {number} x X.\n * @return {number} Base 2 logarithm of x.\n */\nexport var log2 = (function () {\n // Wrapped in a iife, to save the overhead of checking for the native\n // implementation on every invocation.\n var log2;\n if ('log2' in Math) {\n // The environment supports the native Math.log2 function, use it…\n log2 = Math.log2;\n }\n else {\n // … else, use the reference implementation of MDN:\n log2 = function (x) {\n return Math.log(x) * Math.LOG2E;\n };\n }\n return log2;\n})();\n/**\n * Returns the square of the closest distance between the point (x, y) and the\n * line segment (x1, y1) to (x2, y2).\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredSegmentDistance(x, y, x1, y1, x2, y2) {\n var dx = x2 - x1;\n var dy = y2 - y1;\n if (dx !== 0 || dy !== 0) {\n var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n x1 = x2;\n y1 = y2;\n }\n else if (t > 0) {\n x1 += dx * t;\n y1 += dy * t;\n }\n }\n return squaredDistance(x, y, x1, y1);\n}\n/**\n * Returns the square of the distance between the points (x1, y1) and (x2, y2).\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredDistance(x1, y1, x2, y2) {\n var dx = x2 - x1;\n var dy = y2 - y1;\n return dx * dx + dy * dy;\n}\n/**\n * Solves system of linear equations using Gaussian elimination method.\n *\n * @param {Array>} mat Augmented matrix (n x n + 1 column)\n * in row-major order.\n * @return {Array} The resulting vector.\n */\nexport function solveLinearSystem(mat) {\n var n = mat.length;\n for (var i = 0; i < n; i++) {\n // Find max in the i-th column (ignoring i - 1 first rows)\n var maxRow = i;\n var maxEl = Math.abs(mat[i][i]);\n for (var r = i + 1; r < n; r++) {\n var absValue = Math.abs(mat[r][i]);\n if (absValue > maxEl) {\n maxEl = absValue;\n maxRow = r;\n }\n }\n if (maxEl === 0) {\n return null; // matrix is singular\n }\n // Swap max row with i-th (current) row\n var tmp = mat[maxRow];\n mat[maxRow] = mat[i];\n mat[i] = tmp;\n // Subtract the i-th row to make all the remaining rows 0 in the i-th column\n for (var j = i + 1; j < n; j++) {\n var coef = -mat[j][i] / mat[i][i];\n for (var k = i; k < n + 1; k++) {\n if (i == k) {\n mat[j][k] = 0;\n }\n else {\n mat[j][k] += coef * mat[i][k];\n }\n }\n }\n }\n // Solve Ax=b for upper triangular matrix A (mat)\n var x = new Array(n);\n for (var l = n - 1; l >= 0; l--) {\n x[l] = mat[l][n] / mat[l][l];\n for (var m = l - 1; m >= 0; m--) {\n mat[m][n] -= mat[m][l] * x[l];\n }\n }\n return x;\n}\n/**\n * Converts radians to to degrees.\n *\n * @param {number} angleInRadians Angle in radians.\n * @return {number} Angle in degrees.\n */\nexport function toDegrees(angleInRadians) {\n return (angleInRadians * 180) / Math.PI;\n}\n/**\n * Converts degrees to radians.\n *\n * @param {number} angleInDegrees Angle in degrees.\n * @return {number} Angle in radians.\n */\nexport function toRadians(angleInDegrees) {\n return (angleInDegrees * Math.PI) / 180;\n}\n/**\n * Returns the modulo of a / b, depending on the sign of b.\n *\n * @param {number} a Dividend.\n * @param {number} b Divisor.\n * @return {number} Modulo.\n */\nexport function modulo(a, b) {\n var r = a % b;\n return r * b < 0 ? r + b : r;\n}\n/**\n * Calculates the linearly interpolated value of x between a and b.\n *\n * @param {number} a Number\n * @param {number} b Number\n * @param {number} x Value to be interpolated.\n * @return {number} Interpolated value.\n */\nexport function lerp(a, b, x) {\n return a + x * (b - a);\n}\n//# sourceMappingURL=math.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/proj/epsg3857\n */\nimport Projection from './Projection.js';\nimport Units from './Units.js';\nimport { cosh } from '../math.js';\n/**\n * Radius of WGS84 sphere\n *\n * @const\n * @type {number}\n */\nexport var RADIUS = 6378137;\n/**\n * @const\n * @type {number}\n */\nexport var HALF_SIZE = Math.PI * RADIUS;\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var EXTENT = [-HALF_SIZE, -HALF_SIZE, HALF_SIZE, HALF_SIZE];\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var WORLD_EXTENT = [-180, -85, 180, 85];\n/**\n * Maximum safe value in y direction\n * @const\n * @type {number}\n */\nexport var MAX_SAFE_Y = RADIUS * Math.log(Math.tan(Math.PI / 2));\n/**\n * @classdesc\n * Projection object for web/spherical Mercator (EPSG:3857).\n */\nvar EPSG3857Projection = /** @class */ (function (_super) {\n __extends(EPSG3857Projection, _super);\n /**\n * @param {string} code Code.\n */\n function EPSG3857Projection(code) {\n return _super.call(this, {\n code: code,\n units: Units.METERS,\n extent: EXTENT,\n global: true,\n worldExtent: WORLD_EXTENT,\n getPointResolution: function (resolution, point) {\n return resolution / cosh(point[1] / RADIUS);\n },\n }) || this;\n }\n return EPSG3857Projection;\n}(Projection));\n/**\n * Projections equal to EPSG:3857.\n *\n * @const\n * @type {Array}\n */\nexport var PROJECTIONS = [\n new EPSG3857Projection('EPSG:3857'),\n new EPSG3857Projection('EPSG:102100'),\n new EPSG3857Projection('EPSG:102113'),\n new EPSG3857Projection('EPSG:900913'),\n new EPSG3857Projection('http://www.opengis.net/gml/srs/epsg.xml#3857'),\n];\n/**\n * Transformation from EPSG:4326 to EPSG:3857.\n *\n * @param {Array} input Input array of coordinate values.\n * @param {Array} [opt_output] Output array of coordinate values.\n * @param {number} [opt_dimension] Dimension (default is `2`).\n * @return {Array} Output array of coordinate values.\n */\nexport function fromEPSG4326(input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension > 1 ? opt_dimension : 2;\n var output = opt_output;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n }\n else {\n output = new Array(length);\n }\n }\n for (var i = 0; i < length; i += dimension) {\n output[i] = (HALF_SIZE * input[i]) / 180;\n var y = RADIUS * Math.log(Math.tan((Math.PI * (+input[i + 1] + 90)) / 360));\n if (y > MAX_SAFE_Y) {\n y = MAX_SAFE_Y;\n }\n else if (y < -MAX_SAFE_Y) {\n y = -MAX_SAFE_Y;\n }\n output[i + 1] = y;\n }\n return output;\n}\n/**\n * Transformation from EPSG:3857 to EPSG:4326.\n *\n * @param {Array} input Input array of coordinate values.\n * @param {Array} [opt_output] Output array of coordinate values.\n * @param {number} [opt_dimension] Dimension (default is `2`).\n * @return {Array} Output array of coordinate values.\n */\nexport function toEPSG4326(input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension > 1 ? opt_dimension : 2;\n var output = opt_output;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n }\n else {\n output = new Array(length);\n }\n }\n for (var i = 0; i < length; i += dimension) {\n output[i] = (180 * input[i]) / HALF_SIZE;\n output[i + 1] =\n (360 * Math.atan(Math.exp(input[i + 1] / RADIUS))) / Math.PI - 90;\n }\n return output;\n}\n//# sourceMappingURL=epsg3857.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/proj/epsg4326\n */\nimport Projection from './Projection.js';\nimport Units from './Units.js';\n/**\n * Semi-major radius of the WGS84 ellipsoid.\n *\n * @const\n * @type {number}\n */\nexport var RADIUS = 6378137;\n/**\n * Extent of the EPSG:4326 projection which is the whole world.\n *\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport var EXTENT = [-180, -90, 180, 90];\n/**\n * @const\n * @type {number}\n */\nexport var METERS_PER_UNIT = (Math.PI * RADIUS) / 180;\n/**\n * @classdesc\n * Projection object for WGS84 geographic coordinates (EPSG:4326).\n *\n * Note that OpenLayers does not strictly comply with the EPSG definition.\n * The EPSG registry defines 4326 as a CRS for Latitude,Longitude (y,x).\n * OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates.\n */\nvar EPSG4326Projection = /** @class */ (function (_super) {\n __extends(EPSG4326Projection, _super);\n /**\n * @param {string} code Code.\n * @param {string} [opt_axisOrientation] Axis orientation.\n */\n function EPSG4326Projection(code, opt_axisOrientation) {\n return _super.call(this, {\n code: code,\n units: Units.DEGREES,\n extent: EXTENT,\n axisOrientation: opt_axisOrientation,\n global: true,\n metersPerUnit: METERS_PER_UNIT,\n worldExtent: EXTENT,\n }) || this;\n }\n return EPSG4326Projection;\n}(Projection));\n/**\n * Projections equal to EPSG:4326.\n *\n * @const\n * @type {Array}\n */\nexport var PROJECTIONS = [\n new EPSG4326Projection('CRS:84'),\n new EPSG4326Projection('EPSG:4326', 'neu'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:1.3:CRS84'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:2:84'),\n new EPSG4326Projection('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'),\n];\n//# sourceMappingURL=epsg4326.js.map","/**\n * @module ol/proj/projections\n */\n/**\n * @type {Object}\n */\nvar cache = {};\n/**\n * Clear the projections cache.\n */\nexport function clear() {\n cache = {};\n}\n/**\n * Get a cached projection by code.\n * @param {string} code The code for the projection.\n * @return {import(\"./Projection.js\").default} The projection (if cached).\n */\nexport function get(code) {\n return (cache[code] ||\n cache[code.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\\w+)$/, 'EPSG:$3')] ||\n null);\n}\n/**\n * Add a projection to the cache.\n * @param {string} code The projection code.\n * @param {import(\"./Projection.js\").default} projection The projection to cache.\n */\nexport function add(code, projection) {\n cache[code] = projection;\n}\n//# sourceMappingURL=projections.js.map","/**\n * @module ol/proj/transforms\n */\nimport { isEmpty } from '../obj.js';\n/**\n * @private\n * @type {!Object>}\n */\nvar transforms = {};\n/**\n * Clear the transform cache.\n */\nexport function clear() {\n transforms = {};\n}\n/**\n * Registers a conversion function to convert coordinates from the source\n * projection to the destination projection.\n *\n * @param {import(\"./Projection.js\").default} source Source.\n * @param {import(\"./Projection.js\").default} destination Destination.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform.\n */\nexport function add(source, destination, transformFn) {\n var sourceCode = source.getCode();\n var destinationCode = destination.getCode();\n if (!(sourceCode in transforms)) {\n transforms[sourceCode] = {};\n }\n transforms[sourceCode][destinationCode] = transformFn;\n}\n/**\n * Unregisters the conversion function to convert coordinates from the source\n * projection to the destination projection. This method is used to clean up\n * cached transforms during testing.\n *\n * @param {import(\"./Projection.js\").default} source Source projection.\n * @param {import(\"./Projection.js\").default} destination Destination projection.\n * @return {import(\"../proj.js\").TransformFunction} transformFn The unregistered transform.\n */\nexport function remove(source, destination) {\n var sourceCode = source.getCode();\n var destinationCode = destination.getCode();\n var transform = transforms[sourceCode][destinationCode];\n delete transforms[sourceCode][destinationCode];\n if (isEmpty(transforms[sourceCode])) {\n delete transforms[sourceCode];\n }\n return transform;\n}\n/**\n * Get a transform given a source code and a destination code.\n * @param {string} sourceCode The code for the source projection.\n * @param {string} destinationCode The code for the destination projection.\n * @return {import(\"../proj.js\").TransformFunction|undefined} The transform function (if found).\n */\nexport function get(sourceCode, destinationCode) {\n var transform;\n if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {\n transform = transforms[sourceCode][destinationCode];\n }\n return transform;\n}\n//# sourceMappingURL=transforms.js.map","/**\n * @module ol/sphere\n */\nimport GeometryType from './geom/GeometryType.js';\nimport { toDegrees, toRadians } from './math.js';\n/**\n * Object literal with options for the {@link getLength} or {@link getArea}\n * functions.\n * @typedef {Object} SphereMetricOptions\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857']\n * Projection of the geometry. By default, the geometry is assumed to be in\n * Web Mercator.\n * @property {number} [radius=6371008.8] Sphere radius. By default, the\n * [mean Earth radius](https://en.wikipedia.org/wiki/Earth_radius#Mean_radius)\n * for the WGS84 ellipsoid is used.\n */\n/**\n * The mean Earth radius (1/3 * (2a + b)) for the WGS84 ellipsoid.\n * https://en.wikipedia.org/wiki/Earth_radius#Mean_radius\n * @type {number}\n */\nexport var DEFAULT_RADIUS = 6371008.8;\n/**\n * Get the great circle distance (in meters) between two geographic coordinates.\n * @param {Array} c1 Starting coordinate.\n * @param {Array} c2 Ending coordinate.\n * @param {number} [opt_radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {number} The great circle distance between the points (in meters).\n * @api\n */\nexport function getDistance(c1, c2, opt_radius) {\n var radius = opt_radius || DEFAULT_RADIUS;\n var lat1 = toRadians(c1[1]);\n var lat2 = toRadians(c2[1]);\n var deltaLatBy2 = (lat2 - lat1) / 2;\n var deltaLonBy2 = toRadians(c2[0] - c1[0]) / 2;\n var a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) +\n Math.sin(deltaLonBy2) *\n Math.sin(deltaLonBy2) *\n Math.cos(lat1) *\n Math.cos(lat2);\n return 2 * radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n}\n/**\n * Get the cumulative great circle length of linestring coordinates (geographic).\n * @param {Array} coordinates Linestring coordinates.\n * @param {number} radius The sphere radius to use.\n * @return {number} The length (in meters).\n */\nfunction getLengthInternal(coordinates, radius) {\n var length = 0;\n for (var i = 0, ii = coordinates.length; i < ii - 1; ++i) {\n length += getDistance(coordinates[i], coordinates[i + 1], radius);\n }\n return length;\n}\n/**\n * Get the spherical length of a geometry. This length is the sum of the\n * great circle distances between coordinates. For polygons, the length is\n * the sum of all rings. For points, the length is zero. For multi-part\n * geometries, the length is the sum of the length of each part.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [opt_options] Options for the\n * length calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical length (in meters).\n * @api\n */\nexport function getLength(geometry, opt_options) {\n var options = opt_options || {};\n var radius = options.radius || DEFAULT_RADIUS;\n var projection = options.projection || 'EPSG:3857';\n var type = geometry.getType();\n if (type !== GeometryType.GEOMETRY_COLLECTION) {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n var length = 0;\n var coordinates, coords, i, ii, j, jj;\n switch (type) {\n case GeometryType.POINT:\n case GeometryType.MULTI_POINT: {\n break;\n }\n case GeometryType.LINE_STRING:\n case GeometryType.LINEAR_RING: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n length = getLengthInternal(coordinates, radius);\n break;\n }\n case GeometryType.MULTI_LINE_STRING:\n case GeometryType.POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n length += getLengthInternal(coordinates[i], radius);\n }\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n for (j = 0, jj = coords.length; j < jj; ++j) {\n length += getLengthInternal(coords[j], radius);\n }\n }\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n var geometries = \n /** @type {import(\"./geom/GeometryCollection.js\").default} */ (geometry).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n length += getLength(geometries[i], opt_options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return length;\n}\n/**\n * Returns the spherical area for a list of coordinates.\n *\n * [Reference](https://trs.jpl.nasa.gov/handle/2014/40409)\n * Robert. G. Chamberlain and William H. Duquette, \"Some Algorithms for\n * Polygons on a Sphere\", JPL Publication 07-03, Jet Propulsion\n * Laboratory, Pasadena, CA, June 2007\n *\n * @param {Array} coordinates List of coordinates of a linear\n * ring. If the ring is oriented clockwise, the area will be positive,\n * otherwise it will be negative.\n * @param {number} radius The sphere radius.\n * @return {number} Area (in square meters).\n */\nfunction getAreaInternal(coordinates, radius) {\n var area = 0;\n var len = coordinates.length;\n var x1 = coordinates[len - 1][0];\n var y1 = coordinates[len - 1][1];\n for (var i = 0; i < len; i++) {\n var x2 = coordinates[i][0];\n var y2 = coordinates[i][1];\n area +=\n toRadians(x2 - x1) *\n (2 + Math.sin(toRadians(y1)) + Math.sin(toRadians(y2)));\n x1 = x2;\n y1 = y2;\n }\n return (area * radius * radius) / 2.0;\n}\n/**\n * Get the spherical area of a geometry. This is the area (in meters) assuming\n * that polygon edges are segments of great circles on a sphere.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [opt_options] Options for the area\n * calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical area (in square meters).\n * @api\n */\nexport function getArea(geometry, opt_options) {\n var options = opt_options || {};\n var radius = options.radius || DEFAULT_RADIUS;\n var projection = options.projection || 'EPSG:3857';\n var type = geometry.getType();\n if (type !== GeometryType.GEOMETRY_COLLECTION) {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n var area = 0;\n var coordinates, coords, i, ii, j, jj;\n switch (type) {\n case GeometryType.POINT:\n case GeometryType.MULTI_POINT:\n case GeometryType.LINE_STRING:\n case GeometryType.MULTI_LINE_STRING:\n case GeometryType.LINEAR_RING: {\n break;\n }\n case GeometryType.POLYGON: {\n coordinates = /** @type {import(\"./geom/Polygon.js\").default} */ (geometry).getCoordinates();\n area = Math.abs(getAreaInternal(coordinates[0], radius));\n for (i = 1, ii = coordinates.length; i < ii; ++i) {\n area -= Math.abs(getAreaInternal(coordinates[i], radius));\n }\n break;\n }\n case GeometryType.MULTI_POLYGON: {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometry).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n area += Math.abs(getAreaInternal(coords[0], radius));\n for (j = 1, jj = coords.length; j < jj; ++j) {\n area -= Math.abs(getAreaInternal(coords[j], radius));\n }\n }\n break;\n }\n case GeometryType.GEOMETRY_COLLECTION: {\n var geometries = \n /** @type {import(\"./geom/GeometryCollection.js\").default} */ (geometry).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n area += getArea(geometries[i], opt_options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return area;\n}\n/**\n * Returns the coordinate at the given distance and bearing from `c1`.\n *\n * @param {import(\"./coordinate.js\").Coordinate} c1 The origin point (`[lon, lat]` in degrees).\n * @param {number} distance The great-circle distance between the origin\n * point and the target point.\n * @param {number} bearing The bearing (in radians).\n * @param {number} [opt_radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {import(\"./coordinate.js\").Coordinate} The target point.\n */\nexport function offset(c1, distance, bearing, opt_radius) {\n var radius = opt_radius || DEFAULT_RADIUS;\n var lat1 = toRadians(c1[1]);\n var lon1 = toRadians(c1[0]);\n var dByR = distance / radius;\n var lat = Math.asin(Math.sin(lat1) * Math.cos(dByR) +\n Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing));\n var lon = lon1 +\n Math.atan2(Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat));\n return [toDegrees(lon), toDegrees(lat)];\n}\n//# sourceMappingURL=sphere.js.map","/**\n * @module ol/string\n */\n/**\n * @param {number} number Number to be formatted\n * @param {number} width The desired width\n * @param {number} [opt_precision] Precision of the output string (i.e. number of decimal places)\n * @return {string} Formatted string\n */\nexport function padNumber(number, width, opt_precision) {\n var numberString = opt_precision !== undefined ? number.toFixed(opt_precision) : '' + number;\n var decimal = numberString.indexOf('.');\n decimal = decimal === -1 ? numberString.length : decimal;\n return decimal > width\n ? numberString\n : new Array(1 + width - decimal).join('0') + numberString;\n}\n/**\n * Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js\n * @param {string|number} v1 First version\n * @param {string|number} v2 Second version\n * @return {number} Value\n */\nexport function compareVersions(v1, v2) {\n var s1 = ('' + v1).split('.');\n var s2 = ('' + v2).split('.');\n for (var i = 0; i < Math.max(s1.length, s2.length); i++) {\n var n1 = parseInt(s1[i] || '0', 10);\n var n2 = parseInt(s2[i] || '0', 10);\n if (n1 > n2) {\n return 1;\n }\n if (n2 > n1) {\n return -1;\n }\n }\n return 0;\n}\n//# sourceMappingURL=string.js.map","/**\n * @module ol/coordinate\n */\nimport { getWidth } from './extent.js';\nimport { modulo } from './math.js';\nimport { padNumber } from './string.js';\n/**\n * An array of numbers representing an xy coordinate. Example: `[16, 48]`.\n * @typedef {Array} Coordinate\n * @api\n */\n/**\n * A function that takes a {@link module:ol/coordinate~Coordinate} and\n * transforms it into a `{string}`.\n *\n * @typedef {function((Coordinate|undefined)): string} CoordinateFormat\n * @api\n */\n/**\n * Add `delta` to `coordinate`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {add} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * add(coord, [-2, 4]);\n * // coord is now [5.85, 51.983333]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {Coordinate} delta Delta.\n * @return {Coordinate} The input coordinate adjusted by\n * the given delta.\n * @api\n */\nexport function add(coordinate, delta) {\n coordinate[0] += +delta[0];\n coordinate[1] += +delta[1];\n return coordinate;\n}\n/**\n * Calculates the point closest to the passed coordinate on the passed circle.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {import(\"./geom/Circle.js\").default} circle The circle.\n * @return {Coordinate} Closest point on the circumference.\n */\nexport function closestOnCircle(coordinate, circle) {\n var r = circle.getRadius();\n var center = circle.getCenter();\n var x0 = center[0];\n var y0 = center[1];\n var x1 = coordinate[0];\n var y1 = coordinate[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n if (dx === 0 && dy === 0) {\n dx = 1;\n }\n var d = Math.sqrt(dx * dx + dy * dy);\n var x = x0 + (r * dx) / d;\n var y = y0 + (r * dy) / d;\n return [x, y];\n}\n/**\n * Calculates the point closest to the passed coordinate on the passed segment.\n * This is the foot of the perpendicular of the coordinate to the segment when\n * the foot is on the segment, or the closest segment coordinate when the foot\n * is outside the segment.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {Array} segment The two coordinates\n * of the segment.\n * @return {Coordinate} The foot of the perpendicular of\n * the coordinate to the segment.\n */\nexport function closestOnSegment(coordinate, segment) {\n var x0 = coordinate[0];\n var y0 = coordinate[1];\n var start = segment[0];\n var end = segment[1];\n var x1 = start[0];\n var y1 = start[1];\n var x2 = end[0];\n var y2 = end[1];\n var dx = x2 - x1;\n var dy = y2 - y1;\n var along = dx === 0 && dy === 0\n ? 0\n : (dx * (x0 - x1) + dy * (y0 - y1)) / (dx * dx + dy * dy || 0);\n var x, y;\n if (along <= 0) {\n x = x1;\n y = y1;\n }\n else if (along >= 1) {\n x = x2;\n y = y2;\n }\n else {\n x = x1 + along * dx;\n y = y1 + along * dy;\n }\n return [x, y];\n}\n/**\n * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be\n * used to format\n * a {Coordinate} to a string.\n *\n * Example without specifying the fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var stringifyFunc = createStringXY();\n * var out = stringifyFunc(coord);\n * // out is now '8, 48'\n *\n * Example with explicitly specifying 2 fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var stringifyFunc = createStringXY(2);\n * var out = stringifyFunc(coord);\n * // out is now '7.85, 47.98'\n *\n * @param {number} [opt_fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {CoordinateFormat} Coordinate format.\n * @api\n */\nexport function createStringXY(opt_fractionDigits) {\n return (\n /**\n * @param {Coordinate} coordinate Coordinate.\n * @return {string} String XY.\n */\n function (coordinate) {\n return toStringXY(coordinate, opt_fractionDigits);\n });\n}\n/**\n * @param {string} hemispheres Hemispheres.\n * @param {number} degrees Degrees.\n * @param {number} [opt_fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} String.\n */\nexport function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) {\n var normalizedDegrees = modulo(degrees + 180, 360) - 180;\n var x = Math.abs(3600 * normalizedDegrees);\n var dflPrecision = opt_fractionDigits || 0;\n var precision = Math.pow(10, dflPrecision);\n var deg = Math.floor(x / 3600);\n var min = Math.floor((x - deg * 3600) / 60);\n var sec = x - deg * 3600 - min * 60;\n sec = Math.ceil(sec * precision) / precision;\n if (sec >= 60) {\n sec = 0;\n min += 1;\n }\n if (min >= 60) {\n min = 0;\n deg += 1;\n }\n return (deg +\n '\\u00b0 ' +\n padNumber(min, 2) +\n '\\u2032 ' +\n padNumber(sec, 2, dflPrecision) +\n '\\u2033' +\n (normalizedDegrees == 0\n ? ''\n : ' ' + hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0)));\n}\n/**\n * Transforms the given {@link module:ol/coordinate~Coordinate} to a string\n * using the given string template. The strings `{x}` and `{y}` in the template\n * will be replaced with the first and second coordinate values respectively.\n *\n * Example without specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var template = 'Coordinate is ({x}|{y}).';\n * var out = format(coord, template);\n * // out is now 'Coordinate is (8|48).'\n *\n * Example explicitly specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var template = 'Coordinate is ({x}|{y}).';\n * var out = format(coord, template, 2);\n * // out is now 'Coordinate is (7.85|47.98).'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {string} template A template string with `{x}` and `{y}` placeholders\n * that will be replaced by first and second coordinate values.\n * @param {number} [opt_fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Formatted coordinate.\n * @api\n */\nexport function format(coordinate, template, opt_fractionDigits) {\n if (coordinate) {\n return template\n .replace('{x}', coordinate[0].toFixed(opt_fractionDigits))\n .replace('{y}', coordinate[1].toFixed(opt_fractionDigits));\n }\n else {\n return '';\n }\n}\n/**\n * @param {Coordinate} coordinate1 First coordinate.\n * @param {Coordinate} coordinate2 Second coordinate.\n * @return {boolean} The two coordinates are equal.\n */\nexport function equals(coordinate1, coordinate2) {\n var equals = true;\n for (var i = coordinate1.length - 1; i >= 0; --i) {\n if (coordinate1[i] != coordinate2[i]) {\n equals = false;\n break;\n }\n }\n return equals;\n}\n/**\n * Rotate `coordinate` by `angle`. `coordinate` is modified in place and\n * returned by the function.\n *\n * Example:\n *\n * import {rotate} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var rotateRadians = Math.PI / 2; // 90 degrees\n * rotate(coord, rotateRadians);\n * // coord is now [-47.983333, 7.85]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} angle Angle in radian.\n * @return {Coordinate} Coordinate.\n * @api\n */\nexport function rotate(coordinate, angle) {\n var cosAngle = Math.cos(angle);\n var sinAngle = Math.sin(angle);\n var x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n var y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n coordinate[0] = x;\n coordinate[1] = y;\n return coordinate;\n}\n/**\n * Scale `coordinate` by `scale`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {scale as scaleCoordinate} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var scale = 1.2;\n * scaleCoordinate(coord, scale);\n * // coord is now [9.42, 57.5799996]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} scale Scale factor.\n * @return {Coordinate} Coordinate.\n */\nexport function scale(coordinate, scale) {\n coordinate[0] *= scale;\n coordinate[1] *= scale;\n return coordinate;\n}\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Squared distance between coord1 and coord2.\n */\nexport function squaredDistance(coord1, coord2) {\n var dx = coord1[0] - coord2[0];\n var dy = coord1[1] - coord2[1];\n return dx * dx + dy * dy;\n}\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Distance between coord1 and coord2.\n */\nexport function distance(coord1, coord2) {\n return Math.sqrt(squaredDistance(coord1, coord2));\n}\n/**\n * Calculate the squared distance from a coordinate to a line segment.\n *\n * @param {Coordinate} coordinate Coordinate of the point.\n * @param {Array} segment Line segment (2\n * coordinates).\n * @return {number} Squared distance from the point to the line segment.\n */\nexport function squaredDistanceToSegment(coordinate, segment) {\n return squaredDistance(coordinate, closestOnSegment(coordinate, segment));\n}\n/**\n * Format a geographic coordinate with the hemisphere, degrees, minutes, and\n * seconds.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringHDMS} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringHDMS(coord);\n * // out is now '47° 58′ 60″ N 7° 50′ 60″ E'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringHDMS} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringHDMS(coord, 1);\n * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [opt_fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Hemisphere, degrees, minutes and seconds.\n * @api\n */\nexport function toStringHDMS(coordinate, opt_fractionDigits) {\n if (coordinate) {\n return (degreesToStringHDMS('NS', coordinate[1], opt_fractionDigits) +\n ' ' +\n degreesToStringHDMS('EW', coordinate[0], opt_fractionDigits));\n }\n else {\n return '';\n }\n}\n/**\n * Format a coordinate as a comma delimited string.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringXY(coord);\n * // out is now '8, 48'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringXY} from 'ol/coordinate';\n *\n * var coord = [7.85, 47.983333];\n * var out = toStringXY(coord, 1);\n * // out is now '7.8, 48.0'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [opt_fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} XY.\n * @api\n */\nexport function toStringXY(coordinate, opt_fractionDigits) {\n return format(coordinate, '{x}, {y}', opt_fractionDigits);\n}\n/**\n * Modifies the provided coordinate in-place to be within the real world\n * extent. The lower projection extent boundary is inclusive, the upper one\n * exclusive.\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {Coordinate} The coordinate within the real world extent.\n */\nexport function wrapX(coordinate, projection) {\n if (projection.canWrapX()) {\n var worldWidth = getWidth(projection.getExtent());\n var worldsAway = getWorldsAway(coordinate, projection, worldWidth);\n if (worldsAway) {\n coordinate[0] -= worldsAway * worldWidth;\n }\n }\n return coordinate;\n}\n/**\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {number} [opt_sourceExtentWidth] Width of the source extent.\n * @return {number} Offset in world widths.\n */\nexport function getWorldsAway(coordinate, projection, opt_sourceExtentWidth) {\n var projectionExtent = projection.getExtent();\n var worldsAway = 0;\n if (projection.canWrapX() &&\n (coordinate[0] < projectionExtent[0] || coordinate[0] > projectionExtent[2])) {\n var sourceExtentWidth = opt_sourceExtentWidth || getWidth(projectionExtent);\n worldsAway = Math.floor((coordinate[0] - projectionExtent[0]) / sourceExtentWidth);\n }\n return worldsAway;\n}\n//# sourceMappingURL=coordinate.js.map","/**\n * @module ol/proj\n */\n/**\n * The ol/proj module stores:\n * * a list of {@link module:ol/proj/Projection}\n * objects, one for each projection supported by the application\n * * a list of transform functions needed to convert coordinates in one projection\n * into another.\n *\n * The static functions are the methods used to maintain these.\n * Each transform function can handle not only simple coordinate pairs, but also\n * large arrays of coordinates such as vector geometries.\n *\n * When loaded, the library adds projection objects for EPSG:4326 (WGS84\n * geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used\n * for example by Bing Maps or OpenStreetMap), together with the relevant\n * transform functions.\n *\n * Additional transforms may be added by using the http://proj4js.org/\n * library (version 2.2 or later). You can use the full build supplied by\n * Proj4js, or create a custom build to support those projections you need; see\n * the Proj4js website for how to do this. You also need the Proj4js definitions\n * for the required projections. These definitions can be obtained from\n * https://epsg.io/, and are a JS function, so can be loaded in a script\n * tag (as in the examples) or pasted into your application.\n *\n * After all required projection definitions are added to proj4's registry (by\n * using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`\n * package. Existing transforms are not changed by this function. See\n * examples/wms-image-custom-proj for an example of this.\n *\n * Additional projection definitions can be registered with `proj4.defs()` any\n * time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't\n * know in advance what projections are needed, you can initially load minimal\n * support and then load whichever are requested.\n *\n * Note that Proj4js does not support projection extents. If you want to add\n * one for creating default tile grids, you can add it after the Projection\n * object has been created with `setExtent`, for example,\n * `get('EPSG:1234').setExtent(extent)`.\n *\n * In addition to Proj4js support, any transform functions can be added with\n * {@link module:ol/proj.addCoordinateTransforms}. To use this, you must first create\n * a {@link module:ol/proj/Projection} object for the new projection and add it with\n * {@link module:ol/proj.addProjection}. You can then add the forward and inverse\n * functions with {@link module:ol/proj.addCoordinateTransforms}. See\n * examples/wms-custom-proj for an example of this.\n *\n * Note that if no transforms are needed and you only need to define the\n * projection, just add a {@link module:ol/proj/Projection} with\n * {@link module:ol/proj.addProjection}. See examples/wms-no-proj for an example of\n * this.\n */\nimport Projection from './proj/Projection.js';\nimport Units, { METERS_PER_UNIT } from './proj/Units.js';\nimport { PROJECTIONS as EPSG3857_PROJECTIONS, fromEPSG4326, toEPSG4326, } from './proj/epsg3857.js';\nimport { PROJECTIONS as EPSG4326_PROJECTIONS } from './proj/epsg4326.js';\nimport { add as addProj, clear as clearProj, get as getProj, } from './proj/projections.js';\nimport { add as addTransformFunc, clear as clearTransformFuncs, get as getTransformFunc, } from './proj/transforms.js';\nimport { applyTransform, getWidth } from './extent.js';\nimport { clamp, modulo } from './math.js';\nimport { getDistance } from './sphere.js';\nimport { getWorldsAway } from './coordinate.js';\n/**\n * A projection as {@link module:ol/proj/Projection}, SRS identifier\n * string or undefined.\n * @typedef {Projection|string|undefined} ProjectionLike\n * @api\n */\n/**\n * A transform function accepts an array of input coordinate values, an optional\n * output array, and an optional dimension (default should be 2). The function\n * transforms the input coordinate values, populates the output array, and\n * returns the output array.\n *\n * @typedef {function(Array, Array=, number=): Array} TransformFunction\n * @api\n */\nexport { METERS_PER_UNIT };\nexport { Projection };\n/**\n * @param {Array} input Input coordinate array.\n * @param {Array} [opt_output] Output array of coordinate values.\n * @param {number} [opt_dimension] Dimension.\n * @return {Array} Output coordinate array (new array, same coordinate\n * values).\n */\nexport function cloneTransform(input, opt_output, opt_dimension) {\n var output;\n if (opt_output !== undefined) {\n for (var i = 0, ii = input.length; i < ii; ++i) {\n opt_output[i] = input[i];\n }\n output = opt_output;\n }\n else {\n output = input.slice();\n }\n return output;\n}\n/**\n * @param {Array} input Input coordinate array.\n * @param {Array} [opt_output] Output array of coordinate values.\n * @param {number} [opt_dimension] Dimension.\n * @return {Array} Input coordinate array (same array as input).\n */\nexport function identityTransform(input, opt_output, opt_dimension) {\n if (opt_output !== undefined && input !== opt_output) {\n for (var i = 0, ii = input.length; i < ii; ++i) {\n opt_output[i] = input[i];\n }\n input = opt_output;\n }\n return input;\n}\n/**\n * Add a Projection object to the list of supported projections that can be\n * looked up by their code.\n *\n * @param {Projection} projection Projection instance.\n * @api\n */\nexport function addProjection(projection) {\n addProj(projection.getCode(), projection);\n addTransformFunc(projection, projection, cloneTransform);\n}\n/**\n * @param {Array} projections Projections.\n */\nexport function addProjections(projections) {\n projections.forEach(addProjection);\n}\n/**\n * Fetches a Projection object for the code specified.\n *\n * @param {ProjectionLike} projectionLike Either a code string which is\n * a combination of authority and identifier such as \"EPSG:4326\", or an\n * existing projection object, or undefined.\n * @return {Projection} Projection object, or null if not in list.\n * @api\n */\nexport function get(projectionLike) {\n return typeof projectionLike === 'string'\n ? getProj(/** @type {string} */ (projectionLike))\n : /** @type {Projection} */ (projectionLike) || null;\n}\n/**\n * Get the resolution of the point in degrees or distance units.\n * For projections with degrees as the unit this will simply return the\n * provided resolution. For other projections the point resolution is\n * by default estimated by transforming the 'point' pixel to EPSG:4326,\n * measuring its width and height on the normal sphere,\n * and taking the average of the width and height.\n * A custom function can be provided for a specific projection, either\n * by setting the `getPointResolution` option in the\n * {@link module:ol/proj/Projection~Projection} constructor or by using\n * {@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing\n * projection object.\n * @param {ProjectionLike} projection The projection.\n * @param {number} resolution Nominal resolution in projection units.\n * @param {import(\"./coordinate.js\").Coordinate} point Point to find adjusted resolution at.\n * @param {import(\"./proj/Units.js\").default} [opt_units] Units to get the point resolution in.\n * Default is the projection's units.\n * @return {number} Point resolution.\n * @api\n */\nexport function getPointResolution(projection, resolution, point, opt_units) {\n projection = get(projection);\n var pointResolution;\n var getter = projection.getPointResolutionFunc();\n if (getter) {\n pointResolution = getter(resolution, point);\n if (opt_units && opt_units !== projection.getUnits()) {\n var metersPerUnit = projection.getMetersPerUnit();\n if (metersPerUnit) {\n pointResolution =\n (pointResolution * metersPerUnit) / METERS_PER_UNIT[opt_units];\n }\n }\n }\n else {\n var units = projection.getUnits();\n if ((units == Units.DEGREES && !opt_units) || opt_units == Units.DEGREES) {\n pointResolution = resolution;\n }\n else {\n // Estimate point resolution by transforming the center pixel to EPSG:4326,\n // measuring its width and height on the normal sphere, and taking the\n // average of the width and height.\n var toEPSG4326_1 = getTransformFromProjections(projection, get('EPSG:4326'));\n if (toEPSG4326_1 === identityTransform && units !== Units.DEGREES) {\n // no transform is available\n pointResolution = resolution * projection.getMetersPerUnit();\n }\n else {\n var vertices = [\n point[0] - resolution / 2,\n point[1],\n point[0] + resolution / 2,\n point[1],\n point[0],\n point[1] - resolution / 2,\n point[0],\n point[1] + resolution / 2,\n ];\n vertices = toEPSG4326_1(vertices, vertices, 2);\n var width = getDistance(vertices.slice(0, 2), vertices.slice(2, 4));\n var height = getDistance(vertices.slice(4, 6), vertices.slice(6, 8));\n pointResolution = (width + height) / 2;\n }\n var metersPerUnit = opt_units\n ? METERS_PER_UNIT[opt_units]\n : projection.getMetersPerUnit();\n if (metersPerUnit !== undefined) {\n pointResolution /= metersPerUnit;\n }\n }\n }\n return pointResolution;\n}\n/**\n * Registers transformation functions that don't alter coordinates. Those allow\n * to transform between projections with equal meaning.\n *\n * @param {Array} projections Projections.\n * @api\n */\nexport function addEquivalentProjections(projections) {\n addProjections(projections);\n projections.forEach(function (source) {\n projections.forEach(function (destination) {\n if (source !== destination) {\n addTransformFunc(source, destination, cloneTransform);\n }\n });\n });\n}\n/**\n * Registers transformation functions to convert coordinates in any projection\n * in projection1 to any projection in projection2.\n *\n * @param {Array} projections1 Projections with equal\n * meaning.\n * @param {Array} projections2 Projections with equal\n * meaning.\n * @param {TransformFunction} forwardTransform Transformation from any\n * projection in projection1 to any projection in projection2.\n * @param {TransformFunction} inverseTransform Transform from any projection\n * in projection2 to any projection in projection1..\n */\nexport function addEquivalentTransforms(projections1, projections2, forwardTransform, inverseTransform) {\n projections1.forEach(function (projection1) {\n projections2.forEach(function (projection2) {\n addTransformFunc(projection1, projection2, forwardTransform);\n addTransformFunc(projection2, projection1, inverseTransform);\n });\n });\n}\n/**\n * Clear all cached projections and transforms.\n */\nexport function clearAllProjections() {\n clearProj();\n clearTransformFuncs();\n}\n/**\n * @param {Projection|string|undefined} projection Projection.\n * @param {string} defaultCode Default code.\n * @return {Projection} Projection.\n */\nexport function createProjection(projection, defaultCode) {\n if (!projection) {\n return get(defaultCode);\n }\n else if (typeof projection === 'string') {\n return get(projection);\n }\n else {\n return /** @type {Projection} */ (projection);\n }\n}\n/**\n * Creates a {@link module:ol/proj~TransformFunction} from a simple 2D coordinate transform\n * function.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} coordTransform Coordinate\n * transform.\n * @return {TransformFunction} Transform function.\n */\nexport function createTransformFromCoordinateTransform(coordTransform) {\n return (\n /**\n * @param {Array} input Input.\n * @param {Array} [opt_output] Output.\n * @param {number} [opt_dimension] Dimension.\n * @return {Array} Output.\n */\n function (input, opt_output, opt_dimension) {\n var length = input.length;\n var dimension = opt_dimension !== undefined ? opt_dimension : 2;\n var output = opt_output !== undefined ? opt_output : new Array(length);\n for (var i = 0; i < length; i += dimension) {\n var point = coordTransform([input[i], input[i + 1]]);\n output[i] = point[0];\n output[i + 1] = point[1];\n for (var j = dimension - 1; j >= 2; --j) {\n output[i + j] = input[i + j];\n }\n }\n return output;\n });\n}\n/**\n * Registers coordinate transform functions to convert coordinates between the\n * source projection and the destination projection.\n * The forward and inverse functions convert coordinate pairs; this function\n * converts these into the functions used internally which also handle\n * extents and coordinate arrays.\n *\n * @param {ProjectionLike} source Source projection.\n * @param {ProjectionLike} destination Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} forward The forward transform\n * function (that is, from the source projection to the destination\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} inverse The inverse transform\n * function (that is, from the destination projection to the source\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @api\n */\nexport function addCoordinateTransforms(source, destination, forward, inverse) {\n var sourceProj = get(source);\n var destProj = get(destination);\n addTransformFunc(sourceProj, destProj, createTransformFromCoordinateTransform(forward));\n addTransformFunc(destProj, sourceProj, createTransformFromCoordinateTransform(inverse));\n}\n/**\n * Transforms a coordinate from longitude/latitude to a different projection.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate as longitude and latitude, i.e.\n * an array with longitude as 1st and latitude as 2nd element.\n * @param {ProjectionLike} [opt_projection] Target projection. The\n * default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate projected to the target projection.\n * @api\n */\nexport function fromLonLat(coordinate, opt_projection) {\n return transform(coordinate, 'EPSG:4326', opt_projection !== undefined ? opt_projection : 'EPSG:3857');\n}\n/**\n * Transforms a coordinate to longitude/latitude.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Projected coordinate.\n * @param {ProjectionLike} [opt_projection] Projection of the coordinate.\n * The default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate as longitude and latitude, i.e. an array\n * with longitude as 1st and latitude as 2nd element.\n * @api\n */\nexport function toLonLat(coordinate, opt_projection) {\n var lonLat = transform(coordinate, opt_projection !== undefined ? opt_projection : 'EPSG:3857', 'EPSG:4326');\n var lon = lonLat[0];\n if (lon < -180 || lon > 180) {\n lonLat[0] = modulo(lon + 180, 360) - 180;\n }\n return lonLat;\n}\n/**\n * Checks if two projections are the same, that is every coordinate in one\n * projection does represent the same geographic point as the same coordinate in\n * the other projection.\n *\n * @param {Projection} projection1 Projection 1.\n * @param {Projection} projection2 Projection 2.\n * @return {boolean} Equivalent.\n * @api\n */\nexport function equivalent(projection1, projection2) {\n if (projection1 === projection2) {\n return true;\n }\n var equalUnits = projection1.getUnits() === projection2.getUnits();\n if (projection1.getCode() === projection2.getCode()) {\n return equalUnits;\n }\n else {\n var transformFunc = getTransformFromProjections(projection1, projection2);\n return transformFunc === cloneTransform && equalUnits;\n }\n}\n/**\n * Searches in the list of transform functions for the function for converting\n * coordinates from the source projection to the destination projection.\n *\n * @param {Projection} sourceProjection Source Projection object.\n * @param {Projection} destinationProjection Destination Projection\n * object.\n * @return {TransformFunction} Transform function.\n */\nexport function getTransformFromProjections(sourceProjection, destinationProjection) {\n var sourceCode = sourceProjection.getCode();\n var destinationCode = destinationProjection.getCode();\n var transformFunc = getTransformFunc(sourceCode, destinationCode);\n if (!transformFunc) {\n transformFunc = identityTransform;\n }\n return transformFunc;\n}\n/**\n * Given the projection-like objects, searches for a transformation\n * function to convert a coordinates array from the source projection to the\n * destination projection.\n *\n * @param {ProjectionLike} source Source.\n * @param {ProjectionLike} destination Destination.\n * @return {TransformFunction} Transform function.\n * @api\n */\nexport function getTransform(source, destination) {\n var sourceProjection = get(source);\n var destinationProjection = get(destination);\n return getTransformFromProjections(sourceProjection, destinationProjection);\n}\n/**\n * Transforms a coordinate from source projection to destination projection.\n * This returns a new coordinate (and does not modify the original).\n *\n * See {@link module:ol/proj.transformExtent} for extent transformation.\n * See the transform method of {@link module:ol/geom/Geometry~Geometry} and its\n * subclasses for geometry transforms.\n *\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\nexport function transform(coordinate, source, destination) {\n var transformFunc = getTransform(source, destination);\n return transformFunc(coordinate, undefined, coordinate.length);\n}\n/**\n * Transforms an extent from source projection to destination projection. This\n * returns a new extent (and does not modify the original).\n *\n * @param {import(\"./extent.js\").Extent} extent The extent to transform.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @param {number} [opt_stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {import(\"./extent.js\").Extent} The transformed extent.\n * @api\n */\nexport function transformExtent(extent, source, destination, opt_stops) {\n var transformFunc = getTransform(source, destination);\n return applyTransform(extent, transformFunc, undefined, opt_stops);\n}\n/**\n * Transforms the given point to the destination projection.\n *\n * @param {import(\"./coordinate.js\").Coordinate} point Point.\n * @param {Projection} sourceProjection Source projection.\n * @param {Projection} destinationProjection Destination projection.\n * @return {import(\"./coordinate.js\").Coordinate} Point.\n */\nexport function transformWithProjections(point, sourceProjection, destinationProjection) {\n var transformFunc = getTransformFromProjections(sourceProjection, destinationProjection);\n return transformFunc(point);\n}\n/**\n * @type {?Projection}\n */\nvar userProjection = null;\n/**\n * Set the projection for coordinates supplied from and returned by API methods.\n * Note that this method is not yet a part of the stable API. Support for user\n * projections is not yet complete and should be considered experimental.\n * @param {ProjectionLike} projection The user projection.\n */\nexport function setUserProjection(projection) {\n userProjection = get(projection);\n}\n/**\n * Clear the user projection if set. Note that this method is not yet a part of\n * the stable API. Support for user projections is not yet complete and should\n * be considered experimental.\n */\nexport function clearUserProjection() {\n userProjection = null;\n}\n/**\n * Get the projection for coordinates supplied from and returned by API methods.\n * Note that this method is not yet a part of the stable API. Support for user\n * projections is not yet complete and should be considered experimental.\n * @return {?Projection} The user projection (or null if not set).\n */\nexport function getUserProjection() {\n return userProjection;\n}\n/**\n * Use geographic coordinates (WGS-84 datum) in API methods. Note that this\n * method is not yet a part of the stable API. Support for user projections is\n * not yet complete and should be considered experimental.\n */\nexport function useGeographic() {\n setUserProjection('EPSG:4326');\n}\n/**\n * Return a coordinate transformed into the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array} coordinate Input coordinate.\n * @param {ProjectionLike} sourceProjection The input coordinate projection.\n * @return {Array} The input coordinate in the user projection.\n */\nexport function toUserCoordinate(coordinate, sourceProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, sourceProjection, userProjection);\n}\n/**\n * Return a coordinate transformed from the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array} coordinate Input coordinate.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {Array} The input coordinate transformed.\n */\nexport function fromUserCoordinate(coordinate, destProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, userProjection, destProjection);\n}\n/**\n * Return an extent transformed into the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} sourceProjection The input extent projection.\n * @return {import(\"./extent.js\").Extent} The input extent in the user projection.\n */\nexport function toUserExtent(extent, sourceProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, sourceProjection, userProjection);\n}\n/**\n * Return an extent transformed from the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {import(\"./extent.js\").Extent} The input extent transformed.\n */\nexport function fromUserExtent(extent, destProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, userProjection, destProjection);\n}\n/**\n * Creates a safe coordinate transform function from a coordinate transform function.\n * \"Safe\" means that it can handle wrapping of x-coordinates for global projections,\n * and that coordinates exceeding the source projection validity extent's range will be\n * clamped to the validity range.\n * @param {Projection} sourceProj Source projection.\n * @param {Projection} destProj Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} transform Transform function (source to destiation).\n * @return {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} Safe transform function (source to destiation).\n */\nexport function createSafeCoordinateTransform(sourceProj, destProj, transform) {\n return function (coord) {\n var sourceX = coord[0];\n var sourceY = coord[1];\n var transformed, worldsAway;\n if (sourceProj.canWrapX()) {\n var sourceExtent = sourceProj.getExtent();\n var sourceExtentWidth = getWidth(sourceExtent);\n worldsAway = getWorldsAway(coord, sourceProj, sourceExtentWidth);\n if (worldsAway) {\n // Move x to the real world\n sourceX = sourceX - worldsAway * sourceExtentWidth;\n }\n sourceX = clamp(sourceX, sourceExtent[0], sourceExtent[2]);\n sourceY = clamp(sourceY, sourceExtent[1], sourceExtent[3]);\n transformed = transform([sourceX, sourceY]);\n }\n else {\n transformed = transform(coord);\n }\n if (worldsAway && destProj.canWrapX()) {\n // Move transformed coordinate back to the offset world\n transformed[0] += worldsAway * getWidth(destProj.getExtent());\n }\n return transformed;\n };\n}\n/**\n * Add transforms to and from EPSG:4326 and EPSG:3857. This function is called\n * by when this module is executed and should only need to be called again after\n * `clearAllProjections()` is called (e.g. in tests).\n */\nexport function addCommon() {\n // Add transformations that don't alter coordinates to convert within set of\n // projections with equal meaning.\n addEquivalentProjections(EPSG3857_PROJECTIONS);\n addEquivalentProjections(EPSG4326_PROJECTIONS);\n // Add transformations to convert EPSG:4326 like coordinates to EPSG:3857 like\n // coordinates and back.\n addEquivalentTransforms(EPSG4326_PROJECTIONS, EPSG3857_PROJECTIONS, fromEPSG4326, toEPSG4326);\n}\naddCommon();\n//# sourceMappingURL=proj.js.map","/**\n * @module ol/geom/flat/transform\n */\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var x = flatCoordinates[j];\n var y = flatCoordinates[j + 1];\n dest[i++] = transform[0] * x + transform[2] * y + transform[4];\n dest[i++] = transform[1] * x + transform[3] * y + transform[5];\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} angle Angle.\n * @param {Array} anchor Rotation anchor point.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var anchorX = anchor[0];\n var anchorY = anchor[1];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var deltaX = flatCoordinates[j] - anchorX;\n var deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + deltaX * cos - deltaY * sin;\n dest[i++] = anchorY + deltaX * sin + deltaY * cos;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n/**\n * Scale the coordinates.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} sx Scale factor in the x-direction.\n * @param {number} sy Scale factor in the y-direction.\n * @param {Array} anchor Scale anchor point.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var anchorX = anchor[0];\n var anchorY = anchor[1];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n var deltaX = flatCoordinates[j] - anchorX;\n var deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + sx * deltaX;\n dest[i++] = anchorY + sy * deltaY;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {\n var dest = opt_dest ? opt_dest : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n dest[i++] = flatCoordinates[j] + deltaX;\n dest[i++] = flatCoordinates[j + 1] + deltaY;\n for (var k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (opt_dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n//# sourceMappingURL=transform.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Geometry\n */\nimport BaseObject from '../Object.js';\nimport Units from '../proj/Units.js';\nimport { abstract } from '../util.js';\nimport { compose as composeTransform, create as createTransform, } from '../transform.js';\nimport { createEmpty, createOrUpdateEmpty, getHeight, returnOrUpdate, } from '../extent.js';\nimport { get as getProjection, getTransform } from '../proj.js';\nimport { memoizeOne } from '../functions.js';\nimport { transform2D } from './flat/transform.js';\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nvar tmpTransform = createTransform();\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for vector geometries.\n *\n * To get notified of changes to the geometry, register a listener for the\n * generic `change` event on your geometry instance.\n *\n * @abstract\n * @api\n */\nvar Geometry = /** @class */ (function (_super) {\n __extends(Geometry, _super);\n function Geometry() {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n _this.extent_ = createEmpty();\n /**\n * @private\n * @type {number}\n */\n _this.extentRevision_ = -1;\n /**\n * @protected\n * @type {number}\n */\n _this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n /**\n * @protected\n * @type {number}\n */\n _this.simplifiedGeometryRevision = 0;\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} revision The geometry revision.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n _this.simplifyTransformedInternal = memoizeOne(function (revision, squaredTolerance, opt_transform) {\n if (!opt_transform) {\n return this.getSimplifiedGeometry(squaredTolerance);\n }\n var clone = this.clone();\n clone.applyTransform(opt_transform);\n return clone.getSimplifiedGeometry(squaredTolerance);\n });\n return _this;\n }\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [opt_transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n Geometry.prototype.simplifyTransformed = function (squaredTolerance, opt_transform) {\n return this.simplifyTransformedInternal(this.getRevision(), squaredTolerance, opt_transform);\n };\n /**\n * Make a complete copy of the geometry.\n * @abstract\n * @return {!Geometry} Clone.\n */\n Geometry.prototype.clone = function () {\n return abstract();\n };\n /**\n * @abstract\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n Geometry.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n return abstract();\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n Geometry.prototype.containsXY = function (x, y) {\n var coord = this.getClosestPoint([x, y]);\n return coord[0] === x && coord[1] === y;\n };\n /**\n * Return the closest point of the geometry to the passed point as\n * {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} point Point.\n * @param {import(\"../coordinate.js\").Coordinate} [opt_closestPoint] Closest point.\n * @return {import(\"../coordinate.js\").Coordinate} Closest point.\n * @api\n */\n Geometry.prototype.getClosestPoint = function (point, opt_closestPoint) {\n var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];\n this.closestPointXY(point[0], point[1], closestPoint, Infinity);\n return closestPoint;\n };\n /**\n * Returns true if this geometry includes the specified coordinate. If the\n * coordinate is on the boundary of the geometry, returns false.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains coordinate.\n * @api\n */\n Geometry.prototype.intersectsCoordinate = function (coordinate) {\n return this.containsXY(coordinate[0], coordinate[1]);\n };\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n Geometry.prototype.computeExtent = function (extent) {\n return abstract();\n };\n /**\n * Get the extent of the geometry.\n * @param {import(\"../extent.js\").Extent} [opt_extent] Extent.\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n Geometry.prototype.getExtent = function (opt_extent) {\n if (this.extentRevision_ != this.getRevision()) {\n var extent = this.computeExtent(this.extent_);\n if (isNaN(extent[0]) || isNaN(extent[1])) {\n createOrUpdateEmpty(extent);\n }\n this.extentRevision_ = this.getRevision();\n }\n return returnOrUpdate(this.extent_, opt_extent);\n };\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n Geometry.prototype.rotate = function (angle, anchor) {\n abstract();\n };\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [opt_sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [opt_anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n Geometry.prototype.scale = function (sx, opt_sy, opt_anchor) {\n abstract();\n };\n /**\n * Create a simplified version of this geometry. For linestrings, this uses\n * the [Douglas Peucker](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)\n * algorithm. For polygons, a quantization-based\n * simplification is used to preserve topology.\n * @param {number} tolerance The tolerance distance for simplification.\n * @return {Geometry} A new, simplified version of the original geometry.\n * @api\n */\n Geometry.prototype.simplify = function (tolerance) {\n return this.getSimplifiedGeometry(tolerance * tolerance);\n };\n /**\n * Create a simplified version of this geometry using the Douglas Peucker\n * algorithm.\n * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Geometry} Simplified geometry.\n */\n Geometry.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n return abstract();\n };\n /**\n * Get the type of this geometry.\n * @abstract\n * @return {import(\"./GeometryType.js\").default} Geometry type.\n */\n Geometry.prototype.getType = function () {\n return abstract();\n };\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @abstract\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n */\n Geometry.prototype.applyTransform = function (transformFn) {\n abstract();\n };\n /**\n * Test if the geometry and the passed extent intersect.\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n */\n Geometry.prototype.intersectsExtent = function (extent) {\n return abstract();\n };\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @abstract\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n Geometry.prototype.translate = function (deltaX, deltaY) {\n abstract();\n };\n /**\n * Transform each coordinate of the geometry from one coordinate reference\n * system to another. The geometry is modified in place.\n * For example, a line will be transformed to a line and a circle to a circle.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Geometry} This geometry. Note that original geometry is\n * modified in place.\n * @api\n */\n Geometry.prototype.transform = function (source, destination) {\n /** @type {import(\"../proj/Projection.js\").default} */\n var sourceProj = getProjection(source);\n var transformFn = sourceProj.getUnits() == Units.TILE_PIXELS\n ? function (inCoordinates, outCoordinates, stride) {\n var pixelExtent = sourceProj.getExtent();\n var projectedExtent = sourceProj.getWorldExtent();\n var scale = getHeight(projectedExtent) / getHeight(pixelExtent);\n composeTransform(tmpTransform, projectedExtent[0], projectedExtent[3], scale, -scale, 0, 0, 0);\n transform2D(inCoordinates, 0, inCoordinates.length, stride, tmpTransform, outCoordinates);\n return getTransform(sourceProj, destination)(inCoordinates, outCoordinates, stride);\n }\n : getTransform(sourceProj, destination);\n this.applyTransform(transformFn);\n return this;\n };\n return Geometry;\n}(BaseObject));\nexport default Geometry;\n//# sourceMappingURL=Geometry.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/SimpleGeometry\n */\nimport Geometry from './Geometry.js';\nimport GeometryLayout from './GeometryLayout.js';\nimport { abstract } from '../util.js';\nimport { createOrUpdateFromFlatCoordinates, getCenter } from '../extent.js';\nimport { rotate, scale, transform2D, translate } from './flat/transform.js';\n/**\n * @classdesc\n * Abstract base class; only used for creating subclasses; do not instantiate\n * in apps, as cannot be rendered.\n *\n * @abstract\n * @api\n */\nvar SimpleGeometry = /** @class */ (function (_super) {\n __extends(SimpleGeometry, _super);\n function SimpleGeometry() {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {import(\"./GeometryLayout.js\").default}\n */\n _this.layout = GeometryLayout.XY;\n /**\n * @protected\n * @type {number}\n */\n _this.stride = 2;\n /**\n * @protected\n * @type {Array}\n */\n _this.flatCoordinates = null;\n return _this;\n }\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n SimpleGeometry.prototype.computeExtent = function (extent) {\n return createOrUpdateFromFlatCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);\n };\n /**\n * @abstract\n * @return {Array<*>} Coordinates.\n */\n SimpleGeometry.prototype.getCoordinates = function () {\n return abstract();\n };\n /**\n * Return the first coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} First coordinate.\n * @api\n */\n SimpleGeometry.prototype.getFirstCoordinate = function () {\n return this.flatCoordinates.slice(0, this.stride);\n };\n /**\n * @return {Array} Flat coordinates.\n */\n SimpleGeometry.prototype.getFlatCoordinates = function () {\n return this.flatCoordinates;\n };\n /**\n * Return the last coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} Last point.\n * @api\n */\n SimpleGeometry.prototype.getLastCoordinate = function () {\n return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);\n };\n /**\n * Return the {@link module:ol/geom/GeometryLayout layout} of the geometry.\n * @return {import(\"./GeometryLayout.js\").default} Layout.\n * @api\n */\n SimpleGeometry.prototype.getLayout = function () {\n return this.layout;\n };\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n */\n SimpleGeometry.prototype.getSimplifiedGeometry = function (squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n // If squaredTolerance is negative or if we know that simplification will not\n // have any effect then just return this.\n if (squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance)) {\n return this;\n }\n var simplifiedGeometry = this.getSimplifiedGeometryInternal(squaredTolerance);\n var simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();\n if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {\n return simplifiedGeometry;\n }\n else {\n // Simplification did not actually remove any coordinates. We now know\n // that any calls to getSimplifiedGeometry with a squaredTolerance less\n // than or equal to the current squaredTolerance will also not have any\n // effect. This allows us to short circuit simplification (saving CPU\n // cycles) and prevents the cache of simplified geometries from filling\n // up with useless identical copies of this geometry (saving memory).\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n };\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n * @protected\n */\n SimpleGeometry.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n return this;\n };\n /**\n * @return {number} Stride.\n */\n SimpleGeometry.prototype.getStride = function () {\n return this.stride;\n };\n /**\n * @param {import(\"./GeometryLayout.js\").default} layout Layout.\n * @param {Array} flatCoordinates Flat coordinates.\n */\n SimpleGeometry.prototype.setFlatCoordinates = function (layout, flatCoordinates) {\n this.stride = getStrideForLayout(layout);\n this.layout = layout;\n this.flatCoordinates = flatCoordinates;\n };\n /**\n * @abstract\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n */\n SimpleGeometry.prototype.setCoordinates = function (coordinates, opt_layout) {\n abstract();\n };\n /**\n * @param {import(\"./GeometryLayout.js\").default|undefined} layout Layout.\n * @param {Array<*>} coordinates Coordinates.\n * @param {number} nesting Nesting.\n * @protected\n */\n SimpleGeometry.prototype.setLayout = function (layout, coordinates, nesting) {\n /** @type {number} */\n var stride;\n if (layout) {\n stride = getStrideForLayout(layout);\n }\n else {\n for (var i = 0; i < nesting; ++i) {\n if (coordinates.length === 0) {\n this.layout = GeometryLayout.XY;\n this.stride = 2;\n return;\n }\n else {\n coordinates = /** @type {Array} */ (coordinates[0]);\n }\n }\n stride = coordinates.length;\n layout = getLayoutForStride(stride);\n }\n this.layout = layout;\n this.stride = stride;\n };\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n */\n SimpleGeometry.prototype.applyTransform = function (transformFn) {\n if (this.flatCoordinates) {\n transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);\n this.changed();\n }\n };\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in counter-clockwise radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n SimpleGeometry.prototype.rotate = function (angle, anchor) {\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n rotate(flatCoordinates, 0, flatCoordinates.length, stride, angle, anchor, flatCoordinates);\n this.changed();\n }\n };\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [opt_sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [opt_anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n SimpleGeometry.prototype.scale = function (sx, opt_sy, opt_anchor) {\n var sy = opt_sy;\n if (sy === undefined) {\n sy = sx;\n }\n var anchor = opt_anchor;\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n scale(flatCoordinates, 0, flatCoordinates.length, stride, sx, sy, anchor, flatCoordinates);\n this.changed();\n }\n };\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n SimpleGeometry.prototype.translate = function (deltaX, deltaY) {\n var flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n var stride = this.getStride();\n translate(flatCoordinates, 0, flatCoordinates.length, stride, deltaX, deltaY, flatCoordinates);\n this.changed();\n }\n };\n return SimpleGeometry;\n}(Geometry));\n/**\n * @param {number} stride Stride.\n * @return {import(\"./GeometryLayout.js\").default} layout Layout.\n */\nfunction getLayoutForStride(stride) {\n var layout;\n if (stride == 2) {\n layout = GeometryLayout.XY;\n }\n else if (stride == 3) {\n layout = GeometryLayout.XYZ;\n }\n else if (stride == 4) {\n layout = GeometryLayout.XYZM;\n }\n return /** @type {import(\"./GeometryLayout.js\").default} */ (layout);\n}\n/**\n * @param {import(\"./GeometryLayout.js\").default} layout Layout.\n * @return {number} Stride.\n */\nexport function getStrideForLayout(layout) {\n var stride;\n if (layout == GeometryLayout.XY) {\n stride = 2;\n }\n else if (layout == GeometryLayout.XYZ || layout == GeometryLayout.XYM) {\n stride = 3;\n }\n else if (layout == GeometryLayout.XYZM) {\n stride = 4;\n }\n return /** @type {number} */ (stride);\n}\n/**\n * @param {SimpleGeometry} simpleGeometry Simple geometry.\n * @param {import(\"../transform.js\").Transform} transform Transform.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Transformed flat coordinates.\n */\nexport function transformGeom2D(simpleGeometry, transform, opt_dest) {\n var flatCoordinates = simpleGeometry.getFlatCoordinates();\n if (!flatCoordinates) {\n return null;\n }\n else {\n var stride = simpleGeometry.getStride();\n return transform2D(flatCoordinates, 0, flatCoordinates.length, stride, transform, opt_dest);\n }\n}\nexport default SimpleGeometry;\n//# sourceMappingURL=SimpleGeometry.js.map","/**\n * @module ol/geom/flat/closest\n */\nimport { lerp, squaredDistance as squaredDx } from '../../math.js';\n/**\n * Returns the point on the 2D line segment flatCoordinates[offset1] to\n * flatCoordinates[offset2] that is closest to the point (x, y). Extra\n * dimensions are linearly interpolated.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset1 Offset 1.\n * @param {number} offset2 Offset 2.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n */\nfunction assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {\n var x1 = flatCoordinates[offset1];\n var y1 = flatCoordinates[offset1 + 1];\n var dx = flatCoordinates[offset2] - x1;\n var dy = flatCoordinates[offset2 + 1] - y1;\n var offset;\n if (dx === 0 && dy === 0) {\n offset = offset1;\n }\n else {\n var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n offset = offset2;\n }\n else if (t > 0) {\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = lerp(flatCoordinates[offset1 + i], flatCoordinates[offset2 + i], t);\n }\n closestPoint.length = stride;\n return;\n }\n else {\n offset = offset1;\n }\n }\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n}\n/**\n * Return the squared of the largest distance between any pair of consecutive\n * coordinates.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function maxSquaredDelta(flatCoordinates, offset, end, stride, max) {\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n for (offset += stride; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n var squaredDelta = squaredDx(x1, y1, x2, y2);\n if (squaredDelta > max) {\n max = squaredDelta;\n }\n x1 = x2;\n y1 = y2;\n }\n return max;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n max = maxSquaredDelta(flatCoordinates, offset, end, stride, max);\n offset = end;\n }\n return max;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride, max) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n max = arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max);\n offset = ends[ends.length - 1];\n }\n return max;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [opt_tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n if (offset == end) {\n return minSquaredDistance;\n }\n var i, squaredDistance;\n if (maxDelta === 0) {\n // All points are identical, so just test the first point.\n squaredDistance = squaredDx(x, y, flatCoordinates[offset], flatCoordinates[offset + 1]);\n if (squaredDistance < minSquaredDistance) {\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n else {\n return minSquaredDistance;\n }\n }\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n var index = offset + stride;\n while (index < end) {\n assignClosest(flatCoordinates, index - stride, index, stride, x, y, tmpPoint);\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n index += stride;\n }\n else {\n // Skip ahead multiple points, because we know that all the skipped\n // points cannot be any closer than the closest point we have found so\n // far. We know this because we know how close the current point is, how\n // close the closest point we have found so far is, and the maximum\n // distance between consecutive points. For example, if we're currently\n // at distance 10, the best we've found so far is 3, and that the maximum\n // distance between consecutive points is 2, then we'll need to skip at\n // least (10 - 3) / 2 == 3 (rounded down) points to have any chance of\n // finding a closer point. We use Math.max(..., 1) to ensure that we\n // always advance at least one point, to avoid an infinite loop.\n index +=\n stride *\n Math.max(((Math.sqrt(squaredDistance) - Math.sqrt(minSquaredDistance)) /\n maxDelta) |\n 0, 1);\n }\n }\n if (isRing) {\n // Check the closing segment.\n assignClosest(flatCoordinates, end - stride, offset, stride, x, y, tmpPoint);\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [opt_tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n minSquaredDistance = assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = end;\n }\n return minSquaredDistance;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [opt_tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestMultiArrayPoint(flatCoordinates, offset, endss, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {\n var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n minSquaredDistance = assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = ends[ends.length - 1];\n }\n return minSquaredDistance;\n}\n//# sourceMappingURL=closest.js.map","/**\n * @module ol/geom/flat/deflate\n */\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {\n for (var i = 0, ii = coordinate.length; i < ii; ++i) {\n flatCoordinates[offset++] = coordinate[i];\n }\n return offset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} coordinates Coordinates.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinates(flatCoordinates, offset, coordinates, stride) {\n for (var i = 0, ii = coordinates.length; i < ii; ++i) {\n var coordinate = coordinates[i];\n for (var j = 0; j < stride; ++j) {\n flatCoordinates[offset++] = coordinate[j];\n }\n }\n return offset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} coordinatess Coordinatess.\n * @param {number} stride Stride.\n * @param {Array} [opt_ends] Ends.\n * @return {Array} Ends.\n */\nexport function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {\n var ends = opt_ends ? opt_ends : [];\n var i = 0;\n for (var j = 0, jj = coordinatess.length; j < jj; ++j) {\n var end = deflateCoordinates(flatCoordinates, offset, coordinatess[j], stride);\n ends[i++] = end;\n offset = end;\n }\n ends.length = i;\n return ends;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>>} coordinatesss Coordinatesss.\n * @param {number} stride Stride.\n * @param {Array>} [opt_endss] Endss.\n * @return {Array>} Endss.\n */\nexport function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {\n var endss = opt_endss ? opt_endss : [];\n var i = 0;\n for (var j = 0, jj = coordinatesss.length; j < jj; ++j) {\n var ends = deflateCoordinatesArray(flatCoordinates, offset, coordinatesss[j], stride, endss[i]);\n endss[i++] = ends;\n offset = ends[ends.length - 1];\n }\n endss.length = i;\n return endss;\n}\n//# sourceMappingURL=deflate.js.map","/**\n * @module ol/geom/flat/simplify\n */\n// Based on simplify-js https://github.com/mourner/simplify-js\n// Copyright (c) 2012, Vladimir Agafonkin\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\nimport { squaredDistance, squaredSegmentDistance } from '../../math.js';\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {boolean} highQuality Highest quality.\n * @param {Array} [opt_simplifiedFlatCoordinates] Simplified flat\n * coordinates.\n * @return {Array} Simplified line string.\n */\nexport function simplifyLineString(flatCoordinates, offset, end, stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) {\n var simplifiedFlatCoordinates = opt_simplifiedFlatCoordinates !== undefined\n ? opt_simplifiedFlatCoordinates\n : [];\n if (!highQuality) {\n end = radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n flatCoordinates = simplifiedFlatCoordinates;\n offset = 0;\n stride = 2;\n }\n simplifiedFlatCoordinates.length = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return simplifiedFlatCoordinates;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n var n = (end - offset) / stride;\n if (n < 3) {\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n /** @type {Array} */\n var markers = new Array(n);\n markers[0] = 1;\n markers[n - 1] = 1;\n /** @type {Array} */\n var stack = [offset, end - stride];\n var index = 0;\n while (stack.length > 0) {\n var last = stack.pop();\n var first = stack.pop();\n var maxSquaredDistance = 0;\n var x1 = flatCoordinates[first];\n var y1 = flatCoordinates[first + 1];\n var x2 = flatCoordinates[last];\n var y2 = flatCoordinates[last + 1];\n for (var i = first + stride; i < last; i += stride) {\n var x = flatCoordinates[i];\n var y = flatCoordinates[i + 1];\n var squaredDistance_1 = squaredSegmentDistance(x, y, x1, y1, x2, y2);\n if (squaredDistance_1 > maxSquaredDistance) {\n index = i;\n maxSquaredDistance = squaredDistance_1;\n }\n }\n if (maxSquaredDistance > squaredTolerance) {\n markers[(index - offset) / stride] = 1;\n if (first + stride < index) {\n stack.push(first, index);\n }\n if (index + stride < last) {\n stack.push(index, last);\n }\n }\n }\n for (var i = 0; i < n; ++i) {\n if (markers[i]) {\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride + 1];\n }\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n simplifiedOffset = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerMultiArray(flatCoordinates, offset, endss, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n var simplifiedEnds = [];\n simplifiedOffset = douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n if (end <= offset + stride) {\n // zero or one point, no simplification possible, so copy and return\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n var x1 = flatCoordinates[offset];\n var y1 = flatCoordinates[offset + 1];\n // copy first point\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n var x2 = x1;\n var y2 = y1;\n for (offset += stride; offset < end; offset += stride) {\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n if (squaredDistance(x1, y1, x2, y2) > squaredTolerance) {\n // copy point at offset\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n }\n }\n if (x2 != x1 || y2 != y1) {\n // copy last point\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n }\n return simplifiedOffset;\n}\n/**\n * @param {number} value Value.\n * @param {number} tolerance Tolerance.\n * @return {number} Rounded value.\n */\nexport function snap(value, tolerance) {\n return tolerance * Math.round(value / tolerance);\n}\n/**\n * Simplifies a line string using an algorithm designed by Tim Schaub.\n * Coordinates are snapped to the nearest value in a virtual grid and\n * consecutive duplicate coordinates are discarded. This effectively preserves\n * topology as the simplification of any subsection of a line string is\n * independent of the rest of the line string. This means that, for examples,\n * the common edge between two polygons will be simplified to the same line\n * string independently in both polygons. This implementation uses a single\n * pass over the coordinates and eliminates intermediate collinear points.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n // do nothing if the line is empty\n if (offset == end) {\n return simplifiedOffset;\n }\n // snap the first coordinate (P1)\n var x1 = snap(flatCoordinates[offset], tolerance);\n var y1 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // add the first coordinate to the output\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n // find the next coordinate that does not snap to the same value as the first\n // coordinate (P2)\n var x2, y2;\n do {\n x2 = snap(flatCoordinates[offset], tolerance);\n y2 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n if (offset == end) {\n // all coordinates snap to the same value, the line collapses to a point\n // push the last snapped value anyway to ensure that the output contains\n // at least two points\n // FIXME should we really return at least two points anyway?\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n }\n } while (x2 == x1 && y2 == y1);\n while (offset < end) {\n // snap the next coordinate (P3)\n var x3 = snap(flatCoordinates[offset], tolerance);\n var y3 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // skip P3 if it is equal to P2\n if (x3 == x2 && y3 == y2) {\n continue;\n }\n // calculate the delta between P1 and P2\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n // calculate the delta between P3 and P1\n var dx2 = x3 - x1;\n var dy2 = y3 - y1;\n // if P1, P2, and P3 are colinear and P3 is further from P1 than P2 is from\n // P1 in the same direction then P2 is on the straight line between P1 and\n // P3\n if (dx1 * dy2 == dy1 * dx2 &&\n ((dx1 < 0 && dx2 < dx1) || dx1 == dx2 || (dx1 > 0 && dx2 > dx1)) &&\n ((dy1 < 0 && dy2 < dy1) || dy1 == dy2 || (dy1 > 0 && dy2 > dy1))) {\n // discard P2 and set P2 = P3\n x2 = x3;\n y2 = y3;\n continue;\n }\n // either P1, P2, and P3 are not colinear, or they are colinear but P3 is\n // between P3 and P1 or on the opposite half of the line to P2. add P2,\n // and continue with P1 = P2 and P2 = P3\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n x2 = x3;\n y2 = y3;\n }\n // add the last point (P2)\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n simplifiedOffset = quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function quantizeMultiArray(flatCoordinates, offset, endss, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n var simplifiedEnds = [];\n simplifiedOffset = quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n//# sourceMappingURL=simplify.js.map","/**\n * @module ol/geom/flat/inflate\n */\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Array} [opt_coordinates] Coordinates.\n * @return {Array} Coordinates.\n */\nexport function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {\n var coordinates = opt_coordinates !== undefined ? opt_coordinates : [];\n var i = 0;\n for (var j = offset; j < end; j += stride) {\n coordinates[i++] = flatCoordinates.slice(j, j + stride);\n }\n coordinates.length = i;\n return coordinates;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {Array>} [opt_coordinatess] Coordinatess.\n * @return {Array>} Coordinatess.\n */\nexport function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {\n var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];\n var i = 0;\n for (var j = 0, jj = ends.length; j < jj; ++j) {\n var end = ends[j];\n coordinatess[i++] = inflateCoordinates(flatCoordinates, offset, end, stride, coordinatess[i]);\n offset = end;\n }\n coordinatess.length = i;\n return coordinatess;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array>>} [opt_coordinatesss]\n * Coordinatesss.\n * @return {Array>>} Coordinatesss.\n */\nexport function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {\n var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];\n var i = 0;\n for (var j = 0, jj = endss.length; j < jj; ++j) {\n var ends = endss[j];\n coordinatesss[i++] = inflateCoordinatesArray(flatCoordinates, offset, ends, stride, coordinatesss[i]);\n offset = ends[ends.length - 1];\n }\n coordinatesss.length = i;\n return coordinatesss;\n}\n//# sourceMappingURL=inflate.js.map","/**\n * @module ol/geom/flat/area\n */\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRing(flatCoordinates, offset, end, stride) {\n var twiceArea = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n twiceArea += y1 * x2 - x1 * y2;\n x1 = x2;\n y1 = y2;\n }\n return twiceArea / 2;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRings(flatCoordinates, offset, ends, stride) {\n var area = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n area += linearRing(flatCoordinates, offset, end, stride);\n offset = end;\n }\n return area;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRingss(flatCoordinates, offset, endss, stride) {\n var area = 0;\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n area += linearRings(flatCoordinates, offset, ends, stride);\n offset = ends[ends.length - 1];\n }\n return area;\n}\n//# sourceMappingURL=area.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/LinearRing\n */\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { assignClosestPoint, maxSquaredDelta } from './flat/closest.js';\nimport { closestSquaredDistanceXY } from '../extent.js';\nimport { deflateCoordinates } from './flat/deflate.js';\nimport { douglasPeucker } from './flat/simplify.js';\nimport { inflateCoordinates } from './flat/inflate.js';\nimport { linearRing as linearRingArea } from './flat/area.js';\n/**\n * @classdesc\n * Linear ring geometry. Only used as part of polygon; cannot be rendered\n * on its own.\n *\n * @api\n */\nvar LinearRing = /** @class */ (function (_super) {\n __extends(LinearRing, _super);\n /**\n * @param {Array|Array} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `opt_layout` are also accepted.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n */\n function LinearRing(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {\n _this.setFlatCoordinates(opt_layout, \n /** @type {Array} */ (coordinates));\n }\n else {\n _this.setCoordinates(\n /** @type {Array} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Make a complete copy of the geometry.\n * @return {!LinearRing} Clone.\n * @api\n */\n LinearRing.prototype.clone = function () {\n return new LinearRing(this.flatCoordinates.slice(), this.layout);\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n LinearRing.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(maxSquaredDelta(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestPoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * Return the area of the linear ring on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n LinearRing.prototype.getArea = function () {\n return linearRingArea(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * Return the coordinates of the linear ring.\n * @return {Array} Coordinates.\n * @api\n */\n LinearRing.prototype.getCoordinates = function () {\n return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n };\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LinearRing} Simplified LinearRing.\n * @protected\n */\n LinearRing.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = douglasPeucker(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return new LinearRing(simplifiedFlatCoordinates, GeometryLayout.XY);\n };\n /**\n * Get the type of this geometry.\n * @return {import(\"./GeometryType.js\").default} Geometry type.\n * @api\n */\n LinearRing.prototype.getType = function () {\n return GeometryType.LINEAR_RING;\n };\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n LinearRing.prototype.intersectsExtent = function (extent) {\n return false;\n };\n /**\n * Set the coordinates of the linear ring.\n * @param {!Array} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n * @api\n */\n LinearRing.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return LinearRing;\n}(SimpleGeometry));\nexport default LinearRing;\n//# sourceMappingURL=LinearRing.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Point\n */\nimport GeometryType from './GeometryType.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { containsXY, createOrUpdateFromCoordinate } from '../extent.js';\nimport { deflateCoordinate } from './flat/deflate.js';\nimport { squaredDistance as squaredDx } from '../math.js';\n/**\n * @classdesc\n * Point geometry.\n *\n * @api\n */\nvar Point = /** @class */ (function (_super) {\n __extends(Point, _super);\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n */\n function Point(coordinates, opt_layout) {\n var _this = _super.call(this) || this;\n _this.setCoordinates(coordinates, opt_layout);\n return _this;\n }\n /**\n * Make a complete copy of the geometry.\n * @return {!Point} Clone.\n * @api\n */\n Point.prototype.clone = function () {\n var point = new Point(this.flatCoordinates.slice(), this.layout);\n point.applyProperties(this);\n return point;\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n Point.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n var flatCoordinates = this.flatCoordinates;\n var squaredDistance = squaredDx(x, y, flatCoordinates[0], flatCoordinates[1]);\n if (squaredDistance < minSquaredDistance) {\n var stride = this.stride;\n for (var i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n else {\n return minSquaredDistance;\n }\n };\n /**\n * Return the coordinate of the point.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinates.\n * @api\n */\n Point.prototype.getCoordinates = function () {\n return !this.flatCoordinates ? [] : this.flatCoordinates.slice();\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n Point.prototype.computeExtent = function (extent) {\n return createOrUpdateFromCoordinate(this.flatCoordinates, extent);\n };\n /**\n * Get the type of this geometry.\n * @return {import(\"./GeometryType.js\").default} Geometry type.\n * @api\n */\n Point.prototype.getType = function () {\n return GeometryType.POINT;\n };\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n Point.prototype.intersectsExtent = function (extent) {\n return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);\n };\n /**\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n * @api\n */\n Point.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinate(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n };\n return Point;\n}(SimpleGeometry));\nexport default Point;\n//# sourceMappingURL=Point.js.map","/**\n * @module ol/geom/flat/contains\n */\nimport { forEachCorner } from '../../extent.js';\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} Contains extent.\n */\nexport function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {\n var outside = forEachCorner(extent, \n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains (x, y).\n */\n function (coordinate) {\n return !linearRingContainsXY(flatCoordinates, offset, end, stride, coordinate[0], coordinate[1]);\n });\n return !outside;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingContainsXY(flatCoordinates, offset, end, stride, x, y) {\n // https://geomalgorithms.com/a03-_inclusion.html\n // Copyright 2000 softSurfer, 2012 Dan Sunday\n // This code may be freely used and modified for any purpose\n // providing that this copyright notice is included with it.\n // SoftSurfer makes no warranty for this code, and cannot be held\n // liable for any real or imagined damage resulting from its use.\n // Users of this code must verify correctness for their application.\n var wn = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n if (y1 <= y) {\n if (y2 > y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) > 0) {\n wn++;\n }\n }\n else if (y2 <= y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) < 0) {\n wn--;\n }\n x1 = x2;\n y1 = y2;\n }\n return wn !== 0;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) {\n if (ends.length === 0) {\n return false;\n }\n if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) {\n return false;\n }\n for (var i = 1, ii = ends.length; i < ii; ++i) {\n if (linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) {\n return false;\n }\n }\n return true;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) {\n if (endss.length === 0) {\n return false;\n }\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n//# sourceMappingURL=contains.js.map","/**\n * @module ol/geom/flat/interiorpoint\n */\nimport { linearRingsContainsXY } from './contains.js';\nimport { numberSafeCompareFunction } from '../../array.js';\n/**\n * Calculates a point that is likely to lie in the interior of the linear rings.\n * Inspired by JTS's com.vividsolutions.jts.geom.Geometry#getInteriorPoint.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {Array} flatCenters Flat centers.\n * @param {number} flatCentersOffset Flat center offset.\n * @param {Array} [opt_dest] Destination.\n * @return {Array} Destination point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, flatCentersOffset, opt_dest) {\n var i, ii, x, x1, x2, y1, y2;\n var y = flatCenters[flatCentersOffset + 1];\n /** @type {Array} */\n var intersections = [];\n // Calculate intersections with the horizontal line\n for (var r = 0, rr = ends.length; r < rr; ++r) {\n var end = ends[r];\n x1 = flatCoordinates[end - stride];\n y1 = flatCoordinates[end - stride + 1];\n for (i = offset; i < end; i += stride) {\n x2 = flatCoordinates[i];\n y2 = flatCoordinates[i + 1];\n if ((y <= y1 && y2 <= y) || (y1 <= y && y <= y2)) {\n x = ((y - y1) / (y2 - y1)) * (x2 - x1) + x1;\n intersections.push(x);\n }\n x1 = x2;\n y1 = y2;\n }\n }\n // Find the longest segment of the horizontal line that has its center point\n // inside the linear ring.\n var pointX = NaN;\n var maxSegmentLength = -Infinity;\n intersections.sort(numberSafeCompareFunction);\n x1 = intersections[0];\n for (i = 1, ii = intersections.length; i < ii; ++i) {\n x2 = intersections[i];\n var segmentLength = Math.abs(x2 - x1);\n if (segmentLength > maxSegmentLength) {\n x = (x1 + x2) / 2;\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n pointX = x;\n maxSegmentLength = segmentLength;\n }\n }\n x1 = x2;\n }\n if (isNaN(pointX)) {\n // There is no horizontal line that has its center point inside the linear\n // ring. Use the center of the the linear ring's extent.\n pointX = flatCenters[flatCentersOffset];\n }\n if (opt_dest) {\n opt_dest.push(pointX, y, maxSegmentLength);\n return opt_dest;\n }\n else {\n return [pointX, y, maxSegmentLength];\n }\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array} flatCenters Flat centers.\n * @return {Array} Interior points as XYM coordinates, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, flatCenters) {\n var interiorPoints = [];\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n interiorPoints = getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, 2 * i, interiorPoints);\n offset = ends[ends.length - 1];\n }\n return interiorPoints;\n}\n//# sourceMappingURL=interiorpoint.js.map","/**\n * @module ol/geom/flat/segments\n */\n/**\n * This function calls `callback` for each segment of the flat coordinates\n * array. If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {function(import(\"../../coordinate.js\").Coordinate, import(\"../../coordinate.js\").Coordinate): T} callback Function\n * called for each segment.\n * @return {T|boolean} Value.\n * @template T\n */\nexport function forEach(flatCoordinates, offset, end, stride, callback) {\n var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]];\n var point2 = [];\n var ret;\n for (; offset + stride < end; offset += stride) {\n point2[0] = flatCoordinates[offset + stride];\n point2[1] = flatCoordinates[offset + stride + 1];\n ret = callback(point1, point2);\n if (ret) {\n return ret;\n }\n point1[0] = point2[0];\n point1[1] = point2[1];\n }\n return false;\n}\n//# sourceMappingURL=segments.js.map","/**\n * @module ol/geom/flat/intersectsextent\n */\nimport { containsExtent, createEmpty, extendFlatCoordinates, intersects, intersectsSegment, } from '../../extent.js';\nimport { forEach as forEachSegment } from './segments.js';\nimport { linearRingContainsExtent, linearRingContainsXY } from './contains.js';\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineString(flatCoordinates, offset, end, stride, extent) {\n var coordinatesExtent = extendFlatCoordinates(createEmpty(), flatCoordinates, offset, end, stride);\n if (!intersects(extent, coordinatesExtent)) {\n return false;\n }\n if (containsExtent(extent, coordinatesExtent)) {\n return true;\n }\n if (coordinatesExtent[0] >= extent[0] && coordinatesExtent[2] <= extent[2]) {\n return true;\n }\n if (coordinatesExtent[1] >= extent[1] && coordinatesExtent[3] <= extent[3]) {\n return true;\n }\n return forEachSegment(flatCoordinates, offset, end, stride, \n /**\n * @param {import(\"../../coordinate.js\").Coordinate} point1 Start point.\n * @param {import(\"../../coordinate.js\").Coordinate} point2 End point.\n * @return {boolean} `true` if the segment and the extent intersect,\n * `false` otherwise.\n */\n function (point1, point2) {\n return intersectsSegment(extent, point1, point2);\n });\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n if (intersectsLineString(flatCoordinates, offset, ends[i], stride, extent)) {\n return true;\n }\n offset = ends[i];\n }\n return false;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {\n if (intersectsLineString(flatCoordinates, offset, end, stride, extent)) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[0], extent[1])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[0], extent[3])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[2], extent[1])) {\n return true;\n }\n if (linearRingContainsXY(flatCoordinates, offset, end, stride, extent[2], extent[3])) {\n return true;\n }\n return false;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {\n if (!intersectsLinearRing(flatCoordinates, offset, ends[0], stride, extent)) {\n return false;\n }\n if (ends.length === 1) {\n return true;\n }\n for (var i = 1, ii = ends.length; i < ii; ++i) {\n if (linearRingContainsExtent(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n if (!intersectsLineString(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n return false;\n }\n }\n }\n return true;\n}\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n//# sourceMappingURL=intersectsextent.js.map","/**\n * @module ol/geom/flat/reverse\n */\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n */\nexport function coordinates(flatCoordinates, offset, end, stride) {\n while (offset < end - stride) {\n for (var i = 0; i < stride; ++i) {\n var tmp = flatCoordinates[offset + i];\n flatCoordinates[offset + i] = flatCoordinates[end - stride + i];\n flatCoordinates[end - stride + i] = tmp;\n }\n offset += stride;\n end -= stride;\n }\n}\n//# sourceMappingURL=reverse.js.map","/**\n * @module ol/geom/flat/orient\n */\nimport { coordinates as reverseCoordinates } from './reverse.js';\n/**\n * Is the linear ring oriented clockwise in a coordinate system with a bottom-left\n * coordinate origin? For a coordinate system with a top-left coordinate origin,\n * the ring's orientation is clockwise when this function returns false.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {boolean} Is clockwise.\n */\nexport function linearRingIsClockwise(flatCoordinates, offset, end, stride) {\n // https://stackoverflow.com/q/1165647/clockwise-method#1165943\n // https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrlinearring.cpp\n var edge = 0;\n var x1 = flatCoordinates[end - stride];\n var y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n var x2 = flatCoordinates[offset];\n var y2 = flatCoordinates[offset + 1];\n edge += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n return edge === 0 ? undefined : edge > 0;\n}\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `opt_right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [opt_right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingsAreOriented(flatCoordinates, offset, ends, stride, opt_right) {\n var right = opt_right !== undefined ? opt_right : false;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n if (i === 0) {\n if ((right && isClockwise) || (!right && !isClockwise)) {\n return false;\n }\n }\n else {\n if ((right && !isClockwise) || (!right && isClockwise)) {\n return false;\n }\n }\n offset = end;\n }\n return true;\n}\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `opt_right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [opt_right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingssAreOriented(flatCoordinates, offset, endss, stride, opt_right) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n var ends = endss[i];\n if (!linearRingsAreOriented(flatCoordinates, offset, ends, stride, opt_right)) {\n return false;\n }\n if (ends.length) {\n offset = ends[ends.length - 1];\n }\n }\n return true;\n}\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `opt_right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {boolean} [opt_right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRings(flatCoordinates, offset, ends, stride, opt_right) {\n var right = opt_right !== undefined ? opt_right : false;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n var reverse = i === 0\n ? (right && isClockwise) || (!right && !isClockwise)\n : (right && !isClockwise) || (!right && isClockwise);\n if (reverse) {\n reverseCoordinates(flatCoordinates, offset, end, stride);\n }\n offset = end;\n }\n return offset;\n}\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `opt_right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [opt_right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRingsArray(flatCoordinates, offset, endss, stride, opt_right) {\n for (var i = 0, ii = endss.length; i < ii; ++i) {\n offset = orientLinearRings(flatCoordinates, offset, endss[i], stride, opt_right);\n }\n return offset;\n}\n//# sourceMappingURL=orient.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/geom/Polygon\n */\nimport GeometryLayout from './GeometryLayout.js';\nimport GeometryType from './GeometryType.js';\nimport LinearRing from './LinearRing.js';\nimport Point from './Point.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport { arrayMaxSquaredDelta, assignClosestArrayPoint } from './flat/closest.js';\nimport { closestSquaredDistanceXY, getCenter } from '../extent.js';\nimport { deflateCoordinatesArray } from './flat/deflate.js';\nimport { extend } from '../array.js';\nimport { getInteriorPointOfArray } from './flat/interiorpoint.js';\nimport { inflateCoordinatesArray } from './flat/inflate.js';\nimport { intersectsLinearRingArray } from './flat/intersectsextent.js';\nimport { linearRingsAreOriented, orientLinearRings } from './flat/orient.js';\nimport { linearRings as linearRingsArea } from './flat/area.js';\nimport { linearRingsContainsXY } from './flat/contains.js';\nimport { modulo } from '../math.js';\nimport { quantizeArray } from './flat/simplify.js';\nimport { offset as sphereOffset } from '../sphere.js';\n/**\n * @classdesc\n * Polygon geometry.\n *\n * @api\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * @param {!Array>|!Array} coordinates\n * Array of linear rings that define the polygon. The first linear ring of the\n * array defines the outer-boundary or surface of the polygon. Each subsequent\n * linear ring defines a hole in the surface of the polygon. A linear ring is\n * an array of vertices' coordinates where the first coordinate and the last are\n * equivalent. (For internal use, flat coordinates in combination with\n * `opt_layout` and `opt_ends` are also accepted.)\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n * @param {Array} [opt_ends] Ends (for internal use with flat coordinates).\n */\n function Polygon(coordinates, opt_layout, opt_ends) {\n var _this = _super.call(this) || this;\n /**\n * @type {Array}\n * @private\n */\n _this.ends_ = [];\n /**\n * @private\n * @type {number}\n */\n _this.flatInteriorPointRevision_ = -1;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.flatInteriorPoint_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.maxDeltaRevision_ = -1;\n /**\n * @private\n * @type {number}\n */\n _this.orientedRevision_ = -1;\n /**\n * @private\n * @type {Array}\n */\n _this.orientedFlatCoordinates_ = null;\n if (opt_layout !== undefined && opt_ends) {\n _this.setFlatCoordinates(opt_layout, \n /** @type {Array} */ (coordinates));\n _this.ends_ = opt_ends;\n }\n else {\n _this.setCoordinates(\n /** @type {Array>} */ (coordinates), opt_layout);\n }\n return _this;\n }\n /**\n * Append the passed linear ring to this polygon.\n * @param {LinearRing} linearRing Linear ring.\n * @api\n */\n Polygon.prototype.appendLinearRing = function (linearRing) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = linearRing.getFlatCoordinates().slice();\n }\n else {\n extend(this.flatCoordinates, linearRing.getFlatCoordinates());\n }\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n };\n /**\n * Make a complete copy of the geometry.\n * @return {!Polygon} Clone.\n * @api\n */\n Polygon.prototype.clone = function () {\n var polygon = new Polygon(this.flatCoordinates.slice(), this.layout, this.ends_.slice());\n polygon.applyProperties(this);\n return polygon;\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n Polygon.prototype.closestPointXY = function (x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates, 0, this.ends_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n Polygon.prototype.containsXY = function (x, y) {\n return linearRingsContainsXY(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);\n };\n /**\n * Return the area of the polygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n Polygon.prototype.getArea = function () {\n return linearRingsArea(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);\n };\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for polygons.\n *\n * @param {boolean} [opt_right] Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array>} Coordinates.\n * @api\n */\n Polygon.prototype.getCoordinates = function (opt_right) {\n var flatCoordinates;\n if (opt_right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n orientLinearRings(flatCoordinates, 0, this.ends_, this.stride, opt_right);\n }\n else {\n flatCoordinates = this.flatCoordinates;\n }\n return inflateCoordinatesArray(flatCoordinates, 0, this.ends_, this.stride);\n };\n /**\n * @return {Array} Ends.\n */\n Polygon.prototype.getEnds = function () {\n return this.ends_;\n };\n /**\n * @return {Array} Interior point.\n */\n Polygon.prototype.getFlatInteriorPoint = function () {\n if (this.flatInteriorPointRevision_ != this.getRevision()) {\n var flatCenter = getCenter(this.getExtent());\n this.flatInteriorPoint_ = getInteriorPointOfArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, flatCenter, 0);\n this.flatInteriorPointRevision_ = this.getRevision();\n }\n return this.flatInteriorPoint_;\n };\n /**\n * Return an interior point of the polygon.\n * @return {Point} Interior point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n * @api\n */\n Polygon.prototype.getInteriorPoint = function () {\n return new Point(this.getFlatInteriorPoint(), GeometryLayout.XYM);\n };\n /**\n * Return the number of rings of the polygon, this includes the exterior\n * ring and any interior rings.\n *\n * @return {number} Number of rings.\n * @api\n */\n Polygon.prototype.getLinearRingCount = function () {\n return this.ends_.length;\n };\n /**\n * Return the Nth linear ring of the polygon geometry. Return `null` if the\n * given index is out of range.\n * The exterior linear ring is available at index `0` and the interior rings\n * at index `1` and beyond.\n *\n * @param {number} index Index.\n * @return {LinearRing} Linear ring.\n * @api\n */\n Polygon.prototype.getLinearRing = function (index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LinearRing(this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);\n };\n /**\n * Return the linear rings of the polygon.\n * @return {Array} Linear rings.\n * @api\n */\n Polygon.prototype.getLinearRings = function () {\n var layout = this.layout;\n var flatCoordinates = this.flatCoordinates;\n var ends = this.ends_;\n var linearRings = [];\n var offset = 0;\n for (var i = 0, ii = ends.length; i < ii; ++i) {\n var end = ends[i];\n var linearRing = new LinearRing(flatCoordinates.slice(offset, end), layout);\n linearRings.push(linearRing);\n offset = end;\n }\n return linearRings;\n };\n /**\n * @return {Array} Oriented flat coordinates.\n */\n Polygon.prototype.getOrientedFlatCoordinates = function () {\n if (this.orientedRevision_ != this.getRevision()) {\n var flatCoordinates = this.flatCoordinates;\n if (linearRingsAreOriented(flatCoordinates, 0, this.ends_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n }\n else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length = orientLinearRings(this.orientedFlatCoordinates_, 0, this.ends_, this.stride);\n }\n this.orientedRevision_ = this.getRevision();\n }\n return this.orientedFlatCoordinates_;\n };\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Polygon} Simplified Polygon.\n * @protected\n */\n Polygon.prototype.getSimplifiedGeometryInternal = function (squaredTolerance) {\n var simplifiedFlatCoordinates = [];\n var simplifiedEnds = [];\n simplifiedFlatCoordinates.length = quantizeArray(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds);\n return new Polygon(simplifiedFlatCoordinates, GeometryLayout.XY, simplifiedEnds);\n };\n /**\n * Get the type of this geometry.\n * @return {import(\"./GeometryType.js\").default} Geometry type.\n * @api\n */\n Polygon.prototype.getType = function () {\n return GeometryType.POLYGON;\n };\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n Polygon.prototype.intersectsExtent = function (extent) {\n return intersectsLinearRingArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent);\n };\n /**\n * Set the coordinates of the polygon.\n * @param {!Array>} coordinates Coordinates.\n * @param {import(\"./GeometryLayout.js\").default} [opt_layout] Layout.\n * @api\n */\n Polygon.prototype.setCoordinates = function (coordinates, opt_layout) {\n this.setLayout(opt_layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n var ends = deflateCoordinatesArray(this.flatCoordinates, 0, coordinates, this.stride, this.ends_);\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n };\n return Polygon;\n}(SimpleGeometry));\nexport default Polygon;\n/**\n * Create an approximation of a circle on the surface of a sphere.\n * @param {import(\"../coordinate.js\").Coordinate} center Center (`[lon, lat]` in degrees).\n * @param {number} radius The great-circle distance from the center to\n * the polygon vertices in meters.\n * @param {number} [opt_n] Optional number of vertices for the resulting\n * polygon. Default is `32`.\n * @param {number} [opt_sphereRadius] Optional radius for the sphere (defaults to\n * the Earth's mean radius using the WGS84 ellipsoid).\n * @return {Polygon} The \"circular\" polygon.\n * @api\n */\nexport function circular(center, radius, opt_n, opt_sphereRadius) {\n var n = opt_n ? opt_n : 32;\n /** @type {Array} */\n var flatCoordinates = [];\n for (var i = 0; i < n; ++i) {\n extend(flatCoordinates, sphereOffset(center, radius, (2 * Math.PI * i) / n, opt_sphereRadius));\n }\n flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);\n return new Polygon(flatCoordinates, GeometryLayout.XY, [\n flatCoordinates.length,\n ]);\n}\n/**\n * Create a polygon from an extent. The layout used is `XY`.\n * @param {import(\"../extent.js\").Extent} extent The extent.\n * @return {Polygon} The polygon.\n * @api\n */\nexport function fromExtent(extent) {\n var minX = extent[0];\n var minY = extent[1];\n var maxX = extent[2];\n var maxY = extent[3];\n var flatCoordinates = [\n minX,\n minY,\n minX,\n maxY,\n maxX,\n maxY,\n maxX,\n minY,\n minX,\n minY,\n ];\n return new Polygon(flatCoordinates, GeometryLayout.XY, [\n flatCoordinates.length,\n ]);\n}\n/**\n * Create a regular polygon from a circle.\n * @param {import(\"./Circle.js\").default} circle Circle geometry.\n * @param {number} [opt_sides] Number of sides of the polygon. Default is 32.\n * @param {number} [opt_angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n * @return {Polygon} Polygon geometry.\n * @api\n */\nexport function fromCircle(circle, opt_sides, opt_angle) {\n var sides = opt_sides ? opt_sides : 32;\n var stride = circle.getStride();\n var layout = circle.getLayout();\n var center = circle.getCenter();\n var arrayLength = stride * (sides + 1);\n var flatCoordinates = new Array(arrayLength);\n for (var i = 0; i < arrayLength; i += stride) {\n flatCoordinates[i] = 0;\n flatCoordinates[i + 1] = 0;\n for (var j = 2; j < stride; j++) {\n flatCoordinates[i + j] = center[j];\n }\n }\n var ends = [flatCoordinates.length];\n var polygon = new Polygon(flatCoordinates, layout, ends);\n makeRegular(polygon, center, circle.getRadius(), opt_angle);\n return polygon;\n}\n/**\n * Modify the coordinates of a polygon to make it a regular polygon.\n * @param {Polygon} polygon Polygon geometry.\n * @param {import(\"../coordinate.js\").Coordinate} center Center of the regular polygon.\n * @param {number} radius Radius of the regular polygon.\n * @param {number} [opt_angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n */\nexport function makeRegular(polygon, center, radius, opt_angle) {\n var flatCoordinates = polygon.getFlatCoordinates();\n var stride = polygon.getStride();\n var sides = flatCoordinates.length / stride - 1;\n var startAngle = opt_angle ? opt_angle : 0;\n for (var i = 0; i <= sides; ++i) {\n var offset = i * stride;\n var angle = startAngle + (modulo(i, sides) * 2 * Math.PI) / sides;\n flatCoordinates[offset] = center[0] + radius * Math.cos(angle);\n flatCoordinates[offset + 1] = center[1] + radius * Math.sin(angle);\n }\n polygon.changed();\n}\n//# sourceMappingURL=Polygon.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Geolocation\n */\nimport BaseEvent from './events/Event.js';\nimport BaseObject from './Object.js';\nimport EventType from './events/EventType.js';\nimport { circular as circularPolygon } from './geom/Polygon.js';\nimport { get as getProjection, getTransformFromProjections, identityTransform, } from './proj.js';\nimport { toRadians } from './math.js';\n/**\n * @enum {string}\n */\nvar Property = {\n ACCURACY: 'accuracy',\n ACCURACY_GEOMETRY: 'accuracyGeometry',\n ALTITUDE: 'altitude',\n ALTITUDE_ACCURACY: 'altitudeAccuracy',\n HEADING: 'heading',\n POSITION: 'position',\n PROJECTION: 'projection',\n SPEED: 'speed',\n TRACKING: 'tracking',\n TRACKING_OPTIONS: 'trackingOptions',\n};\n/**\n * @classdesc\n * Events emitted on Geolocation error.\n */\nvar GeolocationError = /** @class */ (function (_super) {\n __extends(GeolocationError, _super);\n /**\n * @param {GeolocationPositionError} error error object.\n */\n function GeolocationError(error) {\n var _this = _super.call(this, EventType.ERROR) || this;\n /**\n * @type {number}\n */\n _this.code = error.code;\n /**\n * @type {string}\n */\n _this.message = error.message;\n return _this;\n }\n return GeolocationError;\n}(BaseEvent));\n/**\n * @typedef {Object} Options\n * @property {boolean} [tracking=false] Start Tracking right after\n * instantiation.\n * @property {PositionOptions} [trackingOptions] Tracking options.\n * See https://www.w3.org/TR/geolocation-API/#position_options_interface.\n * @property {import(\"./proj.js\").ProjectionLike} [projection] The projection the position\n * is reported in.\n */\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:accuracy'|'change:accuracyGeometry'|'change:altitude'|\n * 'change:altitudeAccuracy'|'change:heading'|'change:position'|'change:projection'|'change:speed'|'change:tracking'|\n * 'change:trackingOptions'} GeolocationObjectEventTypes\n */\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature<'error', GeolocationError, Return> &\n * import(\"./Observable\").CombinedOnSignature} GeolocationOnSignature\n */\n/**\n * @classdesc\n * Helper class for providing HTML5 Geolocation capabilities.\n * The [Geolocation API](https://www.w3.org/TR/geolocation-API/)\n * is used to locate a user's position.\n *\n * To get notified of position changes, register a listener for the generic\n * `change` event on your instance of {@link module:ol/Geolocation~Geolocation}.\n *\n * Example:\n *\n * var geolocation = new Geolocation({\n * // take the projection to use from the map's view\n * projection: view.getProjection()\n * });\n * // listen to changes in position\n * geolocation.on('change', function(evt) {\n * window.console.log(geolocation.getPosition());\n * });\n *\n * @fires module:ol/events/Event~BaseEvent#event:error\n * @api\n */\nvar Geolocation = /** @class */ (function (_super) {\n __extends(Geolocation, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function Geolocation(opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {GeolocationOnSignature}\n */\n _this.on;\n /***\n * @type {GeolocationOnSignature}\n */\n _this.once;\n /***\n * @type {GeolocationOnSignature}\n */\n _this.un;\n var options = opt_options || {};\n /**\n * The unprojected (EPSG:4326) device position.\n * @private\n * @type {?import(\"./coordinate.js\").Coordinate}\n */\n _this.position_ = null;\n /**\n * @private\n * @type {import(\"./proj.js\").TransformFunction}\n */\n _this.transform_ = identityTransform;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.watchId_ = undefined;\n _this.addChangeListener(Property.PROJECTION, _this.handleProjectionChanged_);\n _this.addChangeListener(Property.TRACKING, _this.handleTrackingChanged_);\n if (options.projection !== undefined) {\n _this.setProjection(options.projection);\n }\n if (options.trackingOptions !== undefined) {\n _this.setTrackingOptions(options.trackingOptions);\n }\n _this.setTracking(options.tracking !== undefined ? options.tracking : false);\n return _this;\n }\n /**\n * Clean up.\n */\n Geolocation.prototype.disposeInternal = function () {\n this.setTracking(false);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * @private\n */\n Geolocation.prototype.handleProjectionChanged_ = function () {\n var projection = this.getProjection();\n if (projection) {\n this.transform_ = getTransformFromProjections(getProjection('EPSG:4326'), projection);\n if (this.position_) {\n this.set(Property.POSITION, this.transform_(this.position_));\n }\n }\n };\n /**\n * @private\n */\n Geolocation.prototype.handleTrackingChanged_ = function () {\n if ('geolocation' in navigator) {\n var tracking = this.getTracking();\n if (tracking && this.watchId_ === undefined) {\n this.watchId_ = navigator.geolocation.watchPosition(this.positionChange_.bind(this), this.positionError_.bind(this), this.getTrackingOptions());\n }\n else if (!tracking && this.watchId_ !== undefined) {\n navigator.geolocation.clearWatch(this.watchId_);\n this.watchId_ = undefined;\n }\n }\n };\n /**\n * @private\n * @param {GeolocationPosition} position position event.\n */\n Geolocation.prototype.positionChange_ = function (position) {\n var coords = position.coords;\n this.set(Property.ACCURACY, coords.accuracy);\n this.set(Property.ALTITUDE, coords.altitude === null ? undefined : coords.altitude);\n this.set(Property.ALTITUDE_ACCURACY, coords.altitudeAccuracy === null ? undefined : coords.altitudeAccuracy);\n this.set(Property.HEADING, coords.heading === null ? undefined : toRadians(coords.heading));\n if (!this.position_) {\n this.position_ = [coords.longitude, coords.latitude];\n }\n else {\n this.position_[0] = coords.longitude;\n this.position_[1] = coords.latitude;\n }\n var projectedPosition = this.transform_(this.position_);\n this.set(Property.POSITION, projectedPosition);\n this.set(Property.SPEED, coords.speed === null ? undefined : coords.speed);\n var geometry = circularPolygon(this.position_, coords.accuracy);\n geometry.applyTransform(this.transform_);\n this.set(Property.ACCURACY_GEOMETRY, geometry);\n this.changed();\n };\n /**\n * @private\n * @param {GeolocationPositionError} error error object.\n */\n Geolocation.prototype.positionError_ = function (error) {\n this.dispatchEvent(new GeolocationError(error));\n };\n /**\n * Get the accuracy of the position in meters.\n * @return {number|undefined} The accuracy of the position measurement in\n * meters.\n * @observable\n * @api\n */\n Geolocation.prototype.getAccuracy = function () {\n return /** @type {number|undefined} */ (this.get(Property.ACCURACY));\n };\n /**\n * Get a geometry of the position accuracy.\n * @return {?import(\"./geom/Polygon.js\").default} A geometry of the position accuracy.\n * @observable\n * @api\n */\n Geolocation.prototype.getAccuracyGeometry = function () {\n return /** @type {?import(\"./geom/Polygon.js\").default} */ (this.get(Property.ACCURACY_GEOMETRY) || null);\n };\n /**\n * Get the altitude associated with the position.\n * @return {number|undefined} The altitude of the position in meters above mean\n * sea level.\n * @observable\n * @api\n */\n Geolocation.prototype.getAltitude = function () {\n return /** @type {number|undefined} */ (this.get(Property.ALTITUDE));\n };\n /**\n * Get the altitude accuracy of the position.\n * @return {number|undefined} The accuracy of the altitude measurement in\n * meters.\n * @observable\n * @api\n */\n Geolocation.prototype.getAltitudeAccuracy = function () {\n return /** @type {number|undefined} */ (this.get(Property.ALTITUDE_ACCURACY));\n };\n /**\n * Get the heading as radians clockwise from North.\n * Note: depending on the browser, the heading is only defined if the `enableHighAccuracy`\n * is set to `true` in the tracking options.\n * @return {number|undefined} The heading of the device in radians from north.\n * @observable\n * @api\n */\n Geolocation.prototype.getHeading = function () {\n return /** @type {number|undefined} */ (this.get(Property.HEADING));\n };\n /**\n * Get the position of the device.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The current position of the device reported\n * in the current projection.\n * @observable\n * @api\n */\n Geolocation.prototype.getPosition = function () {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (this.get(Property.POSITION));\n };\n /**\n * Get the projection associated with the position.\n * @return {import(\"./proj/Projection.js\").default|undefined} The projection the position is\n * reported in.\n * @observable\n * @api\n */\n Geolocation.prototype.getProjection = function () {\n return /** @type {import(\"./proj/Projection.js\").default|undefined} */ (this.get(Property.PROJECTION));\n };\n /**\n * Get the speed in meters per second.\n * @return {number|undefined} The instantaneous speed of the device in meters\n * per second.\n * @observable\n * @api\n */\n Geolocation.prototype.getSpeed = function () {\n return /** @type {number|undefined} */ (this.get(Property.SPEED));\n };\n /**\n * Determine if the device location is being tracked.\n * @return {boolean} The device location is being tracked.\n * @observable\n * @api\n */\n Geolocation.prototype.getTracking = function () {\n return /** @type {boolean} */ (this.get(Property.TRACKING));\n };\n /**\n * Get the tracking options.\n * See https://www.w3.org/TR/geolocation-API/#position-options.\n * @return {PositionOptions|undefined} PositionOptions as defined by\n * the [HTML5 Geolocation spec\n * ](https://www.w3.org/TR/geolocation-API/#position_options_interface).\n * @observable\n * @api\n */\n Geolocation.prototype.getTrackingOptions = function () {\n return /** @type {PositionOptions|undefined} */ (this.get(Property.TRACKING_OPTIONS));\n };\n /**\n * Set the projection to use for transforming the coordinates.\n * @param {import(\"./proj.js\").ProjectionLike} projection The projection the position is\n * reported in.\n * @observable\n * @api\n */\n Geolocation.prototype.setProjection = function (projection) {\n this.set(Property.PROJECTION, getProjection(projection));\n };\n /**\n * Enable or disable tracking.\n * @param {boolean} tracking Enable tracking.\n * @observable\n * @api\n */\n Geolocation.prototype.setTracking = function (tracking) {\n this.set(Property.TRACKING, tracking);\n };\n /**\n * Set the tracking options.\n * See http://www.w3.org/TR/geolocation-API/#position-options.\n * @param {PositionOptions} options PositionOptions as defined by the\n * [HTML5 Geolocation spec\n * ](http://www.w3.org/TR/geolocation-API/#position_options_interface).\n * @observable\n * @api\n */\n Geolocation.prototype.setTrackingOptions = function (options) {\n this.set(Property.TRACKING_OPTIONS, options);\n };\n return Geolocation;\n}(BaseObject));\nexport default Geolocation;\n//# sourceMappingURL=Geolocation.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageBase\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport { abstract } from './util.js';\n/**\n * @abstract\n */\nvar ImageBase = /** @class */ (function (_super) {\n __extends(ImageBase, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|undefined} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./ImageState.js\").default} state State.\n */\n function ImageBase(extent, resolution, pixelRatio, state) {\n var _this = _super.call(this) || this;\n /**\n * @protected\n * @type {import(\"./extent.js\").Extent}\n */\n _this.extent = extent;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ = pixelRatio;\n /**\n * @protected\n * @type {number|undefined}\n */\n _this.resolution = resolution;\n /**\n * @protected\n * @type {import(\"./ImageState.js\").default}\n */\n _this.state = state;\n return _this;\n }\n /**\n * @protected\n */\n ImageBase.prototype.changed = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n ImageBase.prototype.getExtent = function () {\n return this.extent;\n };\n /**\n * @abstract\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n */\n ImageBase.prototype.getImage = function () {\n return abstract();\n };\n /**\n * @return {number} PixelRatio.\n */\n ImageBase.prototype.getPixelRatio = function () {\n return this.pixelRatio_;\n };\n /**\n * @return {number} Resolution.\n */\n ImageBase.prototype.getResolution = function () {\n return /** @type {number} */ (this.resolution);\n };\n /**\n * @return {import(\"./ImageState.js\").default} State.\n */\n ImageBase.prototype.getState = function () {\n return this.state;\n };\n /**\n * Load not yet loaded URI.\n * @abstract\n */\n ImageBase.prototype.load = function () {\n abstract();\n };\n return ImageBase;\n}(EventTarget));\nexport default ImageBase;\n//# sourceMappingURL=ImageBase.js.map","/**\n * @module ol/ImageState\n */\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n ERROR: 3,\n EMPTY: 4,\n};\n//# sourceMappingURL=ImageState.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Image\n */\nimport EventType from './events/EventType.js';\nimport ImageBase from './ImageBase.js';\nimport ImageState from './ImageState.js';\nimport { IMAGE_DECODE } from './has.js';\nimport { getHeight } from './extent.js';\nimport { listenOnce, unlistenByKey } from './events.js';\n/**\n * A function that takes an {@link module:ol/Image~Image} for the image and a\n * `{string}` for the src as arguments. It is supposed to make it so the\n * underlying image {@link module:ol/Image~Image#getImage} is assigned the\n * content specified by the src. If not specified, the default is\n *\n * function(image, src) {\n * image.getImage().src = src;\n * }\n *\n * Providing a custom `imageLoadFunction` can be useful to load images with\n * post requests or - in general - through XHR requests, where the src of the\n * image element would be set to a data URI when the content is loaded.\n *\n * @typedef {function(ImageWrapper, string): void} LoadFunction\n * @api\n */\nvar ImageWrapper = /** @class */ (function (_super) {\n __extends(ImageWrapper, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|undefined} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {string} src Image source URI.\n * @param {?string} crossOrigin Cross origin.\n * @param {LoadFunction} imageLoadFunction Image load function.\n */\n function ImageWrapper(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {\n var _this = _super.call(this, extent, resolution, pixelRatio, ImageState.IDLE) || this;\n /**\n * @private\n * @type {string}\n */\n _this.src_ = src;\n /**\n * @private\n * @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}\n */\n _this.image_ = new Image();\n if (crossOrigin !== null) {\n _this.image_.crossOrigin = crossOrigin;\n }\n /**\n * @private\n * @type {?function():void}\n */\n _this.unlisten_ = null;\n /**\n * @protected\n * @type {import(\"./ImageState.js\").default}\n */\n _this.state = ImageState.IDLE;\n /**\n * @private\n * @type {LoadFunction}\n */\n _this.imageLoadFunction_ = imageLoadFunction;\n return _this;\n }\n /**\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n * @api\n */\n ImageWrapper.prototype.getImage = function () {\n return this.image_;\n };\n /**\n * Tracks loading or read errors.\n *\n * @private\n */\n ImageWrapper.prototype.handleImageError_ = function () {\n this.state = ImageState.ERROR;\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Tracks successful image load.\n *\n * @private\n */\n ImageWrapper.prototype.handleImageLoad_ = function () {\n if (this.resolution === undefined) {\n this.resolution = getHeight(this.extent) / this.image_.height;\n }\n this.state = ImageState.LOADED;\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Load the image or retry if loading previously failed.\n * Loading is taken care of by the tile queue, and calling this method is\n * only needed for preloading or for reloading in case of an error.\n * @api\n */\n ImageWrapper.prototype.load = function () {\n if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) {\n this.state = ImageState.LOADING;\n this.changed();\n this.imageLoadFunction_(this, this.src_);\n this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));\n }\n };\n /**\n * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image.\n */\n ImageWrapper.prototype.setImage = function (image) {\n this.image_ = image;\n this.resolution = getHeight(this.extent) / this.image_.height;\n };\n /**\n * Discards event handlers which listen for load completion or errors.\n *\n * @private\n */\n ImageWrapper.prototype.unlistenImage_ = function () {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n };\n return ImageWrapper;\n}(ImageBase));\n/**\n * @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image element.\n * @param {function():any} loadHandler Load callback function.\n * @param {function():any} errorHandler Error callback function.\n * @return {function():void} Callback to stop listening.\n */\nexport function listenImage(image, loadHandler, errorHandler) {\n var img = /** @type {HTMLImageElement} */ (image);\n if (img.src && IMAGE_DECODE) {\n var promise = img.decode();\n var listening_1 = true;\n var unlisten = function () {\n listening_1 = false;\n };\n promise\n .then(function () {\n if (listening_1) {\n loadHandler();\n }\n })\n .catch(function (error) {\n if (listening_1) {\n // FIXME: Unconditionally call errorHandler() when this bug is fixed upstream:\n // https://bugs.webkit.org/show_bug.cgi?id=198527\n if (error.name === 'EncodingError' &&\n error.message === 'Invalid image type.') {\n loadHandler();\n }\n else {\n errorHandler();\n }\n }\n });\n return unlisten;\n }\n var listenerKeys = [\n listenOnce(img, EventType.LOAD, loadHandler),\n listenOnce(img, EventType.ERROR, errorHandler),\n ];\n return function unlisten() {\n listenerKeys.forEach(unlistenByKey);\n };\n}\nexport default ImageWrapper;\n//# sourceMappingURL=Image.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageCanvas\n */\nimport ImageBase from './ImageBase.js';\nimport ImageState from './ImageState.js';\n/**\n * A function that is called to trigger asynchronous canvas drawing. It is\n * called with a \"done\" callback that should be called when drawing is done.\n * If any error occurs during drawing, the \"done\" callback should be called with\n * that error.\n *\n * @typedef {function(function(Error=): void): void} Loader\n */\nvar ImageCanvas = /** @class */ (function (_super) {\n __extends(ImageCanvas, _super);\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {HTMLCanvasElement} canvas Canvas.\n * @param {Loader} [opt_loader] Optional loader function to\n * support asynchronous canvas drawing.\n */\n function ImageCanvas(extent, resolution, pixelRatio, canvas, opt_loader) {\n var _this = this;\n var state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;\n _this = _super.call(this, extent, resolution, pixelRatio, state) || this;\n /**\n * Optional canvas loader function.\n * @type {?Loader}\n * @private\n */\n _this.loader_ = opt_loader !== undefined ? opt_loader : null;\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n _this.canvas_ = canvas;\n /**\n * @private\n * @type {?Error}\n */\n _this.error_ = null;\n return _this;\n }\n /**\n * Get any error associated with asynchronous rendering.\n * @return {?Error} Any error that occurred during rendering.\n */\n ImageCanvas.prototype.getError = function () {\n return this.error_;\n };\n /**\n * Handle async drawing complete.\n * @param {Error} [err] Any error during drawing.\n * @private\n */\n ImageCanvas.prototype.handleLoad_ = function (err) {\n if (err) {\n this.error_ = err;\n this.state = ImageState.ERROR;\n }\n else {\n this.state = ImageState.LOADED;\n }\n this.changed();\n };\n /**\n * Load not yet loaded URI.\n */\n ImageCanvas.prototype.load = function () {\n if (this.state == ImageState.IDLE) {\n this.state = ImageState.LOADING;\n this.changed();\n this.loader_(this.handleLoad_.bind(this));\n }\n };\n /**\n * @return {HTMLCanvasElement} Canvas element.\n */\n ImageCanvas.prototype.getImage = function () {\n return this.canvas_;\n };\n return ImageCanvas;\n}(ImageBase));\nexport default ImageCanvas;\n//# sourceMappingURL=ImageCanvas.js.map","/**\n * @module ol/TileState\n */\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n /**\n * Indicates that tile loading failed\n * @type {number}\n */\n ERROR: 3,\n EMPTY: 4,\n};\n//# sourceMappingURL=TileState.js.map","/**\n * @module ol/easing\n */\n/**\n * Start slow and speed up.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function easeIn(t) {\n return Math.pow(t, 3);\n}\n/**\n * Start fast and slow down.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function easeOut(t) {\n return 1 - easeIn(1 - t);\n}\n/**\n * Start slow, speed up, and then slow down again.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function inAndOut(t) {\n return 3 * t * t - 2 * t * t * t;\n}\n/**\n * Maintain a constant speed over time.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function linear(t) {\n return t;\n}\n/**\n * Start slow, speed up, and at the very end slow down again. This has the\n * same general behavior as {@link module:ol/easing.inAndOut}, but the final\n * slowdown is delayed.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nexport function upAndDown(t) {\n if (t < 0.5) {\n return inAndOut(2 * t);\n }\n else {\n return 1 - inAndOut(2 * (t - 0.5));\n }\n}\n//# sourceMappingURL=easing.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/Tile\n */\nimport EventTarget from './events/Target.js';\nimport EventType from './events/EventType.js';\nimport TileState from './TileState.js';\nimport { abstract } from './util.js';\nimport { easeIn } from './easing.js';\n/**\n * A function that takes an {@link module:ol/Tile} for the tile and a\n * `{string}` for the url as arguments. The default is\n * ```js\n * source.setTileLoadFunction(function(tile, src) {\n * tile.getImage().src = src;\n * });\n * ```\n * For more fine grained control, the load function can use fetch or XMLHttpRequest and involve\n * error handling:\n *\n * ```js\n * import TileState from 'ol/TileState';\n *\n * source.setTileLoadFunction(function(tile, src) {\n * var xhr = new XMLHttpRequest();\n * xhr.responseType = 'blob';\n * xhr.addEventListener('loadend', function (evt) {\n * var data = this.response;\n * if (data !== undefined) {\n * tile.getImage().src = URL.createObjectURL(data);\n * } else {\n * tile.setState(TileState.ERROR);\n * }\n * });\n * xhr.addEventListener('error', function () {\n * tile.setState(TileState.ERROR);\n * });\n * xhr.open('GET', src);\n * xhr.send();\n * });\n * ```\n *\n * @typedef {function(Tile, string): void} LoadFunction\n * @api\n */\n/**\n * {@link module:ol/source/Tile~Tile} sources use a function of this type to get\n * the url that provides a tile for a given tile coordinate.\n *\n * This function takes an {@link module:ol/tilecoord~TileCoord} for the tile\n * coordinate, a `{number}` representing the pixel ratio and a\n * {@link module:ol/proj/Projection} for the projection as arguments\n * and returns a `{string}` representing the tile URL, or undefined if no tile\n * should be requested for the passed tile coordinate.\n *\n * @typedef {function(import(\"./tilecoord.js\").TileCoord, number,\n * import(\"./proj/Projection.js\").default): (string|undefined)} UrlFunction\n * @api\n */\n/**\n * @typedef {Object} Options\n * @property {number} [transition=250] A duration for tile opacity\n * transitions in milliseconds. A duration of 0 disables the opacity transition.\n * @api\n */\n/**\n * @classdesc\n * Base class for tiles.\n *\n * @abstract\n */\nvar Tile = /** @class */ (function (_super) {\n __extends(Tile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {Options} [opt_options] Tile options.\n */\n function Tile(tileCoord, state, opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @type {import(\"./tilecoord.js\").TileCoord}\n */\n _this.tileCoord = tileCoord;\n /**\n * @protected\n * @type {import(\"./TileState.js\").default}\n */\n _this.state = state;\n /**\n * An \"interim\" tile for this tile. The interim tile may be used while this\n * one is loading, for \"smooth\" transitions when changing params/dimensions\n * on the source.\n * @type {Tile}\n */\n _this.interimTile = null;\n /**\n * A key assigned to the tile. This is used by the tile source to determine\n * if this tile can effectively be used, or if a new tile should be created\n * and this one be used as an interim tile for this new tile.\n * @type {string}\n */\n _this.key = '';\n /**\n * The duration for the opacity transition.\n * @type {number}\n */\n _this.transition_ =\n options.transition === undefined ? 250 : options.transition;\n /**\n * Lookup of start times for rendering transitions. If the start time is\n * equal to -1, the transition is complete.\n * @type {Object}\n */\n _this.transitionStarts_ = {};\n return _this;\n }\n /**\n * @protected\n */\n Tile.prototype.changed = function () {\n this.dispatchEvent(EventType.CHANGE);\n };\n /**\n * Called by the tile cache when the tile is removed from the cache due to expiry\n */\n Tile.prototype.release = function () { };\n /**\n * @return {string} Key.\n */\n Tile.prototype.getKey = function () {\n return this.key + '/' + this.tileCoord;\n };\n /**\n * Get the interim tile most suitable for rendering using the chain of interim\n * tiles. This corresponds to the most recent tile that has been loaded, if no\n * such tile exists, the original tile is returned.\n * @return {!Tile} Best tile for rendering.\n */\n Tile.prototype.getInterimTile = function () {\n if (!this.interimTile) {\n //empty chain\n return this;\n }\n var tile = this.interimTile;\n // find the first loaded tile and return it. Since the chain is sorted in\n // decreasing order of creation time, there is no need to search the remainder\n // of the list (all those tiles correspond to older requests and will be\n // cleaned up by refreshInterimChain)\n do {\n if (tile.getState() == TileState.LOADED) {\n // Show tile immediately instead of fading it in after loading, because\n // the interim tile is in place already\n this.transition_ = 0;\n return tile;\n }\n tile = tile.interimTile;\n } while (tile);\n // we can not find a better tile\n return this;\n };\n /**\n * Goes through the chain of interim tiles and discards sections of the chain\n * that are no longer relevant.\n */\n Tile.prototype.refreshInterimChain = function () {\n if (!this.interimTile) {\n return;\n }\n var tile = this.interimTile;\n var prev = /** @type {Tile} */ (this);\n do {\n if (tile.getState() == TileState.LOADED) {\n //we have a loaded tile, we can discard the rest of the list\n //we would could abort any LOADING tile request\n //older than this tile (i.e. any LOADING tile following this entry in the chain)\n tile.interimTile = null;\n break;\n }\n else if (tile.getState() == TileState.LOADING) {\n //keep this LOADING tile any loaded tiles later in the chain are\n //older than this tile, so we're still interested in the request\n prev = tile;\n }\n else if (tile.getState() == TileState.IDLE) {\n //the head of the list is the most current tile, we don't need\n //to start any other requests for this chain\n prev.interimTile = tile.interimTile;\n }\n else {\n prev = tile;\n }\n tile = prev.interimTile;\n } while (tile);\n };\n /**\n * Get the tile coordinate for this tile.\n * @return {import(\"./tilecoord.js\").TileCoord} The tile coordinate.\n * @api\n */\n Tile.prototype.getTileCoord = function () {\n return this.tileCoord;\n };\n /**\n * @return {import(\"./TileState.js\").default} State.\n */\n Tile.prototype.getState = function () {\n return this.state;\n };\n /**\n * Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,\n * it is important to set the state correctly to {@link module:ol/TileState~ERROR}\n * when the tile cannot be loaded. Otherwise the tile cannot be removed from\n * the tile queue and will block other requests.\n * @param {import(\"./TileState.js\").default} state State.\n * @api\n */\n Tile.prototype.setState = function (state) {\n if (this.state !== TileState.ERROR && this.state > state) {\n throw new Error('Tile load sequence violation');\n }\n this.state = state;\n this.changed();\n };\n /**\n * Load the image or retry if loading previously failed.\n * Loading is taken care of by the tile queue, and calling this method is\n * only needed for preloading or for reloading in case of an error.\n * @abstract\n * @api\n */\n Tile.prototype.load = function () {\n abstract();\n };\n /**\n * Get the alpha value for rendering.\n * @param {string} id An id for the renderer.\n * @param {number} time The render frame time.\n * @return {number} A number between 0 and 1.\n */\n Tile.prototype.getAlpha = function (id, time) {\n if (!this.transition_) {\n return 1;\n }\n var start = this.transitionStarts_[id];\n if (!start) {\n start = time;\n this.transitionStarts_[id] = start;\n }\n else if (start === -1) {\n return 1;\n }\n var delta = time - start + 1000 / 60; // avoid rendering at 0\n if (delta >= this.transition_) {\n return 1;\n }\n return easeIn(delta / this.transition_);\n };\n /**\n * Determine if a tile is in an alpha transition. A tile is considered in\n * transition if tile.getAlpha() has not yet been called or has been called\n * and returned 1.\n * @param {string} id An id for the renderer.\n * @return {boolean} The tile is in transition.\n */\n Tile.prototype.inTransition = function (id) {\n if (!this.transition_) {\n return false;\n }\n return this.transitionStarts_[id] !== -1;\n };\n /**\n * Mark a transition as complete.\n * @param {string} id An id for the renderer.\n */\n Tile.prototype.endTransition = function (id) {\n if (this.transition_) {\n this.transitionStarts_[id] = -1;\n }\n };\n return Tile;\n}(EventTarget));\nexport default Tile;\n//# sourceMappingURL=Tile.js.map","import { WORKER_OFFSCREEN_CANVAS } from './has.js';\n/**\n * @module ol/dom\n */\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number} [opt_width] Canvas width.\n * @param {number} [opt_height] Canvas height.\n * @param {Array} [opt_canvasPool] Canvas pool to take existing canvas from.\n * @param {CanvasRenderingContext2DSettings} [opt_Context2DSettings] CanvasRenderingContext2DSettings\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(opt_width, opt_height, opt_canvasPool, opt_Context2DSettings) {\n var canvas = opt_canvasPool && opt_canvasPool.length\n ? opt_canvasPool.shift()\n : WORKER_OFFSCREEN_CANVAS\n ? new OffscreenCanvas(opt_width || 300, opt_height || 300)\n : document.createElement('canvas');\n if (opt_width) {\n canvas.width = opt_width;\n }\n if (opt_height) {\n canvas.height = opt_height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d', opt_Context2DSettings));\n}\n/**\n * Get the current computed width for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerWidth(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The width.\n */\nexport function outerWidth(element) {\n var width = element.offsetWidth;\n var style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n return width;\n}\n/**\n * Get the current computed height for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerHeight(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The height.\n */\nexport function outerHeight(element) {\n var height = element.offsetHeight;\n var style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n return height;\n}\n/**\n * @param {Node} newNode Node to replace old node\n * @param {Node} oldNode The node to be replaced\n */\nexport function replaceNode(newNode, oldNode) {\n var parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n/**\n * @param {Node} node The node to remove.\n * @return {Node} The node that was removed or null.\n */\nexport function removeNode(node) {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n}\n/**\n * @param {Node} node The node to remove the children from.\n */\nexport function removeChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n/**\n * Transform the children of a parent node so they match the\n * provided list of children. This function aims to efficiently\n * remove, add, and reorder child nodes while maintaining a simple\n * implementation (it is not guaranteed to minimize DOM operations).\n * @param {Node} node The parent node whose children need reworking.\n * @param {Array} children The desired children.\n */\nexport function replaceChildren(node, children) {\n var oldChildren = node.childNodes;\n for (var i = 0; true; ++i) {\n var oldChild = oldChildren[i];\n var newChild = children[i];\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n//# sourceMappingURL=dom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/ImageTile\n */\nimport Tile from './Tile.js';\nimport TileState from './TileState.js';\nimport { createCanvasContext2D } from './dom.js';\nimport { listenImage } from './Image.js';\nvar ImageTile = /** @class */ (function (_super) {\n __extends(ImageTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {string} src Image source URI.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"./Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @param {import(\"./Tile.js\").Options} [opt_options] Tile options.\n */\n function ImageTile(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {\n var _this = _super.call(this, tileCoord, state, opt_options) || this;\n /**\n * @private\n * @type {?string}\n */\n _this.crossOrigin_ = crossOrigin;\n /**\n * Image URI\n *\n * @private\n * @type {string}\n */\n _this.src_ = src;\n _this.key = src;\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement}\n */\n _this.image_ = new Image();\n if (crossOrigin !== null) {\n _this.image_.crossOrigin = crossOrigin;\n }\n /**\n * @private\n * @type {?function():void}\n */\n _this.unlisten_ = null;\n /**\n * @private\n * @type {import(\"./Tile.js\").LoadFunction}\n */\n _this.tileLoadFunction_ = tileLoadFunction;\n return _this;\n }\n /**\n * Get the HTML image element for this tile (may be a Canvas, Image, or Video).\n * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.\n * @api\n */\n ImageTile.prototype.getImage = function () {\n return this.image_;\n };\n /**\n * Sets an HTML image element for this tile (may be a Canvas or preloaded Image).\n * @param {HTMLCanvasElement|HTMLImageElement} element Element.\n */\n ImageTile.prototype.setImage = function (element) {\n this.image_ = element;\n this.state = TileState.LOADED;\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Tracks loading or read errors.\n *\n * @private\n */\n ImageTile.prototype.handleImageError_ = function () {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n };\n /**\n * Tracks successful image load.\n *\n * @private\n */\n ImageTile.prototype.handleImageLoad_ = function () {\n var image = /** @type {HTMLImageElement} */ (this.image_);\n if (image.naturalWidth && image.naturalHeight) {\n this.state = TileState.LOADED;\n }\n else {\n this.state = TileState.EMPTY;\n }\n this.unlistenImage_();\n this.changed();\n };\n /**\n * Load not yet loaded URI.\n * @api\n */\n ImageTile.prototype.load = function () {\n if (this.state == TileState.ERROR) {\n this.state = TileState.IDLE;\n this.image_ = new Image();\n if (this.crossOrigin_ !== null) {\n this.image_.crossOrigin = this.crossOrigin_;\n }\n }\n if (this.state == TileState.IDLE) {\n this.state = TileState.LOADING;\n this.changed();\n this.tileLoadFunction_(this, this.src_);\n this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));\n }\n };\n /**\n * Discards event handlers which listen for load completion or errors.\n *\n * @private\n */\n ImageTile.prototype.unlistenImage_ = function () {\n if (this.unlisten_) {\n this.unlisten_();\n this.unlisten_ = null;\n }\n };\n return ImageTile;\n}(Tile));\n/**\n * Get a 1-pixel blank image.\n * @return {HTMLCanvasElement} Blank image.\n */\nfunction getBlankImage() {\n var ctx = createCanvasContext2D(1, 1);\n ctx.fillStyle = 'rgba(0,0,0,0)';\n ctx.fillRect(0, 0, 1, 1);\n return ctx.canvas;\n}\nexport default ImageTile;\n//# sourceMappingURL=ImageTile.js.map","/**\n * @module ol/Kinetic\n */\n/**\n * @classdesc\n * Implementation of inertial deceleration for map movement.\n *\n * @api\n */\nvar Kinetic = /** @class */ (function () {\n /**\n * @param {number} decay Rate of decay (must be negative).\n * @param {number} minVelocity Minimum velocity (pixels/millisecond).\n * @param {number} delay Delay to consider to calculate the kinetic\n * initial values (milliseconds).\n */\n function Kinetic(decay, minVelocity, delay) {\n /**\n * @private\n * @type {number}\n */\n this.decay_ = decay;\n /**\n * @private\n * @type {number}\n */\n this.minVelocity_ = minVelocity;\n /**\n * @private\n * @type {number}\n */\n this.delay_ = delay;\n /**\n * @private\n * @type {Array}\n */\n this.points_ = [];\n /**\n * @private\n * @type {number}\n */\n this.angle_ = 0;\n /**\n * @private\n * @type {number}\n */\n this.initialVelocity_ = 0;\n }\n /**\n * FIXME empty description for jsdoc\n */\n Kinetic.prototype.begin = function () {\n this.points_.length = 0;\n this.angle_ = 0;\n this.initialVelocity_ = 0;\n };\n /**\n * @param {number} x X.\n * @param {number} y Y.\n */\n Kinetic.prototype.update = function (x, y) {\n this.points_.push(x, y, Date.now());\n };\n /**\n * @return {boolean} Whether we should do kinetic animation.\n */\n Kinetic.prototype.end = function () {\n if (this.points_.length < 6) {\n // at least 2 points are required (i.e. there must be at least 6 elements\n // in the array)\n return false;\n }\n var delay = Date.now() - this.delay_;\n var lastIndex = this.points_.length - 3;\n if (this.points_[lastIndex + 2] < delay) {\n // the last tracked point is too old, which means that the user stopped\n // panning before releasing the map\n return false;\n }\n // get the first point which still falls into the delay time\n var firstIndex = lastIndex - 3;\n while (firstIndex > 0 && this.points_[firstIndex + 2] > delay) {\n firstIndex -= 3;\n }\n var duration = this.points_[lastIndex + 2] - this.points_[firstIndex + 2];\n // we don't want a duration of 0 (divide by zero)\n // we also make sure the user panned for a duration of at least one frame\n // (1/60s) to compute sane displacement values\n if (duration < 1000 / 60) {\n return false;\n }\n var dx = this.points_[lastIndex] - this.points_[firstIndex];\n var dy = this.points_[lastIndex + 1] - this.points_[firstIndex + 1];\n this.angle_ = Math.atan2(dy, dx);\n this.initialVelocity_ = Math.sqrt(dx * dx + dy * dy) / duration;\n return this.initialVelocity_ > this.minVelocity_;\n };\n /**\n * @return {number} Total distance travelled (pixels).\n */\n Kinetic.prototype.getDistance = function () {\n return (this.minVelocity_ - this.initialVelocity_) / this.decay_;\n };\n /**\n * @return {number} Angle of the kinetic panning animation (radians).\n */\n Kinetic.prototype.getAngle = function () {\n return this.angle_;\n };\n return Kinetic;\n}());\nexport default Kinetic;\n//# sourceMappingURL=Kinetic.js.map","/**\n * @module ol/color\n */\nimport { assert } from './asserts.js';\nimport { clamp } from './math.js';\n/**\n * A color represented as a short array [red, green, blue, alpha].\n * red, green, and blue should be integers in the range 0..255 inclusive.\n * alpha should be a float in the range 0..1 inclusive. If no alpha value is\n * given then `1` will be used.\n * @typedef {Array} Color\n * @api\n */\n/**\n * This RegExp matches # followed by 3, 4, 6, or 8 hex digits.\n * @const\n * @type {RegExp}\n * @private\n */\nvar HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i;\n/**\n * Regular expression for matching potential named color style strings.\n * @const\n * @type {RegExp}\n * @private\n */\nvar NAMED_COLOR_RE_ = /^([a-z]*)$|^hsla?\\(.*\\)$/i;\n/**\n * Return the color as an rgba string.\n * @param {Color|string} color Color.\n * @return {string} Rgba string.\n * @api\n */\nexport function asString(color) {\n if (typeof color === 'string') {\n return color;\n }\n else {\n return toString(color);\n }\n}\n/**\n * Return named color as an rgba string.\n * @param {string} color Named color.\n * @return {string} Rgb string.\n */\nfunction fromNamed(color) {\n var el = document.createElement('div');\n el.style.color = color;\n if (el.style.color !== '') {\n document.body.appendChild(el);\n var rgb = getComputedStyle(el).color;\n document.body.removeChild(el);\n return rgb;\n }\n else {\n return '';\n }\n}\n/**\n * @param {string} s String.\n * @return {Color} Color.\n */\nexport var fromString = (function () {\n // We maintain a small cache of parsed strings. To provide cheap LRU-like\n // semantics, whenever the cache grows too large we simply delete an\n // arbitrary 25% of the entries.\n /**\n * @const\n * @type {number}\n */\n var MAX_CACHE_SIZE = 1024;\n /**\n * @type {Object}\n */\n var cache = {};\n /**\n * @type {number}\n */\n var cacheSize = 0;\n return (\n /**\n * @param {string} s String.\n * @return {Color} Color.\n */\n function (s) {\n var color;\n if (cache.hasOwnProperty(s)) {\n color = cache[s];\n }\n else {\n if (cacheSize >= MAX_CACHE_SIZE) {\n var i = 0;\n for (var key in cache) {\n if ((i++ & 3) === 0) {\n delete cache[key];\n --cacheSize;\n }\n }\n }\n color = fromStringInternal_(s);\n cache[s] = color;\n ++cacheSize;\n }\n return color;\n });\n})();\n/**\n * Return the color as an array. This function maintains a cache of calculated\n * arrays which means the result should not be modified.\n * @param {Color|string} color Color.\n * @return {Color} Color.\n * @api\n */\nexport function asArray(color) {\n if (Array.isArray(color)) {\n return color;\n }\n else {\n return fromString(color);\n }\n}\n/**\n * @param {string} s String.\n * @private\n * @return {Color} Color.\n */\nfunction fromStringInternal_(s) {\n var r, g, b, a, color;\n if (NAMED_COLOR_RE_.exec(s)) {\n s = fromNamed(s);\n }\n if (HEX_COLOR_RE_.exec(s)) {\n // hex\n var n = s.length - 1; // number of hex digits\n var d = // number of digits per channel\n void 0; // number of digits per channel\n if (n <= 4) {\n d = 1;\n }\n else {\n d = 2;\n }\n var hasAlpha = n === 4 || n === 8;\n r = parseInt(s.substr(1 + 0 * d, d), 16);\n g = parseInt(s.substr(1 + 1 * d, d), 16);\n b = parseInt(s.substr(1 + 2 * d, d), 16);\n if (hasAlpha) {\n a = parseInt(s.substr(1 + 3 * d, d), 16);\n }\n else {\n a = 255;\n }\n if (d == 1) {\n r = (r << 4) + r;\n g = (g << 4) + g;\n b = (b << 4) + b;\n if (hasAlpha) {\n a = (a << 4) + a;\n }\n }\n color = [r, g, b, a / 255];\n }\n else if (s.indexOf('rgba(') == 0) {\n // rgba()\n color = s.slice(5, -1).split(',').map(Number);\n normalize(color);\n }\n else if (s.indexOf('rgb(') == 0) {\n // rgb()\n color = s.slice(4, -1).split(',').map(Number);\n color.push(1);\n normalize(color);\n }\n else {\n assert(false, 14); // Invalid color\n }\n return color;\n}\n/**\n * TODO this function is only used in the test, we probably shouldn't export it\n * @param {Color} color Color.\n * @return {Color} Clamped color.\n */\nexport function normalize(color) {\n color[0] = clamp((color[0] + 0.5) | 0, 0, 255);\n color[1] = clamp((color[1] + 0.5) | 0, 0, 255);\n color[2] = clamp((color[2] + 0.5) | 0, 0, 255);\n color[3] = clamp(color[3], 0, 1);\n return color;\n}\n/**\n * @param {Color} color Color.\n * @return {string} String.\n */\nexport function toString(color) {\n var r = color[0];\n if (r != (r | 0)) {\n r = (r + 0.5) | 0;\n }\n var g = color[1];\n if (g != (g | 0)) {\n g = (g + 0.5) | 0;\n }\n var b = color[2];\n if (b != (b | 0)) {\n b = (b + 0.5) | 0;\n }\n var a = color[3] === undefined ? 1 : color[3];\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}\n/**\n * @param {string} s String.\n * @return {boolean} Whether the string is actually a valid color\n */\nexport function isStringColor(s) {\n if (NAMED_COLOR_RE_.test(s)) {\n s = fromNamed(s);\n }\n return (HEX_COLOR_RE_.test(s) || s.indexOf('rgba(') === 0 || s.indexOf('rgb(') === 0);\n}\n//# sourceMappingURL=color.js.map","/**\n * @module ol/style/IconImageCache\n */\nimport { asString } from '../color.js';\n/**\n * @classdesc\n * Singleton class. Available through {@link module:ol/style/IconImageCache~shared}.\n */\nvar IconImageCache = /** @class */ (function () {\n function IconImageCache() {\n /**\n * @type {!Object}\n * @private\n */\n this.cache_ = {};\n /**\n * @type {number}\n * @private\n */\n this.cacheSize_ = 0;\n /**\n * @type {number}\n * @private\n */\n this.maxCacheSize_ = 32;\n }\n /**\n * FIXME empty description for jsdoc\n */\n IconImageCache.prototype.clear = function () {\n this.cache_ = {};\n this.cacheSize_ = 0;\n };\n /**\n * @return {boolean} Can expire cache.\n */\n IconImageCache.prototype.canExpireCache = function () {\n return this.cacheSize_ > this.maxCacheSize_;\n };\n /**\n * FIXME empty description for jsdoc\n */\n IconImageCache.prototype.expire = function () {\n if (this.canExpireCache()) {\n var i = 0;\n for (var key in this.cache_) {\n var iconImage = this.cache_[key];\n if ((i++ & 3) === 0 && !iconImage.hasListener()) {\n delete this.cache_[key];\n --this.cacheSize_;\n }\n }\n }\n };\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {import(\"./IconImage.js\").default} Icon image.\n */\n IconImageCache.prototype.get = function (src, crossOrigin, color) {\n var key = getKey(src, crossOrigin, color);\n return key in this.cache_ ? this.cache_[key] : null;\n };\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @param {import(\"./IconImage.js\").default} iconImage Icon image.\n */\n IconImageCache.prototype.set = function (src, crossOrigin, color, iconImage) {\n var key = getKey(src, crossOrigin, color);\n this.cache_[key] = iconImage;\n ++this.cacheSize_;\n };\n /**\n * Set the cache size of the icon cache. Default is `32`. Change this value when\n * your map uses more than 32 different icon images and you are not caching icon\n * styles on the application level.\n * @param {number} maxCacheSize Cache max size.\n * @api\n */\n IconImageCache.prototype.setSize = function (maxCacheSize) {\n this.maxCacheSize_ = maxCacheSize;\n this.expire();\n };\n return IconImageCache;\n}());\n/**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {string} Cache key.\n */\nfunction getKey(src, crossOrigin, color) {\n var colorString = color ? asString(color) : 'null';\n return crossOrigin + ':' + src + ':' + colorString;\n}\nexport default IconImageCache;\n/**\n * The {@link module:ol/style/IconImageCache~IconImageCache} for\n * {@link module:ol/style/Icon~Icon} images.\n * @api\n */\nexport var shared = new IconImageCache();\n//# sourceMappingURL=IconImageCache.js.map","/**\n * @module ol/layer/Property\n */\n/**\n * @enum {string}\n */\nexport default {\n OPACITY: 'opacity',\n VISIBLE: 'visible',\n EXTENT: 'extent',\n Z_INDEX: 'zIndex',\n MAX_RESOLUTION: 'maxResolution',\n MIN_RESOLUTION: 'minResolution',\n MAX_ZOOM: 'maxZoom',\n MIN_ZOOM: 'minZoom',\n SOURCE: 'source',\n};\n//# sourceMappingURL=Property.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Base\n */\nimport BaseObject from '../Object.js';\nimport LayerProperty from './Property.js';\nimport { abstract } from '../util.js';\nimport { assert } from '../asserts.js';\nimport { assign } from '../obj.js';\nimport { clamp } from '../math.js';\n/**\n * @typedef {import(\"../ObjectEventType\").Types|'change:extent'|'change:maxResolution'|'change:maxZoom'|\n * 'change:minResolution'|'change:minZoom'|'change:opacity'|'change:visible'|'change:zIndex'} BaseLayerObjectEventTypes\n */\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").CombinedOnSignature} BaseLayerOnSignature\n */\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Note that with {@link module:ol/layer/Base} and all its subclasses, any property set in\n * the options is set as a {@link module:ol/Object} property on the layer object, so\n * is observable, and has get/set accessors.\n *\n * @api\n */\nvar BaseLayer = /** @class */ (function (_super) {\n __extends(BaseLayer, _super);\n /**\n * @param {Options} options Layer options.\n */\n function BaseLayer(options) {\n var _this = _super.call(this) || this;\n /***\n * @type {BaseLayerOnSignature}\n */\n _this.on;\n /***\n * @type {BaseLayerOnSignature}\n */\n _this.once;\n /***\n * @type {BaseLayerOnSignature}\n */\n _this.un;\n /**\n * @type {Object}\n */\n var properties = assign({}, options);\n if (typeof options.properties === 'object') {\n delete properties.properties;\n assign(properties, options.properties);\n }\n properties[LayerProperty.OPACITY] =\n options.opacity !== undefined ? options.opacity : 1;\n assert(typeof properties[LayerProperty.OPACITY] === 'number', 64); // Layer opacity must be a number\n properties[LayerProperty.VISIBLE] =\n options.visible !== undefined ? options.visible : true;\n properties[LayerProperty.Z_INDEX] = options.zIndex;\n properties[LayerProperty.MAX_RESOLUTION] =\n options.maxResolution !== undefined ? options.maxResolution : Infinity;\n properties[LayerProperty.MIN_RESOLUTION] =\n options.minResolution !== undefined ? options.minResolution : 0;\n properties[LayerProperty.MIN_ZOOM] =\n options.minZoom !== undefined ? options.minZoom : -Infinity;\n properties[LayerProperty.MAX_ZOOM] =\n options.maxZoom !== undefined ? options.maxZoom : Infinity;\n /**\n * @type {string}\n * @private\n */\n _this.className_ =\n properties.className !== undefined ? options.className : 'ol-layer';\n delete properties.className;\n _this.setProperties(properties);\n /**\n * @type {import(\"./Layer.js\").State}\n * @private\n */\n _this.state_ = null;\n return _this;\n }\n /**\n * @return {string} CSS class name.\n */\n BaseLayer.prototype.getClassName = function () {\n return this.className_;\n };\n /**\n * This method is not meant to be called by layers or layer renderers because the state\n * is incorrect if the layer is included in a layer group.\n *\n * @param {boolean} [opt_managed] Layer is managed.\n * @return {import(\"./Layer.js\").State} Layer state.\n */\n BaseLayer.prototype.getLayerState = function (opt_managed) {\n /** @type {import(\"./Layer.js\").State} */\n var state = this.state_ ||\n /** @type {?} */ ({\n layer: this,\n managed: opt_managed === undefined ? true : opt_managed,\n });\n var zIndex = this.getZIndex();\n state.opacity = clamp(Math.round(this.getOpacity() * 100) / 100, 0, 1);\n state.sourceState = this.getSourceState();\n state.visible = this.getVisible();\n state.extent = this.getExtent();\n state.zIndex = zIndex === undefined && !state.managed ? Infinity : zIndex;\n state.maxResolution = this.getMaxResolution();\n state.minResolution = Math.max(this.getMinResolution(), 0);\n state.minZoom = this.getMinZoom();\n state.maxZoom = this.getMaxZoom();\n this.state_ = state;\n return state;\n };\n /**\n * @abstract\n * @param {Array} [opt_array] Array of layers (to be\n * modified in place).\n * @return {Array} Array of layers.\n */\n BaseLayer.prototype.getLayersArray = function (opt_array) {\n return abstract();\n };\n /**\n * @abstract\n * @param {Array} [opt_states] Optional list of layer\n * states (to be modified in place).\n * @return {Array} List of layer states.\n */\n BaseLayer.prototype.getLayerStatesArray = function (opt_states) {\n return abstract();\n };\n /**\n * Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it\n * will be visible regardless of extent.\n * @return {import(\"../extent.js\").Extent|undefined} The layer extent.\n * @observable\n * @api\n */\n BaseLayer.prototype.getExtent = function () {\n return /** @type {import(\"../extent.js\").Extent|undefined} */ (this.get(LayerProperty.EXTENT));\n };\n /**\n * Return the maximum resolution of the layer.\n * @return {number} The maximum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMaxResolution = function () {\n return /** @type {number} */ (this.get(LayerProperty.MAX_RESOLUTION));\n };\n /**\n * Return the minimum resolution of the layer.\n * @return {number} The minimum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMinResolution = function () {\n return /** @type {number} */ (this.get(LayerProperty.MIN_RESOLUTION));\n };\n /**\n * Return the minimum zoom level of the layer.\n * @return {number} The minimum zoom level of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMinZoom = function () {\n return /** @type {number} */ (this.get(LayerProperty.MIN_ZOOM));\n };\n /**\n * Return the maximum zoom level of the layer.\n * @return {number} The maximum zoom level of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getMaxZoom = function () {\n return /** @type {number} */ (this.get(LayerProperty.MAX_ZOOM));\n };\n /**\n * Return the opacity of the layer (between 0 and 1).\n * @return {number} The opacity of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getOpacity = function () {\n return /** @type {number} */ (this.get(LayerProperty.OPACITY));\n };\n /**\n * @abstract\n * @return {import(\"../source/State.js\").default} Source state.\n */\n BaseLayer.prototype.getSourceState = function () {\n return abstract();\n };\n /**\n * Return the visibility of the layer (`true` or `false`).\n * @return {boolean} The visibility of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getVisible = function () {\n return /** @type {boolean} */ (this.get(LayerProperty.VISIBLE));\n };\n /**\n * Return the Z-index of the layer, which is used to order layers before\n * rendering. The default Z-index is 0.\n * @return {number} The Z-index of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.getZIndex = function () {\n return /** @type {number} */ (this.get(LayerProperty.Z_INDEX));\n };\n /**\n * Set the extent at which the layer is visible. If `undefined`, the layer\n * will be visible at all extents.\n * @param {import(\"../extent.js\").Extent|undefined} extent The extent of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setExtent = function (extent) {\n this.set(LayerProperty.EXTENT, extent);\n };\n /**\n * Set the maximum resolution at which the layer is visible.\n * @param {number} maxResolution The maximum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMaxResolution = function (maxResolution) {\n this.set(LayerProperty.MAX_RESOLUTION, maxResolution);\n };\n /**\n * Set the minimum resolution at which the layer is visible.\n * @param {number} minResolution The minimum resolution of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMinResolution = function (minResolution) {\n this.set(LayerProperty.MIN_RESOLUTION, minResolution);\n };\n /**\n * Set the maximum zoom (exclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} maxZoom The maximum zoom of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMaxZoom = function (maxZoom) {\n this.set(LayerProperty.MAX_ZOOM, maxZoom);\n };\n /**\n * Set the minimum zoom (inclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} minZoom The minimum zoom of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setMinZoom = function (minZoom) {\n this.set(LayerProperty.MIN_ZOOM, minZoom);\n };\n /**\n * Set the opacity of the layer, allowed values range from 0 to 1.\n * @param {number} opacity The opacity of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setOpacity = function (opacity) {\n assert(typeof opacity === 'number', 64); // Layer opacity must be a number\n this.set(LayerProperty.OPACITY, opacity);\n };\n /**\n * Set the visibility of the layer (`true` or `false`).\n * @param {boolean} visible The visibility of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setVisible = function (visible) {\n this.set(LayerProperty.VISIBLE, visible);\n };\n /**\n * Set Z-index of the layer, which is used to order layers before rendering.\n * The default Z-index is 0.\n * @param {number} zindex The z-index of the layer.\n * @observable\n * @api\n */\n BaseLayer.prototype.setZIndex = function (zindex) {\n this.set(LayerProperty.Z_INDEX, zindex);\n };\n /**\n * Clean up.\n */\n BaseLayer.prototype.disposeInternal = function () {\n if (this.state_) {\n this.state_.layer = null;\n this.state_ = null;\n }\n _super.prototype.disposeInternal.call(this);\n };\n return BaseLayer;\n}(BaseObject));\nexport default BaseLayer;\n//# sourceMappingURL=Base.js.map","/**\n * @module ol/render/EventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered before a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#prerender\n * @api\n */\n PRERENDER: 'prerender',\n /**\n * Triggered after a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n /**\n * Triggered before layers are rendered.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#precompose\n * @api\n */\n PRECOMPOSE: 'precompose',\n /**\n * Triggered after all layers are rendered.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#postcompose\n * @api\n */\n POSTCOMPOSE: 'postcompose',\n /**\n * Triggered when rendering is complete, i.e. all sources and tiles have\n * finished loading for the current viewport, and all tiles are faded in.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#rendercomplete\n * @api\n */\n RENDERCOMPLETE: 'rendercomplete',\n};\n/**\n * @typedef {'postrender'|'precompose'|'postcompose'|'rendercomplete'} MapRenderEventTypes\n */\n/**\n * @typedef {'postrender'|'prerender'} LayerRenderEventTypes\n */\n//# sourceMappingURL=EventType.js.map","/**\n * @module ol/source/State\n */\n/**\n * @enum {string}\n * State of the source, one of 'undefined', 'loading', 'ready' or 'error'.\n */\nexport default {\n UNDEFINED: 'undefined',\n LOADING: 'loading',\n READY: 'ready',\n ERROR: 'error',\n};\n//# sourceMappingURL=State.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Layer\n */\nimport BaseLayer from './Base.js';\nimport EventType from '../events/EventType.js';\nimport LayerProperty from './Property.js';\nimport RenderEventType from '../render/EventType.js';\nimport SourceState from '../source/State.js';\nimport { assert } from '../asserts.js';\nimport { assign } from '../obj.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @typedef {function(import(\"../PluggableMap.js\").FrameState):HTMLElement} RenderFunction\n */\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").CombinedOnSignature} LayerOnSignature\n */\n/**\n * @template {import(\"../source/Source.js\").default} SourceType\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {SourceType} [source] Source for this layer. If not provided to the constructor,\n * the source can be set by calling {@link module:ol/layer/Layer~Layer#setSource layer.setSource(source)} after\n * construction.\n * @property {import(\"../PluggableMap.js\").default} [map] Map.\n * @property {RenderFunction} [render] Render function. Takes the frame state as input and is expected to return an\n * HTML element. Will overwrite the default rendering for the layer.\n * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n/**\n * @typedef {Object} State\n * @property {import(\"./Layer.js\").default} layer Layer.\n * @property {number} opacity Opacity, the value is rounded to two digits to appear after the decimal point.\n * @property {import(\"../source/State.js\").default} sourceState SourceState.\n * @property {boolean} visible Visible.\n * @property {boolean} managed Managed.\n * @property {import(\"../extent.js\").Extent} [extent] Extent.\n * @property {number} zIndex ZIndex.\n * @property {number} maxResolution Maximum resolution.\n * @property {number} minResolution Minimum resolution.\n * @property {number} minZoom Minimum zoom.\n * @property {number} maxZoom Maximum zoom.\n */\n/**\n * @classdesc\n * Base class from which all layer types are derived. This should only be instantiated\n * in the case where a custom layer is be added to the map with a custom `render` function.\n * Such a function can be specified in the `options` object, and is expected to return an HTML element.\n *\n * A visual representation of raster or vector map data.\n * Layers group together those properties that pertain to how the data is to be\n * displayed, irrespective of the source of that data.\n *\n * Layers are usually added to a map with {@link import(\"../PluggableMap.js\").default#addLayer map.addLayer()}. Components\n * like {@link module:ol/interaction/Select~Select} use unmanaged layers\n * internally. These unmanaged layers are associated with the map using\n * {@link module:ol/layer/Layer~Layer#setMap} instead.\n *\n * A generic `change` event is fired when the state of the source changes.\n *\n * Please note that for performance reasons several layers might get rendered to\n * the same HTML element, which will cause {@link import(\"../PluggableMap.js\").default#forEachLayerAtPixel map.forEachLayerAtPixel()} to\n * give false positives. To avoid this, apply different `className` properties to the\n * layers at creation time.\n *\n * @fires import(\"../render/Event.js\").RenderEvent#prerender\n * @fires import(\"../render/Event.js\").RenderEvent#postrender\n *\n * @template {import(\"../source/Source.js\").default} SourceType\n * @api\n */\nvar Layer = /** @class */ (function (_super) {\n __extends(Layer, _super);\n /**\n * @param {Options} options Layer options.\n */\n function Layer(options) {\n var _this = this;\n var baseOptions = assign({}, options);\n delete baseOptions.source;\n _this = _super.call(this, baseOptions) || this;\n /***\n * @type {LayerOnSignature}\n */\n _this.on;\n /***\n * @type {LayerOnSignature}\n */\n _this.once;\n /***\n * @type {LayerOnSignature}\n */\n _this.un;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.mapPrecomposeKey_ = null;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.mapRenderKey_ = null;\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n _this.sourceChangeKey_ = null;\n /**\n * @private\n * @type {import(\"../renderer/Layer.js\").default}\n */\n _this.renderer_ = null;\n // Overwrite default render method with a custom one\n if (options.render) {\n _this.render = options.render;\n }\n if (options.map) {\n _this.setMap(options.map);\n }\n _this.addChangeListener(LayerProperty.SOURCE, _this.handleSourcePropertyChange_);\n var source = options.source\n ? /** @type {SourceType} */ (options.source)\n : null;\n _this.setSource(source);\n return _this;\n }\n /**\n * @param {Array} [opt_array] Array of layers (to be modified in place).\n * @return {Array} Array of layers.\n */\n Layer.prototype.getLayersArray = function (opt_array) {\n var array = opt_array ? opt_array : [];\n array.push(this);\n return array;\n };\n /**\n * @param {Array} [opt_states] Optional list of layer states (to be modified in place).\n * @return {Array} List of layer states.\n */\n Layer.prototype.getLayerStatesArray = function (opt_states) {\n var states = opt_states ? opt_states : [];\n states.push(this.getLayerState());\n return states;\n };\n /**\n * Get the layer source.\n * @return {SourceType} The layer source (or `null` if not yet set).\n * @observable\n * @api\n */\n Layer.prototype.getSource = function () {\n return /** @type {SourceType} */ (this.get(LayerProperty.SOURCE)) || null;\n };\n /**\n * @return {import(\"../source/State.js\").default} Source state.\n */\n Layer.prototype.getSourceState = function () {\n var source = this.getSource();\n return !source ? SourceState.UNDEFINED : source.getState();\n };\n /**\n * @private\n */\n Layer.prototype.handleSourceChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n Layer.prototype.handleSourcePropertyChange_ = function () {\n if (this.sourceChangeKey_) {\n unlistenByKey(this.sourceChangeKey_);\n this.sourceChangeKey_ = null;\n }\n var source = this.getSource();\n if (source) {\n this.sourceChangeKey_ = listen(source, EventType.CHANGE, this.handleSourceChange_, this);\n }\n this.changed();\n };\n /**\n * @param {import(\"../pixel\").Pixel} pixel Pixel.\n * @return {Promise>} Promise that resolves with\n * an array of features.\n */\n Layer.prototype.getFeatures = function (pixel) {\n if (!this.renderer_) {\n return new Promise(function (resolve) { return resolve([]); });\n }\n return this.renderer_.getFeatures(pixel);\n };\n /**\n * In charge to manage the rendering of the layer. One layer type is\n * bounded with one layer renderer.\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @param {HTMLElement} target Target which the renderer may (but need not) use\n * for rendering its content.\n * @return {HTMLElement} The rendered element.\n */\n Layer.prototype.render = function (frameState, target) {\n var layerRenderer = this.getRenderer();\n if (layerRenderer.prepareFrame(frameState)) {\n return layerRenderer.renderFrame(frameState, target);\n }\n };\n /**\n * Sets the layer to be rendered on top of other layers on a map. The map will\n * not manage this layer in its layers collection, and the callback in\n * {@link module:ol/Map~Map#forEachLayerAtPixel} will receive `null` as layer. This\n * is useful for temporary layers. To remove an unmanaged layer from the map,\n * use `#setMap(null)`.\n *\n * To add the layer to a map and have it managed by the map, use\n * {@link module:ol/Map~Map#addLayer} instead.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @api\n */\n Layer.prototype.setMap = function (map) {\n if (this.mapPrecomposeKey_) {\n unlistenByKey(this.mapPrecomposeKey_);\n this.mapPrecomposeKey_ = null;\n }\n if (!map) {\n this.changed();\n }\n if (this.mapRenderKey_) {\n unlistenByKey(this.mapRenderKey_);\n this.mapRenderKey_ = null;\n }\n if (map) {\n this.mapPrecomposeKey_ = listen(map, RenderEventType.PRECOMPOSE, function (evt) {\n var renderEvent = \n /** @type {import(\"../render/Event.js\").default} */ (evt);\n var layerStatesArray = renderEvent.frameState.layerStatesArray;\n var layerState = this.getLayerState(false);\n // A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.\n assert(!layerStatesArray.some(function (arrayLayerState) {\n return arrayLayerState.layer === layerState.layer;\n }), 67);\n layerStatesArray.push(layerState);\n }, this);\n this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map);\n this.changed();\n }\n };\n /**\n * Set the layer source.\n * @param {SourceType} source The layer source.\n * @observable\n * @api\n */\n Layer.prototype.setSource = function (source) {\n this.set(LayerProperty.SOURCE, source);\n };\n /**\n * Get the renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} The layer renderer.\n */\n Layer.prototype.getRenderer = function () {\n if (!this.renderer_) {\n this.renderer_ = this.createRenderer();\n }\n return this.renderer_;\n };\n /**\n * @return {boolean} The layer has a renderer.\n */\n Layer.prototype.hasRenderer = function () {\n return !!this.renderer_;\n };\n /**\n * Create a renderer for this layer.\n * @return {import(\"../renderer/Layer.js\").default} A layer renderer.\n * @protected\n */\n Layer.prototype.createRenderer = function () {\n return null;\n };\n /**\n * Clean up.\n */\n Layer.prototype.disposeInternal = function () {\n this.setSource(null);\n _super.prototype.disposeInternal.call(this);\n };\n return Layer;\n}(BaseLayer));\n/**\n * Return `true` if the layer is visible and if the provided view state\n * has resolution and zoom levels that are in range of the layer's min/max.\n * @param {State} layerState Layer state.\n * @param {import(\"../View.js\").State} viewState View state.\n * @return {boolean} The layer is visible at the given view state.\n */\nexport function inView(layerState, viewState) {\n if (!layerState.visible) {\n return false;\n }\n var resolution = viewState.resolution;\n if (resolution < layerState.minResolution ||\n resolution >= layerState.maxResolution) {\n return false;\n }\n var zoom = viewState.zoom;\n return zoom > layerState.minZoom && zoom <= layerState.maxZoom;\n}\nexport default Layer;\n//# sourceMappingURL=Layer.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/Map\n */\nimport Disposable from '../Disposable.js';\nimport { TRUE } from '../functions.js';\nimport { abstract } from '../util.js';\nimport { compose as composeTransform, makeInverse } from '../transform.js';\nimport { getWidth } from '../extent.js';\nimport { shared as iconImageCache } from '../style/IconImageCache.js';\nimport { inView } from '../layer/Layer.js';\nimport { wrapX } from '../coordinate.js';\n/**\n * @typedef HitMatch\n * @property {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @property {import(\"../layer/Layer.js\").default} layer Layer.\n * @property {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @property {number} distanceSq Squared distance.\n * @property {import(\"./vector.js\").FeatureCallback} callback Callback.\n * @template T\n */\n/**\n * @abstract\n */\nvar MapRenderer = /** @class */ (function (_super) {\n __extends(MapRenderer, _super);\n /**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n function MapRenderer(map) {\n var _this = _super.call(this) || this;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = map;\n return _this;\n }\n /**\n * @abstract\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n MapRenderer.prototype.dispatchRenderEvent = function (type, frameState) {\n abstract();\n };\n /**\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @protected\n */\n MapRenderer.prototype.calculateMatrices2D = function (frameState) {\n var viewState = frameState.viewState;\n var coordinateToPixelTransform = frameState.coordinateToPixelTransform;\n var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;\n composeTransform(coordinateToPixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / viewState.resolution, -1 / viewState.resolution, -viewState.rotation, -viewState.center[0], -viewState.center[1]);\n makeInverse(pixelToCoordinateTransform, coordinateToPixelTransform);\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {import(\"./vector.js\").FeatureCallback} callback Feature callback.\n * @param {S} thisArg Value to use as `this` when executing `callback`.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`.\n * @return {T|undefined} Callback result.\n * @template S,T,U\n */\n MapRenderer.prototype.forEachFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, checkWrapped, callback, thisArg, layerFilter, thisArg2) {\n var result;\n var viewState = frameState.viewState;\n /**\n * @param {boolean} managed Managed layer.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @return {T|undefined} Callback result.\n */\n function forEachFeatureAtCoordinate(managed, feature, layer, geometry) {\n return callback.call(thisArg, feature, managed ? layer : null, geometry);\n }\n var projection = viewState.projection;\n var translatedCoordinate = wrapX(coordinate.slice(), projection);\n var offsets = [[0, 0]];\n if (projection.canWrapX() && checkWrapped) {\n var projectionExtent = projection.getExtent();\n var worldWidth = getWidth(projectionExtent);\n offsets.push([-worldWidth, 0], [worldWidth, 0]);\n }\n var layerStates = frameState.layerStatesArray;\n var numLayers = layerStates.length;\n var matches = /** @type {Array>} */ ([]);\n var tmpCoord = [];\n for (var i = 0; i < offsets.length; i++) {\n for (var j = numLayers - 1; j >= 0; --j) {\n var layerState = layerStates[j];\n var layer = layerState.layer;\n if (layer.hasRenderer() &&\n inView(layerState, viewState) &&\n layerFilter.call(thisArg2, layer)) {\n var layerRenderer = layer.getRenderer();\n var source = layer.getSource();\n if (layerRenderer && source) {\n var coordinates = source.getWrapX()\n ? translatedCoordinate\n : coordinate;\n var callback_1 = forEachFeatureAtCoordinate.bind(null, layerState.managed);\n tmpCoord[0] = coordinates[0] + offsets[i][0];\n tmpCoord[1] = coordinates[1] + offsets[i][1];\n result = layerRenderer.forEachFeatureAtCoordinate(tmpCoord, frameState, hitTolerance, callback_1, matches);\n }\n if (result) {\n return result;\n }\n }\n }\n }\n if (matches.length === 0) {\n return undefined;\n }\n var order = 1 / matches.length;\n matches.forEach(function (m, i) { return (m.distanceSq += i * order); });\n matches.sort(function (a, b) { return a.distanceSq - b.distanceSq; });\n matches.some(function (m) {\n return (result = m.callback(m.feature, m.layer, m.geometry));\n });\n return result;\n };\n /**\n * @abstract\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../layer/Layer.js\").default, (Uint8ClampedArray|Uint8Array)): T} callback Layer\n * callback.\n * @param {function(import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @return {T|undefined} Callback result.\n * @template T\n */\n MapRenderer.prototype.forEachLayerAtPixel = function (pixel, frameState, hitTolerance, callback, layerFilter) {\n return abstract();\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg Value to use as `this` when executing `layerFilter`.\n * @return {boolean} Is there a feature at the given coordinate?\n * @template U\n */\n MapRenderer.prototype.hasFeatureAtCoordinate = function (coordinate, frameState, hitTolerance, checkWrapped, layerFilter, thisArg) {\n var hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, TRUE, this, layerFilter, thisArg);\n return hasFeature !== undefined;\n };\n /**\n * @return {import(\"../PluggableMap.js\").default} Map.\n */\n MapRenderer.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Render.\n * @abstract\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n MapRenderer.prototype.renderFrame = function (frameState) {\n abstract();\n };\n /**\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @protected\n */\n MapRenderer.prototype.scheduleExpireIconCache = function (frameState) {\n if (iconImageCache.canExpireCache()) {\n frameState.postRenderFunctions.push(expireIconCache);\n }\n };\n return MapRenderer;\n}(Disposable));\n/**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\nfunction expireIconCache(map, frameState) {\n iconImageCache.expire();\n}\nexport default MapRenderer;\n//# sourceMappingURL=Map.js.map","/**\n * @module ol/render/Event\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport Event from '../events/Event.js';\nvar RenderEvent = /** @class */ (function (_super) {\n __extends(RenderEvent, _super);\n /**\n * @param {import(\"./EventType.js\").default} type Type.\n * @param {import(\"../transform.js\").Transform} [opt_inversePixelTransform] Transform for\n * CSS pixels to rendered pixels.\n * @param {import(\"../PluggableMap.js\").FrameState} [opt_frameState] Frame state.\n * @param {?CanvasRenderingContext2D} [opt_context] Context.\n */\n function RenderEvent(type, opt_inversePixelTransform, opt_frameState, opt_context) {\n var _this = _super.call(this, type) || this;\n /**\n * Transform from CSS pixels (relative to the top-left corner of the map viewport)\n * to rendered pixels on this event's `context`. Only available when a Canvas renderer is used, null otherwise.\n * @type {import(\"../transform.js\").Transform|undefined}\n * @api\n */\n _this.inversePixelTransform = opt_inversePixelTransform;\n /**\n * An object representing the current render frame state.\n * @type {import(\"../PluggableMap.js\").FrameState|undefined}\n * @api\n */\n _this.frameState = opt_frameState;\n /**\n * Canvas context. Not available when the event is dispatched by the map. Only available\n * when a Canvas renderer is used, null otherwise.\n * @type {CanvasRenderingContext2D|null|undefined}\n * @api\n */\n _this.context = opt_context;\n return _this;\n }\n return RenderEvent;\n}(Event));\nexport default RenderEvent;\n//# sourceMappingURL=Event.js.map","/**\n * @module ol/css\n */\n/**\n * @typedef {Object} FontParameters\n * @property {string} style Style.\n * @property {string} variant Variant.\n * @property {string} weight Weight.\n * @property {string} size Size.\n * @property {string} lineHeight LineHeight.\n * @property {string} family Family.\n * @property {Array} families Families.\n */\n/**\n * The CSS class for hidden feature.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_HIDDEN = 'ol-hidden';\n/**\n * The CSS class that we'll give the DOM elements to have them selectable.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_SELECTABLE = 'ol-selectable';\n/**\n * The CSS class that we'll give the DOM elements to have them unselectable.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_UNSELECTABLE = 'ol-unselectable';\n/**\n * The CSS class for unsupported feature.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_UNSUPPORTED = 'ol-unsupported';\n/**\n * The CSS class for controls.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_CONTROL = 'ol-control';\n/**\n * The CSS class that we'll give the DOM elements that are collapsed, i.e.\n * to those elements which usually can be expanded.\n *\n * @const\n * @type {string}\n */\nexport var CLASS_COLLAPSED = 'ol-collapsed';\n/**\n * From https://stackoverflow.com/questions/10135697/regex-to-parse-any-css-font\n * @type {RegExp}\n */\nvar fontRegEx = new RegExp([\n '^\\\\s*(?=(?:(?:[-a-z]+\\\\s*){0,2}(italic|oblique))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(small-caps))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)',\n '(?:(?:normal|\\\\1|\\\\2|\\\\3)\\\\s*){0,3}((?:xx?-)?',\n '(?:small|large)|medium|smaller|larger|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx]))',\n '(?:\\\\s*\\\\/\\\\s*(normal|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx])?))',\n '?\\\\s*([-,\\\\\"\\\\\\'\\\\sa-z]+?)\\\\s*$',\n].join(''), 'i');\nvar fontRegExMatchIndex = [\n 'style',\n 'variant',\n 'weight',\n 'size',\n 'lineHeight',\n 'family',\n];\n/**\n * Get the list of font families from a font spec. Note that this doesn't work\n * for font families that have commas in them.\n * @param {string} fontSpec The CSS font property.\n * @return {FontParameters} The font parameters (or null if the input spec is invalid).\n */\nexport var getFontParameters = function (fontSpec) {\n var match = fontSpec.match(fontRegEx);\n if (!match) {\n return null;\n }\n var style = /** @type {FontParameters} */ ({\n lineHeight: 'normal',\n size: '1.2em',\n style: 'normal',\n weight: 'normal',\n variant: 'normal',\n });\n for (var i = 0, ii = fontRegExMatchIndex.length; i < ii; ++i) {\n var value = match[i + 1];\n if (value !== undefined) {\n style[fontRegExMatchIndex[i]] = value;\n }\n }\n style.families = style.family.split(/,\\s?/);\n return style;\n};\n//# sourceMappingURL=css.js.map","/**\n * @module ol/render/canvas\n */\nimport BaseObject from '../Object.js';\nimport EventTarget from '../events/Target.js';\nimport { WORKER_OFFSCREEN_CANVAS } from '../has.js';\nimport { clear } from '../obj.js';\nimport { createCanvasContext2D } from '../dom.js';\nimport { getFontParameters } from '../css.js';\n/**\n * @typedef {Object} FillState\n * @property {import(\"../colorlike.js\").ColorLike} fillStyle FillStyle.\n */\n/**\n * @typedef Label\n * @property {number} width Width.\n * @property {number} height Height.\n * @property {Array} contextInstructions ContextInstructions.\n */\n/**\n * @typedef {Object} FillStrokeState\n * @property {import(\"../colorlike.js\").ColorLike} [currentFillStyle] Current FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [currentStrokeStyle] Current StrokeStyle.\n * @property {CanvasLineCap} [currentLineCap] Current LineCap.\n * @property {Array} currentLineDash Current LineDash.\n * @property {number} [currentLineDashOffset] Current LineDashOffset.\n * @property {CanvasLineJoin} [currentLineJoin] Current LineJoin.\n * @property {number} [currentLineWidth] Current LineWidth.\n * @property {number} [currentMiterLimit] Current MiterLimit.\n * @property {number} [lastStroke] Last stroke.\n * @property {import(\"../colorlike.js\").ColorLike} [fillStyle] FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [strokeStyle] StrokeStyle.\n * @property {CanvasLineCap} [lineCap] LineCap.\n * @property {Array} lineDash LineDash.\n * @property {number} [lineDashOffset] LineDashOffset.\n * @property {CanvasLineJoin} [lineJoin] LineJoin.\n * @property {number} [lineWidth] LineWidth.\n * @property {number} [miterLimit] MiterLimit.\n */\n/**\n * @typedef {Object} StrokeState\n * @property {CanvasLineCap} lineCap LineCap.\n * @property {Array} lineDash LineDash.\n * @property {number} lineDashOffset LineDashOffset.\n * @property {CanvasLineJoin} lineJoin LineJoin.\n * @property {number} lineWidth LineWidth.\n * @property {number} miterLimit MiterLimit.\n * @property {import(\"../colorlike.js\").ColorLike} strokeStyle StrokeStyle.\n */\n/**\n * @typedef {Object} TextState\n * @property {string} font Font.\n * @property {string} [textAlign] TextAlign.\n * @property {string} textBaseline TextBaseline.\n * @property {string} [placement] Placement.\n * @property {number} [maxAngle] MaxAngle.\n * @property {boolean} [overflow] Overflow.\n * @property {import(\"../style/Fill.js\").default} [backgroundFill] BackgroundFill.\n * @property {import(\"../style/Stroke.js\").default} [backgroundStroke] BackgroundStroke.\n * @property {import(\"../size.js\").Size} [scale] Scale.\n * @property {Array} [padding] Padding.\n */\n/**\n * @typedef {Object} SerializableInstructions\n * @property {Array<*>} instructions The rendering instructions.\n * @property {Array<*>} hitDetectionInstructions The rendering hit detection instructions.\n * @property {Array} coordinates The array of all coordinates.\n * @property {!Object} [textStates] The text states (decluttering).\n * @property {!Object} [fillStates] The fill states (decluttering).\n * @property {!Object} [strokeStates] The stroke states (decluttering).\n */\n/**\n * @typedef {Object} DeclutterImageWithText\n */\n/**\n * @const\n * @type {string}\n */\nexport var defaultFont = '10px sans-serif';\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nexport var defaultFillStyle = '#000';\n/**\n * @const\n * @type {CanvasLineCap}\n */\nexport var defaultLineCap = 'round';\n/**\n * @const\n * @type {Array}\n */\nexport var defaultLineDash = [];\n/**\n * @const\n * @type {number}\n */\nexport var defaultLineDashOffset = 0;\n/**\n * @const\n * @type {CanvasLineJoin}\n */\nexport var defaultLineJoin = 'round';\n/**\n * @const\n * @type {number}\n */\nexport var defaultMiterLimit = 10;\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nexport var defaultStrokeStyle = '#000';\n/**\n * @const\n * @type {string}\n */\nexport var defaultTextAlign = 'center';\n/**\n * @const\n * @type {string}\n */\nexport var defaultTextBaseline = 'middle';\n/**\n * @const\n * @type {Array}\n */\nexport var defaultPadding = [0, 0, 0, 0];\n/**\n * @const\n * @type {number}\n */\nexport var defaultLineWidth = 1;\n/**\n * @type {BaseObject}\n */\nexport var checkedFonts = new BaseObject();\n/**\n * The label cache for text rendering. To change the default cache size of 2048\n * entries, use {@link module:ol/structs/LRUCache~LRUCache#setSize cache.setSize()}.\n * Deprecated - there is no label cache any more.\n * @type {?}\n * @api\n * @deprecated\n */\nexport var labelCache = new EventTarget();\nlabelCache.setSize = function () {\n console.warn('labelCache is deprecated.'); //eslint-disable-line\n};\n/**\n * @type {CanvasRenderingContext2D}\n */\nvar measureContext = null;\n/**\n * @type {string}\n */\nvar measureFont;\n/**\n * @type {!Object}\n */\nexport var textHeights = {};\n/**\n * Clears the label cache when a font becomes available.\n * @param {string} fontSpec CSS font spec.\n */\nexport var registerFont = (function () {\n var retries = 100;\n var size = '32px ';\n var referenceFonts = ['monospace', 'serif'];\n var len = referenceFonts.length;\n var text = 'wmytzilWMYTZIL@#/&?$%10\\uF013';\n var interval, referenceWidth;\n /**\n * @param {string} fontStyle Css font-style\n * @param {string} fontWeight Css font-weight\n * @param {*} fontFamily Css font-family\n * @return {boolean} Font with style and weight is available\n */\n function isAvailable(fontStyle, fontWeight, fontFamily) {\n var available = true;\n for (var i = 0; i < len; ++i) {\n var referenceFont = referenceFonts[i];\n referenceWidth = measureTextWidth(fontStyle + ' ' + fontWeight + ' ' + size + referenceFont, text);\n if (fontFamily != referenceFont) {\n var width = measureTextWidth(fontStyle +\n ' ' +\n fontWeight +\n ' ' +\n size +\n fontFamily +\n ',' +\n referenceFont, text);\n // If width and referenceWidth are the same, then the fallback was used\n // instead of the font we wanted, so the font is not available.\n available = available && width != referenceWidth;\n }\n }\n if (available) {\n return true;\n }\n return false;\n }\n function check() {\n var done = true;\n var fonts = checkedFonts.getKeys();\n for (var i = 0, ii = fonts.length; i < ii; ++i) {\n var font = fonts[i];\n if (checkedFonts.get(font) < retries) {\n if (isAvailable.apply(this, font.split('\\n'))) {\n clear(textHeights);\n // Make sure that loaded fonts are picked up by Safari\n measureContext = null;\n measureFont = undefined;\n checkedFonts.set(font, retries);\n }\n else {\n checkedFonts.set(font, checkedFonts.get(font) + 1, true);\n done = false;\n }\n }\n }\n if (done) {\n clearInterval(interval);\n interval = undefined;\n }\n }\n return function (fontSpec) {\n var font = getFontParameters(fontSpec);\n if (!font) {\n return;\n }\n var families = font.families;\n for (var i = 0, ii = families.length; i < ii; ++i) {\n var family = families[i];\n var key = font.style + '\\n' + font.weight + '\\n' + family;\n if (checkedFonts.get(key) === undefined) {\n checkedFonts.set(key, retries, true);\n if (!isAvailable(font.style, font.weight, family)) {\n checkedFonts.set(key, 0, true);\n if (interval === undefined) {\n interval = setInterval(check, 32);\n }\n }\n }\n }\n };\n})();\n/**\n * @param {string} font Font to use for measuring.\n * @return {import(\"../size.js\").Size} Measurement.\n */\nexport var measureTextHeight = (function () {\n /**\n * @type {HTMLDivElement}\n */\n var measureElement;\n return function (fontSpec) {\n var height = textHeights[fontSpec];\n if (height == undefined) {\n if (WORKER_OFFSCREEN_CANVAS) {\n var font = getFontParameters(fontSpec);\n var metrics = measureText(fontSpec, 'Žg');\n var lineHeight = isNaN(Number(font.lineHeight))\n ? 1.2\n : Number(font.lineHeight);\n height =\n lineHeight *\n (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);\n }\n else {\n if (!measureElement) {\n measureElement = document.createElement('div');\n measureElement.innerHTML = 'M';\n measureElement.style.minHeight = '0';\n measureElement.style.maxHeight = 'none';\n measureElement.style.height = 'auto';\n measureElement.style.padding = '0';\n measureElement.style.border = 'none';\n measureElement.style.position = 'absolute';\n measureElement.style.display = 'block';\n measureElement.style.left = '-99999px';\n }\n measureElement.style.font = fontSpec;\n document.body.appendChild(measureElement);\n height = measureElement.offsetHeight;\n document.body.removeChild(measureElement);\n }\n textHeights[fontSpec] = height;\n }\n return height;\n };\n})();\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {TextMetrics} Text metrics.\n */\nfunction measureText(font, text) {\n if (!measureContext) {\n measureContext = createCanvasContext2D(1, 1);\n }\n if (font != measureFont) {\n measureContext.font = font;\n measureFont = measureContext.font;\n }\n return measureContext.measureText(text);\n}\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {number} Width.\n */\nexport function measureTextWidth(font, text) {\n return measureText(font, text).width;\n}\n/**\n * Measure text width using a cache.\n * @param {string} font The font.\n * @param {string} text The text to measure.\n * @param {Object} cache A lookup of cached widths by text.\n * @return {number} The text width.\n */\nexport function measureAndCacheTextWidth(font, text, cache) {\n if (text in cache) {\n return cache[text];\n }\n var width = measureTextWidth(font, text);\n cache[text] = width;\n return width;\n}\n/**\n * @param {string} font Font to use for measuring.\n * @param {Array} lines Lines to measure.\n * @param {Array} widths Array will be populated with the widths of\n * each line.\n * @return {number} Width of the whole text.\n */\nexport function measureTextWidths(font, lines, widths) {\n var numLines = lines.length;\n var width = 0;\n for (var i = 0; i < numLines; ++i) {\n var currentWidth = measureTextWidth(font, lines[i]);\n width = Math.max(width, currentWidth);\n widths.push(currentWidth);\n }\n return width;\n}\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} rotation Rotation.\n * @param {number} offsetX X offset.\n * @param {number} offsetY Y offset.\n */\nexport function rotateAtOffset(context, rotation, offsetX, offsetY) {\n if (rotation !== 0) {\n context.translate(offsetX, offsetY);\n context.rotate(rotation);\n context.translate(-offsetX, -offsetY);\n }\n}\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../transform.js\").Transform|null} transform Transform.\n * @param {number} opacity Opacity.\n * @param {Label|HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} labelOrImage Label.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} w Width.\n * @param {number} h Height.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../size.js\").Size} scale Scale.\n */\nexport function drawImageOrLabel(context, transform, opacity, labelOrImage, originX, originY, w, h, x, y, scale) {\n context.save();\n if (opacity !== 1) {\n context.globalAlpha *= opacity;\n }\n if (transform) {\n context.setTransform.apply(context, transform);\n }\n if ( /** @type {*} */(labelOrImage).contextInstructions) {\n // label\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n executeLabelInstructions(/** @type {Label} */ (labelOrImage), context);\n }\n else if (scale[0] < 0 || scale[1] < 0) {\n // flipped image\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n context.drawImage(\n /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage), originX, originY, w, h, 0, 0, w, h);\n }\n else {\n // if image not flipped translate and scale can be avoided\n context.drawImage(\n /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage), originX, originY, w, h, x, y, w * scale[0], h * scale[1]);\n }\n context.restore();\n}\n/**\n * @param {Label} label Label.\n * @param {CanvasRenderingContext2D} context Context.\n */\nfunction executeLabelInstructions(label, context) {\n var contextInstructions = label.contextInstructions;\n for (var i = 0, ii = contextInstructions.length; i < ii; i += 2) {\n if (Array.isArray(contextInstructions[i + 1])) {\n context[contextInstructions[i]].apply(context, contextInstructions[i + 1]);\n }\n else {\n context[contextInstructions[i]] = contextInstructions[i + 1];\n }\n }\n}\n//# sourceMappingURL=canvas.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/renderer/Composite\n */\nimport MapRenderer from './Map.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport RenderEvent from '../render/Event.js';\nimport RenderEventType from '../render/EventType.js';\nimport SourceState from '../source/State.js';\nimport { CLASS_UNSELECTABLE } from '../css.js';\nimport { checkedFonts } from '../render/canvas.js';\nimport { inView } from '../layer/Layer.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport { replaceChildren } from '../dom.js';\n/**\n * @classdesc\n * Canvas map renderer.\n * @api\n */\nvar CompositeMapRenderer = /** @class */ (function (_super) {\n __extends(CompositeMapRenderer, _super);\n /**\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n function CompositeMapRenderer(map) {\n var _this = _super.call(this, map) || this;\n /**\n * @type {import(\"../events.js\").EventsKey}\n */\n _this.fontChangeListenerKey_ = listen(checkedFonts, ObjectEventType.PROPERTYCHANGE, map.redrawText.bind(map));\n /**\n * @private\n * @type {HTMLDivElement}\n */\n _this.element_ = document.createElement('div');\n var style = _this.element_.style;\n style.position = 'absolute';\n style.width = '100%';\n style.height = '100%';\n style.zIndex = '0';\n _this.element_.className = CLASS_UNSELECTABLE + ' ol-layers';\n var container = map.getViewport();\n container.insertBefore(_this.element_, container.firstChild || null);\n /**\n * @private\n * @type {Array}\n */\n _this.children_ = [];\n /**\n * @private\n * @type {boolean}\n */\n _this.renderedVisible_ = true;\n return _this;\n }\n /**\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n CompositeMapRenderer.prototype.dispatchRenderEvent = function (type, frameState) {\n var map = this.getMap();\n if (map.hasListener(type)) {\n var event_1 = new RenderEvent(type, undefined, frameState);\n map.dispatchEvent(event_1);\n }\n };\n CompositeMapRenderer.prototype.disposeInternal = function () {\n unlistenByKey(this.fontChangeListenerKey_);\n this.element_.parentNode.removeChild(this.element_);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Render.\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n CompositeMapRenderer.prototype.renderFrame = function (frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element_.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n this.calculateMatrices2D(frameState);\n this.dispatchRenderEvent(RenderEventType.PRECOMPOSE, frameState);\n var layerStatesArray = frameState.layerStatesArray.sort(function (a, b) {\n return a.zIndex - b.zIndex;\n });\n var viewState = frameState.viewState;\n this.children_.length = 0;\n /**\n * @type {Array}\n */\n var declutterLayers = [];\n var previousElement = null;\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layerState = layerStatesArray[i];\n frameState.layerIndex = i;\n if (!inView(layerState, viewState) ||\n (layerState.sourceState != SourceState.READY &&\n layerState.sourceState != SourceState.UNDEFINED)) {\n continue;\n }\n var layer = layerState.layer;\n var element = layer.render(frameState, previousElement);\n if (!element) {\n continue;\n }\n if (element !== previousElement) {\n this.children_.push(element);\n previousElement = element;\n }\n if ('getDeclutter' in layer) {\n declutterLayers.push(\n /** @type {import(\"../layer/BaseVector.js\").default} */ (layer));\n }\n }\n for (var i = declutterLayers.length - 1; i >= 0; --i) {\n declutterLayers[i].renderDeclutter(frameState);\n }\n replaceChildren(this.element_, this.children_);\n this.dispatchRenderEvent(RenderEventType.POSTCOMPOSE, frameState);\n if (!this.renderedVisible_) {\n this.element_.style.display = '';\n this.renderedVisible_ = true;\n }\n this.scheduleExpireIconCache(frameState);\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../layer/Layer.js\").default, (Uint8ClampedArray|Uint8Array)): T} callback Layer\n * callback.\n * @param {function(import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @return {T|undefined} Callback result.\n * @template T\n */\n CompositeMapRenderer.prototype.forEachLayerAtPixel = function (pixel, frameState, hitTolerance, callback, layerFilter) {\n var viewState = frameState.viewState;\n var layerStates = frameState.layerStatesArray;\n var numLayers = layerStates.length;\n for (var i = numLayers - 1; i >= 0; --i) {\n var layerState = layerStates[i];\n var layer = layerState.layer;\n if (layer.hasRenderer() &&\n inView(layerState, viewState) &&\n layerFilter(layer)) {\n var layerRenderer = layer.getRenderer();\n var data = layerRenderer.getDataAtPixel(pixel, frameState, hitTolerance);\n if (data) {\n var result = callback(layer, data);\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n };\n return CompositeMapRenderer;\n}(MapRenderer));\nexport default CompositeMapRenderer;\n//# sourceMappingURL=Composite.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/layer/Group\n */\nimport BaseLayer from './Base.js';\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport EventType from '../events/EventType.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport SourceState from '../source/State.js';\nimport { assert } from '../asserts.js';\nimport { assign, clear } from '../obj.js';\nimport { getIntersection } from '../extent.js';\nimport { getUid } from '../util.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @typedef {Object} Options\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {Array|import(\"../Collection.js\").default} [layers] Child layers.\n * @property {Object} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n/**\n * @enum {string}\n * @private\n */\nvar Property = {\n LAYERS: 'layers',\n};\n/**\n * @classdesc\n * A {@link module:ol/Collection~Collection} of layers that are handled together.\n *\n * A generic `change` event is triggered when the group/Collection changes.\n *\n * @api\n */\nvar LayerGroup = /** @class */ (function (_super) {\n __extends(LayerGroup, _super);\n /**\n * @param {Options} [opt_options] Layer options.\n */\n function LayerGroup(opt_options) {\n var _this = this;\n var options = opt_options || {};\n var baseOptions = /** @type {Options} */ (assign({}, options));\n delete baseOptions.layers;\n var layers = options.layers;\n _this = _super.call(this, baseOptions) || this;\n /**\n * @private\n * @type {Array}\n */\n _this.layersListenerKeys_ = [];\n /**\n * @private\n * @type {Object>}\n */\n _this.listenerKeys_ = {};\n _this.addChangeListener(Property.LAYERS, _this.handleLayersChanged_);\n if (layers) {\n if (Array.isArray(layers)) {\n layers = new Collection(layers.slice(), { unique: true });\n }\n else {\n assert(typeof ( /** @type {?} */(layers).getArray) === 'function', 43); // Expected `layers` to be an array or a `Collection`\n }\n }\n else {\n layers = new Collection(undefined, { unique: true });\n }\n _this.setLayers(layers);\n return _this;\n }\n /**\n * @private\n */\n LayerGroup.prototype.handleLayerChange_ = function () {\n this.changed();\n };\n /**\n * @private\n */\n LayerGroup.prototype.handleLayersChanged_ = function () {\n this.layersListenerKeys_.forEach(unlistenByKey);\n this.layersListenerKeys_.length = 0;\n var layers = this.getLayers();\n this.layersListenerKeys_.push(listen(layers, CollectionEventType.ADD, this.handleLayersAdd_, this), listen(layers, CollectionEventType.REMOVE, this.handleLayersRemove_, this));\n for (var id in this.listenerKeys_) {\n this.listenerKeys_[id].forEach(unlistenByKey);\n }\n clear(this.listenerKeys_);\n var layersArray = layers.getArray();\n for (var i = 0, ii = layersArray.length; i < ii; i++) {\n var layer = layersArray[i];\n this.listenerKeys_[getUid(layer)] = [\n listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),\n listen(layer, EventType.CHANGE, this.handleLayerChange_, this),\n ];\n }\n this.changed();\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} collectionEvent CollectionEvent.\n * @private\n */\n LayerGroup.prototype.handleLayersAdd_ = function (collectionEvent) {\n var layer = /** @type {import(\"./Base.js\").default} */ (collectionEvent.element);\n this.listenerKeys_[getUid(layer)] = [\n listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),\n listen(layer, EventType.CHANGE, this.handleLayerChange_, this),\n ];\n this.changed();\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} collectionEvent CollectionEvent.\n * @private\n */\n LayerGroup.prototype.handleLayersRemove_ = function (collectionEvent) {\n var layer = /** @type {import(\"./Base.js\").default} */ (collectionEvent.element);\n var key = getUid(layer);\n this.listenerKeys_[key].forEach(unlistenByKey);\n delete this.listenerKeys_[key];\n this.changed();\n };\n /**\n * Returns the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @return {!import(\"../Collection.js\").default} Collection of\n * {@link module:ol/layer/Base layers} that are part of this group.\n * @observable\n * @api\n */\n LayerGroup.prototype.getLayers = function () {\n return /** @type {!import(\"../Collection.js\").default} */ (this.get(Property.LAYERS));\n };\n /**\n * Set the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @param {!import(\"../Collection.js\").default} layers Collection of\n * {@link module:ol/layer/Base layers} that are part of this group.\n * @observable\n * @api\n */\n LayerGroup.prototype.setLayers = function (layers) {\n this.set(Property.LAYERS, layers);\n };\n /**\n * @param {Array} [opt_array] Array of layers (to be modified in place).\n * @return {Array} Array of layers.\n */\n LayerGroup.prototype.getLayersArray = function (opt_array) {\n var array = opt_array !== undefined ? opt_array : [];\n this.getLayers().forEach(function (layer) {\n layer.getLayersArray(array);\n });\n return array;\n };\n /**\n * Get the layer states list and use this groups z-index as the default\n * for all layers in this and nested groups, if it is unset at this point.\n * If opt_states is not provided and this group's z-index is undefined\n * 0 is used a the default z-index.\n * @param {Array} [opt_states] Optional list\n * of layer states (to be modified in place).\n * @return {Array} List of layer states.\n */\n LayerGroup.prototype.getLayerStatesArray = function (opt_states) {\n var states = opt_states !== undefined ? opt_states : [];\n var pos = states.length;\n this.getLayers().forEach(function (layer) {\n layer.getLayerStatesArray(states);\n });\n var ownLayerState = this.getLayerState();\n var defaultZIndex = ownLayerState.zIndex;\n if (!opt_states && ownLayerState.zIndex === undefined) {\n defaultZIndex = 0;\n }\n for (var i = pos, ii = states.length; i < ii; i++) {\n var layerState = states[i];\n layerState.opacity *= ownLayerState.opacity;\n layerState.visible = layerState.visible && ownLayerState.visible;\n layerState.maxResolution = Math.min(layerState.maxResolution, ownLayerState.maxResolution);\n layerState.minResolution = Math.max(layerState.minResolution, ownLayerState.minResolution);\n layerState.minZoom = Math.max(layerState.minZoom, ownLayerState.minZoom);\n layerState.maxZoom = Math.min(layerState.maxZoom, ownLayerState.maxZoom);\n if (ownLayerState.extent !== undefined) {\n if (layerState.extent !== undefined) {\n layerState.extent = getIntersection(layerState.extent, ownLayerState.extent);\n }\n else {\n layerState.extent = ownLayerState.extent;\n }\n }\n if (layerState.zIndex === undefined) {\n layerState.zIndex = defaultZIndex;\n }\n }\n return states;\n };\n /**\n * @return {import(\"../source/State.js\").default} Source state.\n */\n LayerGroup.prototype.getSourceState = function () {\n return SourceState.READY;\n };\n return LayerGroup;\n}(BaseLayer));\nexport default LayerGroup;\n//# sourceMappingURL=Group.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/MapEvent\n */\nimport Event from './events/Event.js';\n/**\n * @classdesc\n * Events emitted as map events are instances of this type.\n * See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map event.\n */\nvar MapEvent = /** @class */ (function (_super) {\n __extends(MapEvent, _super);\n /**\n * @param {string} type Event type.\n * @param {import(\"./PluggableMap.js\").default} map Map.\n * @param {?import(\"./PluggableMap.js\").FrameState} [opt_frameState] Frame state.\n */\n function MapEvent(type, map, opt_frameState) {\n var _this = _super.call(this, type) || this;\n /**\n * The map where the event occurred.\n * @type {import(\"./PluggableMap.js\").default}\n * @api\n */\n _this.map = map;\n /**\n * The frame state at the time of the event.\n * @type {?import(\"./PluggableMap.js\").FrameState}\n * @api\n */\n _this.frameState = opt_frameState !== undefined ? opt_frameState : null;\n return _this;\n }\n return MapEvent;\n}(Event));\nexport default MapEvent;\n//# sourceMappingURL=MapEvent.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/MapBrowserEvent\n */\nimport MapEvent from './MapEvent.js';\n/**\n * @classdesc\n * Events emitted as map browser events are instances of this type.\n * See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map browser event.\n * @template {UIEvent} EVENT\n */\nvar MapBrowserEvent = /** @class */ (function (_super) {\n __extends(MapBrowserEvent, _super);\n /**\n * @param {string} type Event type.\n * @param {import(\"./PluggableMap.js\").default} map Map.\n * @param {EVENT} originalEvent Original event.\n * @param {boolean} [opt_dragging] Is the map currently being dragged?\n * @param {?import(\"./PluggableMap.js\").FrameState} [opt_frameState] Frame state.\n */\n function MapBrowserEvent(type, map, originalEvent, opt_dragging, opt_frameState) {\n var _this = _super.call(this, type, map, opt_frameState) || this;\n /**\n * The original browser event.\n * @const\n * @type {EVENT}\n * @api\n */\n _this.originalEvent = originalEvent;\n /**\n * The map pixel relative to the viewport corresponding to the original browser event.\n * @type {?import(\"./pixel.js\").Pixel}\n */\n _this.pixel_ = null;\n /**\n * The coordinate in the user projection corresponding to the original browser event.\n * @type {?import(\"./coordinate.js\").Coordinate}\n */\n _this.coordinate_ = null;\n /**\n * Indicates if the map is currently being dragged. Only set for\n * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.\n *\n * @type {boolean}\n * @api\n */\n _this.dragging = opt_dragging !== undefined ? opt_dragging : false;\n return _this;\n }\n Object.defineProperty(MapBrowserEvent.prototype, \"pixel\", {\n /**\n * The map pixel relative to the viewport corresponding to the original event.\n * @type {import(\"./pixel.js\").Pixel}\n * @api\n */\n get: function () {\n if (!this.pixel_) {\n this.pixel_ = this.map.getEventPixel(this.originalEvent);\n }\n return this.pixel_;\n },\n set: function (pixel) {\n this.pixel_ = pixel;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MapBrowserEvent.prototype, \"coordinate\", {\n /**\n * The coordinate corresponding to the original browser event. This will be in the user\n * projection if one is set. Otherwise it will be in the view projection.\n * @type {import(\"./coordinate.js\").Coordinate}\n * @api\n */\n get: function () {\n if (!this.coordinate_) {\n this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel);\n }\n return this.coordinate_;\n },\n set: function (coordinate) {\n this.coordinate_ = coordinate;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Prevents the default browser action.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.\n * @api\n */\n MapBrowserEvent.prototype.preventDefault = function () {\n _super.prototype.preventDefault.call(this);\n if ('preventDefault' in this.originalEvent) {\n /** @type {UIEvent} */ (this.originalEvent).preventDefault();\n }\n };\n /**\n * Prevents further propagation of the current event.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.\n * @api\n */\n MapBrowserEvent.prototype.stopPropagation = function () {\n _super.prototype.stopPropagation.call(this);\n if ('stopPropagation' in this.originalEvent) {\n /** @type {UIEvent} */ (this.originalEvent).stopPropagation();\n }\n };\n return MapBrowserEvent;\n}(MapEvent));\nexport default MapBrowserEvent;\n//# sourceMappingURL=MapBrowserEvent.js.map","/**\n * @module ol/MapBrowserEventType\n */\nimport EventType from './events/EventType.js';\n/**\n * Constants for event names.\n * @enum {string}\n */\nexport default {\n /**\n * A true single click with no dragging and no double click. Note that this\n * event is delayed by 250 ms to ensure that it is not a double click.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick\n * @api\n */\n SINGLECLICK: 'singleclick',\n /**\n * A click with no dragging. A double click will fire two of this.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#click\n * @api\n */\n CLICK: EventType.CLICK,\n /**\n * A true double click, with no dragging.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick\n * @api\n */\n DBLCLICK: EventType.DBLCLICK,\n /**\n * Triggered when a pointer is dragged.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag\n * @api\n */\n POINTERDRAG: 'pointerdrag',\n /**\n * Triggered when a pointer is moved. Note that on touch devices this is\n * triggered when the map is panned, so is not the same as mousemove.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove\n * @api\n */\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel',\n};\n/***\n * @typedef {'singleclick'|'click'|'dblclick'|'pointerdrag'|'pointermove'} Types\n */\n//# sourceMappingURL=MapBrowserEventType.js.map","/**\n * @module ol/pointer/EventType\n */\n/**\n * Constants for event names.\n * @enum {string}\n */\nexport default {\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel',\n};\n//# sourceMappingURL=EventType.js.map","/**\n * @module ol/MapBrowserEventHandler\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport EventType from './events/EventType.js';\nimport MapBrowserEvent from './MapBrowserEvent.js';\nimport MapBrowserEventType from './MapBrowserEventType.js';\nimport PointerEventType from './pointer/EventType.js';\nimport Target from './events/Target.js';\nimport { PASSIVE_EVENT_LISTENERS } from './has.js';\nimport { VOID } from './functions.js';\nimport { listen, unlistenByKey } from './events.js';\nvar MapBrowserEventHandler = /** @class */ (function (_super) {\n __extends(MapBrowserEventHandler, _super);\n /**\n * @param {import(\"./PluggableMap.js\").default} map The map with the viewport to listen to events on.\n * @param {number} [moveTolerance] The minimal distance the pointer must travel to trigger a move.\n */\n function MapBrowserEventHandler(map, moveTolerance) {\n var _this = _super.call(this, map) || this;\n /**\n * This is the element that we will listen to the real events on.\n * @type {import(\"./PluggableMap.js\").default}\n * @private\n */\n _this.map_ = map;\n /**\n * @type {any}\n * @private\n */\n _this.clickTimeoutId_;\n /**\n * Emulate dblclick and singleclick. Will be true when only one pointer is active.\n * @type {boolean}\n */\n _this.emulateClicks_ = false;\n /**\n * @type {boolean}\n * @private\n */\n _this.dragging_ = false;\n /**\n * @type {!Array}\n * @private\n */\n _this.dragListenerKeys_ = [];\n /**\n * @type {number}\n * @private\n */\n _this.moveTolerance_ = moveTolerance === undefined ? 1 : moveTolerance;\n /**\n * The most recent \"down\" type event (or null if none have occurred).\n * Set on pointerdown.\n * @type {PointerEvent}\n * @private\n */\n _this.down_ = null;\n var element = _this.map_.getViewport();\n /**\n * @type {number}\n * @private\n */\n _this.activePointers_ = 0;\n /**\n * @type {!Object}\n * @private\n */\n _this.trackedTouches_ = {};\n _this.element_ = element;\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n _this.pointerdownListenerKey_ = listen(element, PointerEventType.POINTERDOWN, _this.handlePointerDown_, _this);\n /**\n * @type {PointerEvent}\n * @private\n */\n _this.originalPointerMoveEvent_;\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n _this.relayedListenerKey_ = listen(element, PointerEventType.POINTERMOVE, _this.relayEvent_, _this);\n /**\n * @private\n */\n _this.boundHandleTouchMove_ = _this.handleTouchMove_.bind(_this);\n _this.element_.addEventListener(EventType.TOUCHMOVE, _this.boundHandleTouchMove_, PASSIVE_EVENT_LISTENERS ? { passive: false } : false);\n return _this;\n }\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.emulateClick_ = function (pointerEvent) {\n var newEvent = new MapBrowserEvent(MapBrowserEventType.CLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n if (this.clickTimeoutId_ !== undefined) {\n // double-click\n clearTimeout(this.clickTimeoutId_);\n this.clickTimeoutId_ = undefined;\n newEvent = new MapBrowserEvent(MapBrowserEventType.DBLCLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n }\n else {\n // click\n this.clickTimeoutId_ = setTimeout(\n /** @this {MapBrowserEventHandler} */\n function () {\n this.clickTimeoutId_ = undefined;\n var newEvent = new MapBrowserEvent(MapBrowserEventType.SINGLECLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n }.bind(this), 250);\n }\n };\n /**\n * Keeps track on how many pointers are currently active.\n *\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.updateActivePointers_ = function (pointerEvent) {\n var event = pointerEvent;\n if (event.type == MapBrowserEventType.POINTERUP ||\n event.type == MapBrowserEventType.POINTERCANCEL) {\n delete this.trackedTouches_[event.pointerId];\n }\n else if (event.type == MapBrowserEventType.POINTERDOWN) {\n this.trackedTouches_[event.pointerId] = true;\n }\n this.activePointers_ = Object.keys(this.trackedTouches_).length;\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerUp_ = function (pointerEvent) {\n this.updateActivePointers_(pointerEvent);\n var newEvent = new MapBrowserEvent(MapBrowserEventType.POINTERUP, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n // We emulate click events on left mouse button click, touch contact, and pen\n // contact. isMouseActionButton returns true in these cases (evt.button is set\n // to 0).\n // See http://www.w3.org/TR/pointerevents/#button-states\n // We only fire click, singleclick, and doubleclick if nobody has called\n // event.preventDefault().\n if (this.emulateClicks_ &&\n !newEvent.defaultPrevented &&\n !this.dragging_ &&\n this.isMouseActionButton_(pointerEvent)) {\n this.emulateClick_(this.down_);\n }\n if (this.activePointers_ === 0) {\n this.dragListenerKeys_.forEach(unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.dragging_ = false;\n this.down_ = null;\n }\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} If the left mouse button was pressed.\n * @private\n */\n MapBrowserEventHandler.prototype.isMouseActionButton_ = function (pointerEvent) {\n return pointerEvent.button === 0;\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerDown_ = function (pointerEvent) {\n this.emulateClicks_ = this.activePointers_ === 0;\n this.updateActivePointers_(pointerEvent);\n var newEvent = new MapBrowserEvent(MapBrowserEventType.POINTERDOWN, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n // Store a copy of the down event\n this.down_ = /** @type {PointerEvent} */ ({});\n for (var property in pointerEvent) {\n var value = pointerEvent[property];\n this.down_[property] = typeof value === 'function' ? VOID : value;\n }\n if (this.dragListenerKeys_.length === 0) {\n var doc = this.map_.getOwnerDocument();\n this.dragListenerKeys_.push(listen(doc, MapBrowserEventType.POINTERMOVE, this.handlePointerMove_, this), listen(doc, MapBrowserEventType.POINTERUP, this.handlePointerUp_, this), \n /* Note that the listener for `pointercancel is set up on\n * `pointerEventHandler_` and not `documentPointerEventHandler_` like\n * the `pointerup` and `pointermove` listeners.\n *\n * The reason for this is the following: `TouchSource.vacuumTouches_()`\n * issues `pointercancel` events, when there was no `touchend` for a\n * `touchstart`. Now, let's say a first `touchstart` is registered on\n * `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.\n * But `documentPointerEventHandler_` doesn't know about the first\n * `touchstart`. If there is no `touchend` for the `touchstart`, we can\n * only receive a `touchcancel` from `pointerEventHandler_`, because it is\n * only registered there.\n */\n listen(this.element_, MapBrowserEventType.POINTERCANCEL, this.handlePointerUp_, this));\n if (this.element_.getRootNode && this.element_.getRootNode() !== doc) {\n this.dragListenerKeys_.push(listen(this.element_.getRootNode(), MapBrowserEventType.POINTERUP, this.handlePointerUp_, this));\n }\n }\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.handlePointerMove_ = function (pointerEvent) {\n // Between pointerdown and pointerup, pointermove events are triggered.\n // To avoid a 'false' touchmove event to be dispatched, we test if the pointer\n // moved a significant distance.\n if (this.isMoving_(pointerEvent)) {\n this.dragging_ = true;\n var newEvent = new MapBrowserEvent(MapBrowserEventType.POINTERDRAG, this.map_, pointerEvent, this.dragging_);\n this.dispatchEvent(newEvent);\n }\n };\n /**\n * Wrap and relay a pointer event. Note that this requires that the type\n * string for the MapBrowserEvent matches the PointerEvent type.\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n MapBrowserEventHandler.prototype.relayEvent_ = function (pointerEvent) {\n this.originalPointerMoveEvent_ = pointerEvent;\n var dragging = !!(this.down_ && this.isMoving_(pointerEvent));\n this.dispatchEvent(new MapBrowserEvent(pointerEvent.type, this.map_, pointerEvent, dragging));\n };\n /**\n * Flexible handling of a `touch-action: none` css equivalent: because calling\n * `preventDefault()` on a `pointermove` event does not stop native page scrolling\n * and zooming, we also listen for `touchmove` and call `preventDefault()` on it\n * when an interaction (currently `DragPan` handles the event.\n * @param {TouchEvent} event Event.\n * @private\n */\n MapBrowserEventHandler.prototype.handleTouchMove_ = function (event) {\n // Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`\n // may not be initialized yet when we get here on a platform without native pointer events.\n var originalEvent = this.originalPointerMoveEvent_;\n if ((!originalEvent || originalEvent.defaultPrevented) &&\n (typeof event.cancelable !== 'boolean' || event.cancelable === true)) {\n event.preventDefault();\n }\n };\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} Is moving.\n * @private\n */\n MapBrowserEventHandler.prototype.isMoving_ = function (pointerEvent) {\n return (this.dragging_ ||\n Math.abs(pointerEvent.clientX - this.down_.clientX) >\n this.moveTolerance_ ||\n Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_);\n };\n /**\n * Clean up.\n */\n MapBrowserEventHandler.prototype.disposeInternal = function () {\n if (this.relayedListenerKey_) {\n unlistenByKey(this.relayedListenerKey_);\n this.relayedListenerKey_ = null;\n }\n this.element_.removeEventListener(EventType.TOUCHMOVE, this.boundHandleTouchMove_);\n if (this.pointerdownListenerKey_) {\n unlistenByKey(this.pointerdownListenerKey_);\n this.pointerdownListenerKey_ = null;\n }\n this.dragListenerKeys_.forEach(unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.element_ = null;\n _super.prototype.disposeInternal.call(this);\n };\n return MapBrowserEventHandler;\n}(Target));\nexport default MapBrowserEventHandler;\n//# sourceMappingURL=MapBrowserEventHandler.js.map","/**\n * @module ol/MapEventType\n */\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered after a map frame is rendered.\n * @event module:ol/MapEvent~MapEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n /**\n * Triggered when the map starts moving.\n * @event module:ol/MapEvent~MapEvent#movestart\n * @api\n */\n MOVESTART: 'movestart',\n /**\n * Triggered after the map is moved.\n * @event module:ol/MapEvent~MapEvent#moveend\n * @api\n */\n MOVEEND: 'moveend',\n};\n/***\n * @typedef {'postrender'|'movestart'|'moveend'} Types\n */\n//# sourceMappingURL=MapEventType.js.map","/**\n * @module ol/MapProperty\n */\n/**\n * @enum {string}\n */\nexport default {\n LAYERGROUP: 'layergroup',\n SIZE: 'size',\n TARGET: 'target',\n VIEW: 'view',\n};\n//# sourceMappingURL=MapProperty.js.map","/**\n * @module ol/structs/PriorityQueue\n */\nimport { assert } from '../asserts.js';\nimport { clear } from '../obj.js';\n/**\n * @type {number}\n */\nexport var DROP = Infinity;\n/**\n * @classdesc\n * Priority queue.\n *\n * The implementation is inspired from the Closure Library's Heap class and\n * Python's heapq module.\n *\n * See https://github.com/google/closure-library/blob/master/closure/goog/structs/heap.js\n * and https://hg.python.org/cpython/file/2.7/Lib/heapq.py.\n *\n * @template T\n */\nvar PriorityQueue = /** @class */ (function () {\n /**\n * @param {function(T): number} priorityFunction Priority function.\n * @param {function(T): string} keyFunction Key function.\n */\n function PriorityQueue(priorityFunction, keyFunction) {\n /**\n * @type {function(T): number}\n * @private\n */\n this.priorityFunction_ = priorityFunction;\n /**\n * @type {function(T): string}\n * @private\n */\n this.keyFunction_ = keyFunction;\n /**\n * @type {Array}\n * @private\n */\n this.elements_ = [];\n /**\n * @type {Array}\n * @private\n */\n this.priorities_ = [];\n /**\n * @type {!Object}\n * @private\n */\n this.queuedElements_ = {};\n }\n /**\n * FIXME empty description for jsdoc\n */\n PriorityQueue.prototype.clear = function () {\n this.elements_.length = 0;\n this.priorities_.length = 0;\n clear(this.queuedElements_);\n };\n /**\n * Remove and return the highest-priority element. O(log N).\n * @return {T} Element.\n */\n PriorityQueue.prototype.dequeue = function () {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var element = elements[0];\n if (elements.length == 1) {\n elements.length = 0;\n priorities.length = 0;\n }\n else {\n elements[0] = elements.pop();\n priorities[0] = priorities.pop();\n this.siftUp_(0);\n }\n var elementKey = this.keyFunction_(element);\n delete this.queuedElements_[elementKey];\n return element;\n };\n /**\n * Enqueue an element. O(log N).\n * @param {T} element Element.\n * @return {boolean} The element was added to the queue.\n */\n PriorityQueue.prototype.enqueue = function (element) {\n assert(!(this.keyFunction_(element) in this.queuedElements_), 31); // Tried to enqueue an `element` that was already added to the queue\n var priority = this.priorityFunction_(element);\n if (priority != DROP) {\n this.elements_.push(element);\n this.priorities_.push(priority);\n this.queuedElements_[this.keyFunction_(element)] = true;\n this.siftDown_(0, this.elements_.length - 1);\n return true;\n }\n return false;\n };\n /**\n * @return {number} Count.\n */\n PriorityQueue.prototype.getCount = function () {\n return this.elements_.length;\n };\n /**\n * Gets the index of the left child of the node at the given index.\n * @param {number} index The index of the node to get the left child for.\n * @return {number} The index of the left child.\n * @private\n */\n PriorityQueue.prototype.getLeftChildIndex_ = function (index) {\n return index * 2 + 1;\n };\n /**\n * Gets the index of the right child of the node at the given index.\n * @param {number} index The index of the node to get the right child for.\n * @return {number} The index of the right child.\n * @private\n */\n PriorityQueue.prototype.getRightChildIndex_ = function (index) {\n return index * 2 + 2;\n };\n /**\n * Gets the index of the parent of the node at the given index.\n * @param {number} index The index of the node to get the parent for.\n * @return {number} The index of the parent.\n * @private\n */\n PriorityQueue.prototype.getParentIndex_ = function (index) {\n return (index - 1) >> 1;\n };\n /**\n * Make this a heap. O(N).\n * @private\n */\n PriorityQueue.prototype.heapify_ = function () {\n var i;\n for (i = (this.elements_.length >> 1) - 1; i >= 0; i--) {\n this.siftUp_(i);\n }\n };\n /**\n * @return {boolean} Is empty.\n */\n PriorityQueue.prototype.isEmpty = function () {\n return this.elements_.length === 0;\n };\n /**\n * @param {string} key Key.\n * @return {boolean} Is key queued.\n */\n PriorityQueue.prototype.isKeyQueued = function (key) {\n return key in this.queuedElements_;\n };\n /**\n * @param {T} element Element.\n * @return {boolean} Is queued.\n */\n PriorityQueue.prototype.isQueued = function (element) {\n return this.isKeyQueued(this.keyFunction_(element));\n };\n /**\n * @param {number} index The index of the node to move down.\n * @private\n */\n PriorityQueue.prototype.siftUp_ = function (index) {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var count = elements.length;\n var element = elements[index];\n var priority = priorities[index];\n var startIndex = index;\n while (index < count >> 1) {\n var lIndex = this.getLeftChildIndex_(index);\n var rIndex = this.getRightChildIndex_(index);\n var smallerChildIndex = rIndex < count && priorities[rIndex] < priorities[lIndex]\n ? rIndex\n : lIndex;\n elements[index] = elements[smallerChildIndex];\n priorities[index] = priorities[smallerChildIndex];\n index = smallerChildIndex;\n }\n elements[index] = element;\n priorities[index] = priority;\n this.siftDown_(startIndex, index);\n };\n /**\n * @param {number} startIndex The index of the root.\n * @param {number} index The index of the node to move up.\n * @private\n */\n PriorityQueue.prototype.siftDown_ = function (startIndex, index) {\n var elements = this.elements_;\n var priorities = this.priorities_;\n var element = elements[index];\n var priority = priorities[index];\n while (index > startIndex) {\n var parentIndex = this.getParentIndex_(index);\n if (priorities[parentIndex] > priority) {\n elements[index] = elements[parentIndex];\n priorities[index] = priorities[parentIndex];\n index = parentIndex;\n }\n else {\n break;\n }\n }\n elements[index] = element;\n priorities[index] = priority;\n };\n /**\n * FIXME empty description for jsdoc\n */\n PriorityQueue.prototype.reprioritize = function () {\n var priorityFunction = this.priorityFunction_;\n var elements = this.elements_;\n var priorities = this.priorities_;\n var index = 0;\n var n = elements.length;\n var element, i, priority;\n for (i = 0; i < n; ++i) {\n element = elements[i];\n priority = priorityFunction(element);\n if (priority == DROP) {\n delete this.queuedElements_[this.keyFunction_(element)];\n }\n else {\n priorities[index] = priority;\n elements[index++] = element;\n }\n }\n elements.length = index;\n priorities.length = index;\n this.heapify_();\n };\n return PriorityQueue;\n}());\nexport default PriorityQueue;\n//# sourceMappingURL=PriorityQueue.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/TileQueue\n */\nimport EventType from './events/EventType.js';\nimport PriorityQueue, { DROP } from './structs/PriorityQueue.js';\nimport TileState from './TileState.js';\n/**\n * @typedef {function(import(\"./Tile.js\").default, string, import(\"./coordinate.js\").Coordinate, number): number} PriorityFunction\n */\nvar TileQueue = /** @class */ (function (_super) {\n __extends(TileQueue, _super);\n /**\n * @param {PriorityFunction} tilePriorityFunction Tile priority function.\n * @param {function(): ?} tileChangeCallback Function called on each tile change event.\n */\n function TileQueue(tilePriorityFunction, tileChangeCallback) {\n var _this = _super.call(this, \n /**\n * @param {Array} element Element.\n * @return {number} Priority.\n */\n function (element) {\n return tilePriorityFunction.apply(null, element);\n }, \n /**\n * @param {Array} element Element.\n * @return {string} Key.\n */\n function (element) {\n return /** @type {import(\"./Tile.js\").default} */ (element[0]).getKey();\n }) || this;\n /** @private */\n _this.boundHandleTileChange_ = _this.handleTileChange.bind(_this);\n /**\n * @private\n * @type {function(): ?}\n */\n _this.tileChangeCallback_ = tileChangeCallback;\n /**\n * @private\n * @type {number}\n */\n _this.tilesLoading_ = 0;\n /**\n * @private\n * @type {!Object}\n */\n _this.tilesLoadingKeys_ = {};\n return _this;\n }\n /**\n * @param {Array} element Element.\n * @return {boolean} The element was added to the queue.\n */\n TileQueue.prototype.enqueue = function (element) {\n var added = _super.prototype.enqueue.call(this, element);\n if (added) {\n var tile = element[0];\n tile.addEventListener(EventType.CHANGE, this.boundHandleTileChange_);\n }\n return added;\n };\n /**\n * @return {number} Number of tiles loading.\n */\n TileQueue.prototype.getTilesLoading = function () {\n return this.tilesLoading_;\n };\n /**\n * @param {import(\"./events/Event.js\").default} event Event.\n * @protected\n */\n TileQueue.prototype.handleTileChange = function (event) {\n var tile = /** @type {import(\"./Tile.js\").default} */ (event.target);\n var state = tile.getState();\n if (state === TileState.LOADED ||\n state === TileState.ERROR ||\n state === TileState.EMPTY) {\n tile.removeEventListener(EventType.CHANGE, this.boundHandleTileChange_);\n var tileKey = tile.getKey();\n if (tileKey in this.tilesLoadingKeys_) {\n delete this.tilesLoadingKeys_[tileKey];\n --this.tilesLoading_;\n }\n this.tileChangeCallback_();\n }\n };\n /**\n * @param {number} maxTotalLoading Maximum number tiles to load simultaneously.\n * @param {number} maxNewLoads Maximum number of new tiles to load.\n */\n TileQueue.prototype.loadMoreTiles = function (maxTotalLoading, maxNewLoads) {\n var newLoads = 0;\n var state, tile, tileKey;\n while (this.tilesLoading_ < maxTotalLoading &&\n newLoads < maxNewLoads &&\n this.getCount() > 0) {\n tile = /** @type {import(\"./Tile.js\").default} */ (this.dequeue()[0]);\n tileKey = tile.getKey();\n state = tile.getState();\n if (state === TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) {\n this.tilesLoadingKeys_[tileKey] = true;\n ++this.tilesLoading_;\n ++newLoads;\n tile.load();\n }\n }\n };\n return TileQueue;\n}(PriorityQueue));\nexport default TileQueue;\n/**\n * @param {import('./PluggableMap.js').FrameState} frameState Frame state.\n * @param {import(\"./Tile.js\").default} tile Tile.\n * @param {string} tileSourceKey Tile source key.\n * @param {import(\"./coordinate.js\").Coordinate} tileCenter Tile center.\n * @param {number} tileResolution Tile resolution.\n * @return {number} Tile priority.\n */\nexport function getTilePriority(frameState, tile, tileSourceKey, tileCenter, tileResolution) {\n // Filter out tiles at higher zoom levels than the current zoom level, or that\n // are outside the visible extent.\n if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {\n return DROP;\n }\n if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {\n return DROP;\n }\n // Prioritize the highest zoom level tiles closest to the focus.\n // Tiles at higher zoom levels are prioritized using Math.log(tileResolution).\n // Within a zoom level, tiles are prioritized by the distance in pixels between\n // the center of the tile and the center of the viewport. The factor of 65536\n // means that the prioritization should behave as desired for tiles up to\n // 65536 * Math.log(2) = 45426 pixels from the focus.\n var center = frameState.viewState.center;\n var deltaX = tileCenter[0] - center[0];\n var deltaY = tileCenter[1] - center[1];\n return (65536 * Math.log(tileResolution) +\n Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution);\n}\n//# sourceMappingURL=TileQueue.js.map","/**\n * @module ol/ViewHint\n */\n/**\n * @enum {number}\n */\nexport default {\n ANIMATING: 0,\n INTERACTING: 1,\n};\n//# sourceMappingURL=ViewHint.js.map","/**\n * @module ol/ViewProperty\n */\n/**\n * @enum {string}\n */\nexport default {\n CENTER: 'center',\n RESOLUTION: 'resolution',\n ROTATION: 'rotation',\n};\n//# sourceMappingURL=ViewProperty.js.map","/**\n * @module ol/tilegrid/common\n */\n/**\n * Default maximum zoom for default tile grids.\n * @type {number}\n */\nexport var DEFAULT_MAX_ZOOM = 42;\n/**\n * Default tile size.\n * @type {number}\n */\nexport var DEFAULT_TILE_SIZE = 256;\n//# sourceMappingURL=common.js.map","/**\n * @module ol/centerconstraint\n */\nimport { clamp } from './math.js';\n/**\n * @typedef {function((import(\"./coordinate.js\").Coordinate|undefined), number, import(\"./size.js\").Size, boolean=, Array=): (import(\"./coordinate.js\").Coordinate|undefined)} Type\n */\n/**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {boolean} onlyCenter If true, the constraint will only apply to the view center.\n * @param {boolean} smooth If true, the view will be able to go slightly out of the given extent\n * (only during interaction and animation).\n * @return {Type} The constraint.\n */\nexport function createExtent(extent, onlyCenter, smooth) {\n return (\n /**\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center Center.\n * @param {number} resolution Resolution.\n * @param {import(\"./size.js\").Size} size Viewport size; unused if `onlyCenter` was specified.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @param {Array} [opt_centerShift] Shift between map center and viewport center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\n function (center, resolution, size, opt_isMoving, opt_centerShift) {\n if (center) {\n var viewWidth = onlyCenter ? 0 : size[0] * resolution;\n var viewHeight = onlyCenter ? 0 : size[1] * resolution;\n var shiftX = opt_centerShift ? opt_centerShift[0] : 0;\n var shiftY = opt_centerShift ? opt_centerShift[1] : 0;\n var minX = extent[0] + viewWidth / 2 + shiftX;\n var maxX = extent[2] - viewWidth / 2 + shiftX;\n var minY = extent[1] + viewHeight / 2 + shiftY;\n var maxY = extent[3] - viewHeight / 2 + shiftY;\n // note: when zooming out of bounds, min and max values for x and y may\n // end up inverted (min > max); this has to be accounted for\n if (minX > maxX) {\n minX = (maxX + minX) / 2;\n maxX = minX;\n }\n if (minY > maxY) {\n minY = (maxY + minY) / 2;\n maxY = minY;\n }\n var x = clamp(center[0], minX, maxX);\n var y = clamp(center[1], minY, maxY);\n var ratio = 30 * resolution;\n // during an interaction, allow some overscroll\n if (opt_isMoving && smooth) {\n x +=\n -ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) +\n ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);\n y +=\n -ratio * Math.log(1 + Math.max(0, minY - center[1]) / ratio) +\n ratio * Math.log(1 + Math.max(0, center[1] - maxY) / ratio);\n }\n return [x, y];\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate} [center] Center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\nexport function none(center) {\n return center;\n}\n//# sourceMappingURL=centerconstraint.js.map","/**\n * @module ol/resolutionconstraint\n */\nimport { clamp } from './math.js';\nimport { getHeight, getWidth } from './extent.js';\nimport { linearFindNearest } from './array.js';\n/**\n * @typedef {function((number|undefined), number, import(\"./size.js\").Size, boolean=): (number|undefined)} Type\n */\n/**\n * Returns a modified resolution taking into account the viewport size and maximum\n * allowed extent.\n * @param {number} resolution Resolution\n * @param {import(\"./extent.js\").Extent} maxExtent Maximum allowed extent.\n * @param {import(\"./size.js\").Size} viewportSize Viewport size.\n * @param {boolean} showFullExtent Whether to show the full extent.\n * @return {number} Capped resolution.\n */\nfunction getViewportClampedResolution(resolution, maxExtent, viewportSize, showFullExtent) {\n var xResolution = getWidth(maxExtent) / viewportSize[0];\n var yResolution = getHeight(maxExtent) / viewportSize[1];\n if (showFullExtent) {\n return Math.min(resolution, Math.max(xResolution, yResolution));\n }\n return Math.min(resolution, Math.min(xResolution, yResolution));\n}\n/**\n * Returns a modified resolution to be between maxResolution and minResolution while\n * still allowing the value to be slightly out of bounds.\n * Note: the computation is based on the logarithm function (ln):\n * - at 1, ln(x) is 0\n * - above 1, ln(x) keeps increasing but at a much slower pace than x\n * The final result is clamped to prevent getting too far away from bounds.\n * @param {number} resolution Resolution.\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @return {number} Smoothed resolution.\n */\nfunction getSmoothClampedResolution(resolution, maxResolution, minResolution) {\n var result = Math.min(resolution, maxResolution);\n var ratio = 50;\n result *=\n Math.log(1 + ratio * Math.max(0, resolution / maxResolution - 1)) / ratio +\n 1;\n if (minResolution) {\n result = Math.max(result, minResolution);\n result /=\n Math.log(1 + ratio * Math.max(0, minResolution / resolution - 1)) /\n ratio +\n 1;\n }\n return clamp(result, minResolution / 2, maxResolution * 2);\n}\n/**\n * @param {Array} resolutions Resolutions.\n * @param {boolean} [opt_smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [opt_maxExtent] Maximum allowed extent.\n * @param {boolean} [opt_showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createSnapToResolutions(resolutions, opt_smooth, opt_maxExtent, opt_showFullExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var maxResolution = resolutions[0];\n var minResolution = resolutions[resolutions.length - 1];\n var cappedMaxRes = opt_maxExtent\n ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent)\n : maxResolution;\n // during interacting or animating, allow intermediary values\n if (opt_isMoving) {\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n var capped = Math.min(cappedMaxRes, resolution);\n var z = Math.floor(linearFindNearest(resolutions, capped, direction));\n if (resolutions[z] > cappedMaxRes && z < resolutions.length - 1) {\n return resolutions[z + 1];\n }\n return resolutions[z];\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number} power Power.\n * @param {number} maxResolution Maximum resolution.\n * @param {number} [opt_minResolution] Minimum resolution.\n * @param {boolean} [opt_smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [opt_maxExtent] Maximum allowed extent.\n * @param {boolean} [opt_showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createSnapToPower(power, maxResolution, opt_minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var cappedMaxRes = opt_maxExtent\n ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent)\n : maxResolution;\n var minResolution = opt_minResolution !== undefined ? opt_minResolution : 0;\n // during interacting or animating, allow intermediary values\n if (opt_isMoving) {\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n var tolerance = 1e-9;\n var minZoomLevel = Math.ceil(Math.log(maxResolution / cappedMaxRes) / Math.log(power) - tolerance);\n var offset = -direction * (0.5 - tolerance) + 0.5;\n var capped = Math.min(cappedMaxRes, resolution);\n var cappedZoomLevel = Math.floor(Math.log(maxResolution / capped) / Math.log(power) + offset);\n var zoomLevel = Math.max(minZoomLevel, cappedZoomLevel);\n var newResolution = maxResolution / Math.pow(power, zoomLevel);\n return clamp(newResolution, minResolution, cappedMaxRes);\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @param {boolean} [opt_smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [opt_maxExtent] Maximum allowed extent.\n * @param {boolean} [opt_showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nexport function createMinMaxResolution(maxResolution, minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, opt_isMoving) {\n if (resolution !== undefined) {\n var cappedMaxRes = opt_maxExtent\n ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent)\n : maxResolution;\n var smooth = opt_smooth !== undefined ? opt_smooth : true;\n if (!smooth || !opt_isMoving) {\n return clamp(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n else {\n return undefined;\n }\n });\n}\n//# sourceMappingURL=resolutionconstraint.js.map","/**\n * @module ol/rotationconstraint\n */\nimport { toRadians } from './math.js';\n/**\n * @typedef {function((number|undefined), boolean=): (number|undefined)} Type\n */\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nexport function disable(rotation) {\n if (rotation !== undefined) {\n return 0;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nexport function none(rotation) {\n if (rotation !== undefined) {\n return rotation;\n }\n else {\n return undefined;\n }\n}\n/**\n * @param {number} n N.\n * @return {Type} Rotation constraint.\n */\nexport function createSnapToN(n) {\n var theta = (2 * Math.PI) / n;\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, opt_isMoving) {\n if (opt_isMoving) {\n return rotation;\n }\n if (rotation !== undefined) {\n rotation = Math.floor(rotation / theta + 0.5) * theta;\n return rotation;\n }\n else {\n return undefined;\n }\n });\n}\n/**\n * @param {number} [opt_tolerance] Tolerance.\n * @return {Type} Rotation constraint.\n */\nexport function createSnapToZero(opt_tolerance) {\n var tolerance = opt_tolerance || toRadians(5);\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, opt_isMoving) {\n if (opt_isMoving) {\n return rotation;\n }\n if (rotation !== undefined) {\n if (Math.abs(rotation) <= tolerance) {\n return 0;\n }\n else {\n return rotation;\n }\n }\n else {\n return undefined;\n }\n });\n}\n//# sourceMappingURL=rotationconstraint.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/View\n */\nimport BaseObject from './Object.js';\nimport GeometryType from './geom/GeometryType.js';\nimport Units from './proj/Units.js';\nimport ViewHint from './ViewHint.js';\nimport ViewProperty from './ViewProperty.js';\nimport { DEFAULT_TILE_SIZE } from './tilegrid/common.js';\nimport { METERS_PER_UNIT, createProjection, fromUserCoordinate, fromUserExtent, getUserProjection, toUserCoordinate, toUserExtent, } from './proj.js';\nimport { VOID } from './functions.js';\nimport { add as addCoordinate, equals as coordinatesEqual, rotate as rotateCoordinate, } from './coordinate.js';\nimport { assert } from './asserts.js';\nimport { assign } from './obj.js';\nimport { none as centerNone, createExtent } from './centerconstraint.js';\nimport { clamp, modulo } from './math.js';\nimport { createMinMaxResolution } from './resolutionconstraint.js';\nimport { createSnapToN, createSnapToZero, disable, none as rotationNone, } from './rotationconstraint.js';\nimport { createSnapToPower, createSnapToResolutions, } from './resolutionconstraint.js';\nimport { easeOut } from './easing.js';\nimport { equals } from './coordinate.js';\nimport { getCenter, getForViewAndSize, getHeight, getWidth, isEmpty, } from './extent.js';\nimport { inAndOut } from './easing.js';\nimport { linearFindNearest } from './array.js';\nimport { fromExtent as polygonFromExtent } from './geom/Polygon.js';\n/**\n * An animation configuration\n *\n * @typedef {Object} Animation\n * @property {import(\"./coordinate.js\").Coordinate} [sourceCenter] Source center.\n * @property {import(\"./coordinate.js\").Coordinate} [targetCenter] Target center.\n * @property {number} [sourceResolution] Source resolution.\n * @property {number} [targetResolution] Target resolution.\n * @property {number} [sourceRotation] Source rotation.\n * @property {number} [targetRotation] Target rotation.\n * @property {import(\"./coordinate.js\").Coordinate} [anchor] Anchor.\n * @property {number} start Start.\n * @property {number} duration Duration.\n * @property {boolean} complete Complete.\n * @property {function(number):number} easing Easing.\n * @property {function(boolean):void} callback Callback.\n */\n/**\n * @typedef {Object} Constraints\n * @property {import(\"./centerconstraint.js\").Type} center Center.\n * @property {import(\"./resolutionconstraint.js\").Type} resolution Resolution.\n * @property {import(\"./rotationconstraint.js\").Type} rotation Rotation.\n */\n/**\n * @typedef {Object} FitOptions\n * @property {import(\"./size.js\").Size} [size] The size in pixels of the box to fit\n * the extent into. Default is the current size of the first map in the DOM that\n * uses this view, or `[100, 100]` if no such map is found.\n * @property {!Array} [padding=[0, 0, 0, 0]] Padding (in pixels) to be\n * cleared inside the view. Values in the array are top, right, bottom and left\n * padding.\n * @property {boolean} [nearest=false] If the view `constrainResolution` option is `true`,\n * get the nearest extent instead of the closest that actually fits the view.\n * @property {number} [minResolution=0] Minimum resolution that we zoom to.\n * @property {number} [maxZoom] Maximum zoom level that we zoom to. If\n * `minResolution` is given, this property is ignored.\n * @property {number} [duration] The duration of the animation in milliseconds.\n * By default, there is no animation to the target extent.\n * @property {function(number):number} [easing] The easing function used during\n * the animation (defaults to {@link module:ol/easing.inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n * @property {function(boolean):void} [callback] Function called when the view is in\n * its final position. The callback will be called with `true` if the animation\n * series completed on its own or `false` if it was cancelled.\n */\n/**\n * @typedef {Object} ViewOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The initial center for\n * the view. If a user projection is not set, the coordinate system for the center is\n * specified with the `projection` option. Layer sources will not be fetched if this\n * is not set, but the center can be set later with {@link #setCenter}.\n * @property {boolean|number} [constrainRotation=true] Rotation constraint.\n * `false` means no constraint. `true` means no constraint, but snap to zero\n * near zero. A number constrains the rotation to that number of values. For\n * example, `4` will constrain the rotation to 0, 90, 180, and 270 degrees.\n * @property {boolean} [enableRotation=true] Enable rotation.\n * If `false`, a rotation constraint that always sets the rotation to zero is\n * used. The `constrainRotation` option has no effect if `enableRotation` is\n * `false`.\n * @property {import(\"./extent.js\").Extent} [extent] The extent that constrains the\n * view, in other words, nothing outside of this extent can be visible on the map.\n * @property {boolean} [constrainOnlyCenter=false] If true, the extent\n * constraint will only apply to the view center and not the whole extent.\n * @property {boolean} [smoothExtentConstraint=true] If true, the extent\n * constraint will be applied smoothly, i.e. allow the view to go slightly outside\n * of the given `extent`.\n * @property {number} [maxResolution] The maximum resolution used to determine\n * the resolution constraint. It is used together with `minResolution` (or\n * `maxZoom`) and `zoomFactor`. If unspecified it is calculated in such a way\n * that the projection's validity extent fits in a 256x256 px tile. If the\n * projection is Spherical Mercator (the default) then `maxResolution` defaults\n * to `40075016.68557849 / 256 = 156543.03392804097`.\n * @property {number} [minResolution] The minimum resolution used to determine\n * the resolution constraint. It is used together with `maxResolution` (or\n * `minZoom`) and `zoomFactor`. If unspecified it is calculated assuming 29\n * zoom levels (with a factor of 2). If the projection is Spherical Mercator\n * (the default) then `minResolution` defaults to\n * `40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253`.\n * @property {number} [maxZoom=28] The maximum zoom level used to determine the\n * resolution constraint. It is used together with `minZoom` (or\n * `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also\n * provided, it is given precedence over `maxZoom`.\n * @property {number} [minZoom=0] The minimum zoom level used to determine the\n * resolution constraint. It is used together with `maxZoom` (or\n * `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also\n * provided, it is given precedence over `minZoom`.\n * @property {boolean} [multiWorld=false] If `false` the view is constrained so\n * only one world is visible, and you cannot pan off the edge. If `true` the map\n * may show multiple worlds at low zoom levels. Only used if the `projection` is\n * global. Note that if `extent` is also provided it is given precedence.\n * @property {boolean} [constrainResolution=false] If true, the view will always\n * animate to the closest zoom level after an interaction; false means\n * intermediary zoom levels are allowed.\n * @property {boolean} [smoothResolutionConstraint=true] If true, the resolution\n * min/max values will be applied smoothly, i. e. allow the view to exceed slightly\n * the given resolution or zoom bounds.\n * @property {boolean} [showFullExtent=false] Allow the view to be zoomed out to\n * show the full configured extent. By default, when a view is configured with an\n * extent, users will not be able to zoom out so the viewport exceeds the extent in\n * either dimension. This means the full extent may not be visible if the viewport\n * is taller or wider than the aspect ratio of the configured extent. If\n * showFullExtent is true, the user will be able to zoom out so that the viewport\n * exceeds the height or width of the configured extent, but not both, allowing the\n * full extent to be shown.\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857'] The\n * projection. The default is Spherical Mercator.\n * @property {number} [resolution] The initial resolution for the view. The\n * units are `projection` units per pixel (e.g. meters per pixel). An\n * alternative to setting this is to set `zoom`. Layer sources will not be\n * fetched if neither this nor `zoom` are defined, but they can be set later\n * with {@link #setZoom} or {@link #setResolution}.\n * @property {Array} [resolutions] Resolutions that determine the\n * zoom levels if specified. The index in the array corresponds to the zoom level,\n * therefore the resolution values have to be in descending order. It also constrains\n * the resolution by the minimum and maximum value. If set the `maxResolution`,\n * `minResolution`, `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.\n * @property {number} [rotation=0] The initial rotation for the view in radians\n * (positive rotation clockwise, 0 means North).\n * @property {number} [zoom] Only used if `resolution` is not defined. Zoom\n * level used to calculate the initial resolution for the view.\n * @property {number} [zoomFactor=2] The zoom factor used to compute the\n * corresponding resolution.\n * @property {!Array} [padding=[0, 0, 0, 0]] Padding (in css pixels).\n * If the map viewport is partially covered with other content (overlays) along\n * its edges, this setting allows to shift the center of the viewport away from\n * that content. The order of the values is top, right, bottom, left.\n */\n/**\n * @typedef {Object} AnimationOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The center of the view at the end of\n * the animation.\n * @property {number} [zoom] The zoom level of the view at the end of the\n * animation. This takes precedence over `resolution`.\n * @property {number} [resolution] The resolution of the view at the end\n * of the animation. If `zoom` is also provided, this option will be ignored.\n * @property {number} [rotation] The rotation of the view at the end of\n * the animation.\n * @property {import(\"./coordinate.js\").Coordinate} [anchor] Optional anchor to remain fixed\n * during a rotation or resolution animation.\n * @property {number} [duration=1000] The duration of the animation in milliseconds.\n * @property {function(number):number} [easing] The easing function used\n * during the animation (defaults to {@link module:ol/easing.inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n */\n/**\n * @typedef {Object} State\n * @property {import(\"./coordinate.js\").Coordinate} center Center.\n * @property {import(\"./proj/Projection.js\").default} projection Projection.\n * @property {number} resolution Resolution.\n * @property {number} rotation Rotation.\n * @property {number} zoom Zoom.\n */\n/**\n * Default min zoom level for the map view.\n * @type {number}\n */\nvar DEFAULT_MIN_ZOOM = 0;\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:center'|'change:resolution'|'change:rotation'} ViewObjectEventTypes\n */\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} ViewOnSignature\n */\n/**\n * @classdesc\n * A View object represents a simple 2D view of the map.\n *\n * This is the object to act upon to change the center, resolution,\n * and rotation of the map.\n *\n * A View has a `projection`. The projection determines the\n * coordinate system of the center, and its units determine the units of the\n * resolution (projection units per pixel). The default projection is\n * Spherical Mercator (EPSG:3857).\n *\n * ### The view states\n *\n * A View is determined by three states: `center`, `resolution`,\n * and `rotation`. Each state has a corresponding getter and setter, e.g.\n * `getCenter` and `setCenter` for the `center` state.\n *\n * The `zoom` state is actually not saved on the view: all computations\n * internally use the `resolution` state. Still, the `setZoom` and `getZoom`\n * methods are available, as well as `getResolutionForZoom` and\n * `getZoomForResolution` to switch from one system to the other.\n *\n * ### The constraints\n *\n * `setCenter`, `setResolution` and `setRotation` can be used to change the\n * states of the view, but any constraint defined in the constructor will\n * be applied along the way.\n *\n * A View object can have a *resolution constraint*, a *rotation constraint*\n * and a *center constraint*.\n *\n * The *resolution constraint* typically restricts min/max values and\n * snaps to specific resolutions. It is determined by the following\n * options: `resolutions`, `maxResolution`, `maxZoom` and `zoomFactor`.\n * If `resolutions` is set, the other three options are ignored. See\n * documentation for each option for more information. By default, the view\n * only has a min/max restriction and allow intermediary zoom levels when\n * pinch-zooming for example.\n *\n * The *rotation constraint* snaps to specific angles. It is determined\n * by the following options: `enableRotation` and `constrainRotation`.\n * By default rotation is allowed and its value is snapped to zero when approaching the\n * horizontal.\n *\n * The *center constraint* is determined by the `extent` option. By\n * default the view center is not constrained at all.\n *\n * ### Changing the view state\n *\n * It is important to note that `setZoom`, `setResolution`, `setCenter` and\n * `setRotation` are subject to the above mentioned constraints. As such, it\n * may sometimes not be possible to know in advance the resulting state of the\n * View. For example, calling `setResolution(10)` does not guarantee that\n * `getResolution()` will return `10`.\n *\n * A consequence of this is that, when applying a delta on the view state, one\n * should use `adjustCenter`, `adjustRotation`, `adjustZoom` and `adjustResolution`\n * rather than the corresponding setters. This will let view do its internal\n * computations. Besides, the `adjust*` methods also take an `opt_anchor`\n * argument which allows specifying an origin for the transformation.\n *\n * ### Interacting with the view\n *\n * View constraints are usually only applied when the view is *at rest*, meaning that\n * no interaction or animation is ongoing. As such, if the user puts the view in a\n * state that is not equivalent to a constrained one (e.g. rotating the view when\n * the snap angle is 0), an animation will be triggered at the interaction end to\n * put back the view to a stable state;\n *\n * @api\n */\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n /**\n * @param {ViewOptions} [opt_options] View options.\n */\n function View(opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {ViewOnSignature}\n */\n _this.on;\n /***\n * @type {ViewOnSignature}\n */\n _this.once;\n /***\n * @type {ViewOnSignature}\n */\n _this.un;\n var options = assign({}, opt_options);\n /**\n * @private\n * @type {Array}\n */\n _this.hints_ = [0, 0];\n /**\n * @private\n * @type {Array>}\n */\n _this.animations_ = [];\n /**\n * @private\n * @type {number|undefined}\n */\n _this.updateAnimationKey_;\n /**\n * @private\n * @const\n * @type {import(\"./proj/Projection.js\").default}\n */\n _this.projection_ = createProjection(options.projection, 'EPSG:3857');\n /**\n * @private\n * @type {import(\"./size.js\").Size}\n */\n _this.viewportSize_ = [100, 100];\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n _this.targetCenter_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.targetResolution_;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.targetRotation_;\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n _this.cancelAnchor_ = undefined;\n if (options.center) {\n options.center = fromUserCoordinate(options.center, _this.projection_);\n }\n if (options.extent) {\n options.extent = fromUserExtent(options.extent, _this.projection_);\n }\n _this.applyOptions_(options);\n return _this;\n }\n /**\n * Set up the view with the given options.\n * @param {ViewOptions} options View options.\n */\n View.prototype.applyOptions_ = function (options) {\n /**\n * @type {Object}\n */\n var properties = {};\n var resolutionConstraintInfo = createResolutionConstraint(options);\n /**\n * @private\n * @type {number}\n */\n this.maxResolution_ = resolutionConstraintInfo.maxResolution;\n /**\n * @private\n * @type {number}\n */\n this.minResolution_ = resolutionConstraintInfo.minResolution;\n /**\n * @private\n * @type {number}\n */\n this.zoomFactor_ = resolutionConstraintInfo.zoomFactor;\n /**\n * @private\n * @type {Array|undefined}\n */\n this.resolutions_ = options.resolutions;\n /**\n * @type {Array|undefined}\n * @private\n */\n this.padding_ = options.padding;\n /**\n * @private\n * @type {number}\n */\n this.minZoom_ = resolutionConstraintInfo.minZoom;\n var centerConstraint = createCenterConstraint(options);\n var resolutionConstraint = resolutionConstraintInfo.constraint;\n var rotationConstraint = createRotationConstraint(options);\n /**\n * @private\n * @type {Constraints}\n */\n this.constraints_ = {\n center: centerConstraint,\n resolution: resolutionConstraint,\n rotation: rotationConstraint,\n };\n this.setRotation(options.rotation !== undefined ? options.rotation : 0);\n this.setCenterInternal(options.center !== undefined ? options.center : null);\n if (options.resolution !== undefined) {\n this.setResolution(options.resolution);\n }\n else if (options.zoom !== undefined) {\n this.setZoom(options.zoom);\n }\n this.setProperties(properties);\n /**\n * @private\n * @type {ViewOptions}\n */\n this.options_ = options;\n };\n Object.defineProperty(View.prototype, \"padding\", {\n /**\n * Padding (in css pixels).\n * If the map viewport is partially covered with other content (overlays) along\n * its edges, this setting allows to shift the center of the viewport away from that\n * content. The order of the values in the array is top, right, bottom, left.\n * The default is no padding, which is equivalent to `[0, 0, 0, 0]`.\n * @type {Array|undefined}\n * @api\n */\n get: function () {\n return this.padding_;\n },\n set: function (padding) {\n var oldPadding = this.padding_;\n this.padding_ = padding;\n var center = this.getCenter();\n if (center) {\n var newPadding = padding || [0, 0, 0, 0];\n oldPadding = oldPadding || [0, 0, 0, 0];\n var resolution = this.getResolution();\n var offsetX = (resolution / 2) *\n (newPadding[3] - oldPadding[3] + oldPadding[1] - newPadding[1]);\n var offsetY = (resolution / 2) *\n (newPadding[0] - oldPadding[0] + oldPadding[2] - newPadding[2]);\n this.setCenterInternal([center[0] + offsetX, center[1] - offsetY]);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get an updated version of the view options used to construct the view. The\n * current resolution (or zoom), center, and rotation are applied to any stored\n * options. The provided options can be used to apply new min/max zoom or\n * resolution limits.\n * @param {ViewOptions} newOptions New options to be applied.\n * @return {ViewOptions} New options updated with the current view state.\n */\n View.prototype.getUpdatedOptions_ = function (newOptions) {\n var options = assign({}, this.options_);\n // preserve resolution (or zoom)\n if (options.resolution !== undefined) {\n options.resolution = this.getResolution();\n }\n else {\n options.zoom = this.getZoom();\n }\n // preserve center\n options.center = this.getCenterInternal();\n // preserve rotation\n options.rotation = this.getRotation();\n return assign({}, options, newOptions);\n };\n /**\n * Animate the view. The view's center, zoom (or resolution), and rotation\n * can be animated for smooth transitions between view states. For example,\n * to animate the view to a new zoom level:\n *\n * view.animate({zoom: view.getZoom() + 1});\n *\n * By default, the animation lasts one second and uses in-and-out easing. You\n * can customize this behavior by including `duration` (in milliseconds) and\n * `easing` options (see {@link module:ol/easing}).\n *\n * To chain together multiple animations, call the method with multiple\n * animation objects. For example, to first zoom and then pan:\n *\n * view.animate({zoom: 10}, {center: [0, 0]});\n *\n * If you provide a function as the last argument to the animate method, it\n * will get called at the end of an animation series. The callback will be\n * called with `true` if the animation series completed on its own or `false`\n * if it was cancelled.\n *\n * Animations are cancelled by user interactions (e.g. dragging the map) or by\n * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`\n * (or another method that calls one of these).\n *\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation\n * options. Multiple animations can be run in series by passing multiple\n * options objects. To run multiple animations in parallel, call the method\n * multiple times. An optional callback can be provided as a final\n * argument. The callback will be called with a boolean indicating whether\n * the animation completed without being cancelled.\n * @api\n */\n View.prototype.animate = function (var_args) {\n if (this.isDef() && !this.getAnimating()) {\n this.resolveConstraints(0);\n }\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; ++i) {\n var options = arguments[i];\n if (options.center) {\n options = assign({}, options);\n options.center = fromUserCoordinate(options.center, this.getProjection());\n }\n if (options.anchor) {\n options = assign({}, options);\n options.anchor = fromUserCoordinate(options.anchor, this.getProjection());\n }\n args[i] = options;\n }\n this.animateInternal.apply(this, args);\n };\n /**\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation options.\n */\n View.prototype.animateInternal = function (var_args) {\n var animationCount = arguments.length;\n var callback;\n if (animationCount > 1 &&\n typeof arguments[animationCount - 1] === 'function') {\n callback = arguments[animationCount - 1];\n --animationCount;\n }\n if (!this.isDef()) {\n // if view properties are not yet set, shortcut to the final state\n var state = arguments[animationCount - 1];\n if (state.center) {\n this.setCenterInternal(state.center);\n }\n if (state.zoom !== undefined) {\n this.setZoom(state.zoom);\n }\n if (state.rotation !== undefined) {\n this.setRotation(state.rotation);\n }\n if (callback) {\n animationCallback(callback, true);\n }\n return;\n }\n var start = Date.now();\n var center = this.targetCenter_.slice();\n var resolution = this.targetResolution_;\n var rotation = this.targetRotation_;\n var series = [];\n for (var i = 0; i < animationCount; ++i) {\n var options = /** @type {AnimationOptions} */ (arguments[i]);\n var animation = {\n start: start,\n complete: false,\n anchor: options.anchor,\n duration: options.duration !== undefined ? options.duration : 1000,\n easing: options.easing || inAndOut,\n callback: callback,\n };\n if (options.center) {\n animation.sourceCenter = center;\n animation.targetCenter = options.center.slice();\n center = animation.targetCenter;\n }\n if (options.zoom !== undefined) {\n animation.sourceResolution = resolution;\n animation.targetResolution = this.getResolutionForZoom(options.zoom);\n resolution = animation.targetResolution;\n }\n else if (options.resolution) {\n animation.sourceResolution = resolution;\n animation.targetResolution = options.resolution;\n resolution = animation.targetResolution;\n }\n if (options.rotation !== undefined) {\n animation.sourceRotation = rotation;\n var delta = modulo(options.rotation - rotation + Math.PI, 2 * Math.PI) - Math.PI;\n animation.targetRotation = rotation + delta;\n rotation = animation.targetRotation;\n }\n // check if animation is a no-op\n if (isNoopAnimation(animation)) {\n animation.complete = true;\n // we still push it onto the series for callback handling\n }\n else {\n start += animation.duration;\n }\n series.push(animation);\n }\n this.animations_.push(series);\n this.setHint(ViewHint.ANIMATING, 1);\n this.updateAnimations_();\n };\n /**\n * Determine if the view is being animated.\n * @return {boolean} The view is being animated.\n * @api\n */\n View.prototype.getAnimating = function () {\n return this.hints_[ViewHint.ANIMATING] > 0;\n };\n /**\n * Determine if the user is interacting with the view, such as panning or zooming.\n * @return {boolean} The view is being interacted with.\n * @api\n */\n View.prototype.getInteracting = function () {\n return this.hints_[ViewHint.INTERACTING] > 0;\n };\n /**\n * Cancel any ongoing animations.\n * @api\n */\n View.prototype.cancelAnimations = function () {\n this.setHint(ViewHint.ANIMATING, -this.hints_[ViewHint.ANIMATING]);\n var anchor;\n for (var i = 0, ii = this.animations_.length; i < ii; ++i) {\n var series = this.animations_[i];\n if (series[0].callback) {\n animationCallback(series[0].callback, false);\n }\n if (!anchor) {\n for (var j = 0, jj = series.length; j < jj; ++j) {\n var animation = series[j];\n if (!animation.complete) {\n anchor = animation.anchor;\n break;\n }\n }\n }\n }\n this.animations_.length = 0;\n this.cancelAnchor_ = anchor;\n };\n /**\n * Update all animations.\n */\n View.prototype.updateAnimations_ = function () {\n if (this.updateAnimationKey_ !== undefined) {\n cancelAnimationFrame(this.updateAnimationKey_);\n this.updateAnimationKey_ = undefined;\n }\n if (!this.getAnimating()) {\n return;\n }\n var now = Date.now();\n var more = false;\n for (var i = this.animations_.length - 1; i >= 0; --i) {\n var series = this.animations_[i];\n var seriesComplete = true;\n for (var j = 0, jj = series.length; j < jj; ++j) {\n var animation = series[j];\n if (animation.complete) {\n continue;\n }\n var elapsed = now - animation.start;\n var fraction = animation.duration > 0 ? elapsed / animation.duration : 1;\n if (fraction >= 1) {\n animation.complete = true;\n fraction = 1;\n }\n else {\n seriesComplete = false;\n }\n var progress = animation.easing(fraction);\n if (animation.sourceCenter) {\n var x0 = animation.sourceCenter[0];\n var y0 = animation.sourceCenter[1];\n var x1 = animation.targetCenter[0];\n var y1 = animation.targetCenter[1];\n var x = x0 + progress * (x1 - x0);\n var y = y0 + progress * (y1 - y0);\n this.targetCenter_ = [x, y];\n }\n if (animation.sourceResolution && animation.targetResolution) {\n var resolution = progress === 1\n ? animation.targetResolution\n : animation.sourceResolution +\n progress *\n (animation.targetResolution - animation.sourceResolution);\n if (animation.anchor) {\n var size = this.getViewportSize_(this.getRotation());\n var constrainedResolution = this.constraints_.resolution(resolution, 0, size, true);\n this.targetCenter_ = this.calculateCenterZoom(constrainedResolution, animation.anchor);\n }\n this.targetResolution_ = resolution;\n this.applyTargetState_(true);\n }\n if (animation.sourceRotation !== undefined &&\n animation.targetRotation !== undefined) {\n var rotation = progress === 1\n ? modulo(animation.targetRotation + Math.PI, 2 * Math.PI) -\n Math.PI\n : animation.sourceRotation +\n progress *\n (animation.targetRotation - animation.sourceRotation);\n if (animation.anchor) {\n var constrainedRotation = this.constraints_.rotation(rotation, true);\n this.targetCenter_ = this.calculateCenterRotate(constrainedRotation, animation.anchor);\n }\n this.targetRotation_ = rotation;\n }\n this.applyTargetState_(true);\n more = true;\n if (!animation.complete) {\n break;\n }\n }\n if (seriesComplete) {\n this.animations_[i] = null;\n this.setHint(ViewHint.ANIMATING, -1);\n var callback = series[0].callback;\n if (callback) {\n animationCallback(callback, true);\n }\n }\n }\n // prune completed series\n this.animations_ = this.animations_.filter(Boolean);\n if (more && this.updateAnimationKey_ === undefined) {\n this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_.bind(this));\n }\n };\n /**\n * @param {number} rotation Target rotation.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Rotation anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for rotation and anchor.\n */\n View.prototype.calculateCenterRotate = function (rotation, anchor) {\n var center;\n var currentCenter = this.getCenterInternal();\n if (currentCenter !== undefined) {\n center = [currentCenter[0] - anchor[0], currentCenter[1] - anchor[1]];\n rotateCoordinate(center, rotation - this.getRotation());\n addCoordinate(center, anchor);\n }\n return center;\n };\n /**\n * @param {number} resolution Target resolution.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Zoom anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for resolution and anchor.\n */\n View.prototype.calculateCenterZoom = function (resolution, anchor) {\n var center;\n var currentCenter = this.getCenterInternal();\n var currentResolution = this.getResolution();\n if (currentCenter !== undefined && currentResolution !== undefined) {\n var x = anchor[0] -\n (resolution * (anchor[0] - currentCenter[0])) / currentResolution;\n var y = anchor[1] -\n (resolution * (anchor[1] - currentCenter[1])) / currentResolution;\n center = [x, y];\n }\n return center;\n };\n /**\n * Returns the current viewport size.\n * @private\n * @param {number} [opt_rotation] Take into account the rotation of the viewport when giving the size\n * @return {import(\"./size.js\").Size} Viewport size or `[100, 100]` when no viewport is found.\n */\n View.prototype.getViewportSize_ = function (opt_rotation) {\n var size = this.viewportSize_;\n if (opt_rotation) {\n var w = size[0];\n var h = size[1];\n return [\n Math.abs(w * Math.cos(opt_rotation)) +\n Math.abs(h * Math.sin(opt_rotation)),\n Math.abs(w * Math.sin(opt_rotation)) +\n Math.abs(h * Math.cos(opt_rotation)),\n ];\n }\n else {\n return size;\n }\n };\n /**\n * Stores the viewport size on the view. The viewport size is not read every time from the DOM\n * to avoid performance hit and layout reflow.\n * This should be done on map size change.\n * Note: the constraints are not resolved during an animation to avoid stopping it\n * @param {import(\"./size.js\").Size} [opt_size] Viewport size; if undefined, [100, 100] is assumed\n */\n View.prototype.setViewportSize = function (opt_size) {\n this.viewportSize_ = Array.isArray(opt_size)\n ? opt_size.slice()\n : [100, 100];\n if (!this.getAnimating()) {\n this.resolveConstraints(0);\n }\n };\n /**\n * Get the view center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n * @observable\n * @api\n */\n View.prototype.getCenter = function () {\n var center = this.getCenterInternal();\n if (!center) {\n return center;\n }\n return toUserCoordinate(center, this.getProjection());\n };\n /**\n * Get the view center without transforming to user projection.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n */\n View.prototype.getCenterInternal = function () {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */ (this.get(ViewProperty.CENTER));\n };\n /**\n * @return {Constraints} Constraints.\n */\n View.prototype.getConstraints = function () {\n return this.constraints_;\n };\n /**\n * @return {boolean} Resolution constraint is set\n */\n View.prototype.getConstrainResolution = function () {\n return this.options_.constrainResolution;\n };\n /**\n * @param {Array} [opt_hints] Destination array.\n * @return {Array} Hint.\n */\n View.prototype.getHints = function (opt_hints) {\n if (opt_hints !== undefined) {\n opt_hints[0] = this.hints_[0];\n opt_hints[1] = this.hints_[1];\n return opt_hints;\n }\n else {\n return this.hints_.slice();\n }\n };\n /**\n * Calculate the extent for the current view state and the passed size.\n * The size is the pixel dimensions of the box into which the calculated extent\n * should fit. In most cases you want to get the extent of the entire map,\n * that is `map.getSize()`.\n * @param {import(\"./size.js\").Size} [opt_size] Box pixel size. If not provided, the size\n * of the map that uses this view will be used.\n * @return {import(\"./extent.js\").Extent} Extent.\n * @api\n */\n View.prototype.calculateExtent = function (opt_size) {\n var extent = this.calculateExtentInternal(opt_size);\n return toUserExtent(extent, this.getProjection());\n };\n /**\n * @param {import(\"./size.js\").Size} [opt_size] Box pixel size. If not provided,\n * the map's last known viewport size will be used.\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n View.prototype.calculateExtentInternal = function (opt_size) {\n var size = opt_size || this.getViewportSizeMinusPadding_();\n var center = /** @type {!import(\"./coordinate.js\").Coordinate} */ (this.getCenterInternal());\n assert(center, 1); // The view center is not defined\n var resolution = /** @type {!number} */ (this.getResolution());\n assert(resolution !== undefined, 2); // The view resolution is not defined\n var rotation = /** @type {!number} */ (this.getRotation());\n assert(rotation !== undefined, 3); // The view rotation is not defined\n return getForViewAndSize(center, resolution, rotation, size);\n };\n /**\n * Get the maximum resolution of the view.\n * @return {number} The maximum resolution of the view.\n * @api\n */\n View.prototype.getMaxResolution = function () {\n return this.maxResolution_;\n };\n /**\n * Get the minimum resolution of the view.\n * @return {number} The minimum resolution of the view.\n * @api\n */\n View.prototype.getMinResolution = function () {\n return this.minResolution_;\n };\n /**\n * Get the maximum zoom level for the view.\n * @return {number} The maximum zoom level.\n * @api\n */\n View.prototype.getMaxZoom = function () {\n return /** @type {number} */ (this.getZoomForResolution(this.minResolution_));\n };\n /**\n * Set a new maximum zoom level for the view.\n * @param {number} zoom The maximum zoom level.\n * @api\n */\n View.prototype.setMaxZoom = function (zoom) {\n this.applyOptions_(this.getUpdatedOptions_({ maxZoom: zoom }));\n };\n /**\n * Get the minimum zoom level for the view.\n * @return {number} The minimum zoom level.\n * @api\n */\n View.prototype.getMinZoom = function () {\n return /** @type {number} */ (this.getZoomForResolution(this.maxResolution_));\n };\n /**\n * Set a new minimum zoom level for the view.\n * @param {number} zoom The minimum zoom level.\n * @api\n */\n View.prototype.setMinZoom = function (zoom) {\n this.applyOptions_(this.getUpdatedOptions_({ minZoom: zoom }));\n };\n /**\n * Set whether the view should allow intermediary zoom levels.\n * @param {boolean} enabled Whether the resolution is constrained.\n * @api\n */\n View.prototype.setConstrainResolution = function (enabled) {\n this.applyOptions_(this.getUpdatedOptions_({ constrainResolution: enabled }));\n };\n /**\n * Get the view projection.\n * @return {import(\"./proj/Projection.js\").default} The projection of the view.\n * @api\n */\n View.prototype.getProjection = function () {\n return this.projection_;\n };\n /**\n * Get the view resolution.\n * @return {number|undefined} The resolution of the view.\n * @observable\n * @api\n */\n View.prototype.getResolution = function () {\n return /** @type {number|undefined} */ (this.get(ViewProperty.RESOLUTION));\n };\n /**\n * Get the resolutions for the view. This returns the array of resolutions\n * passed to the constructor of the View, or undefined if none were given.\n * @return {Array|undefined} The resolutions of the view.\n * @api\n */\n View.prototype.getResolutions = function () {\n return this.resolutions_;\n };\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size} [opt_size] Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n * @api\n */\n View.prototype.getResolutionForExtent = function (extent, opt_size) {\n return this.getResolutionForExtentInternal(fromUserExtent(extent, this.getProjection()), opt_size);\n };\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size} [opt_size] Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n */\n View.prototype.getResolutionForExtentInternal = function (extent, opt_size) {\n var size = opt_size || this.getViewportSizeMinusPadding_();\n var xResolution = getWidth(extent) / size[0];\n var yResolution = getHeight(extent) / size[1];\n return Math.max(xResolution, yResolution);\n };\n /**\n * Return a function that returns a value between 0 and 1 for a\n * resolution. Exponential scaling is assumed.\n * @param {number} [opt_power] Power.\n * @return {function(number): number} Resolution for value function.\n */\n View.prototype.getResolutionForValueFunction = function (opt_power) {\n var power = opt_power || 2;\n var maxResolution = this.getConstrainedResolution(this.maxResolution_);\n var minResolution = this.minResolution_;\n var max = Math.log(maxResolution / minResolution) / Math.log(power);\n return (\n /**\n * @param {number} value Value.\n * @return {number} Resolution.\n */\n function (value) {\n var resolution = maxResolution / Math.pow(power, value * max);\n return resolution;\n });\n };\n /**\n * Get the view rotation.\n * @return {number} The rotation of the view in radians.\n * @observable\n * @api\n */\n View.prototype.getRotation = function () {\n return /** @type {number} */ (this.get(ViewProperty.ROTATION));\n };\n /**\n * Return a function that returns a resolution for a value between\n * 0 and 1. Exponential scaling is assumed.\n * @param {number} [opt_power] Power.\n * @return {function(number): number} Value for resolution function.\n */\n View.prototype.getValueForResolutionFunction = function (opt_power) {\n var logPower = Math.log(opt_power || 2);\n var maxResolution = this.getConstrainedResolution(this.maxResolution_);\n var minResolution = this.minResolution_;\n var max = Math.log(maxResolution / minResolution) / logPower;\n return (\n /**\n * @param {number} resolution Resolution.\n * @return {number} Value.\n */\n function (resolution) {\n var value = Math.log(maxResolution / resolution) / logPower / max;\n return value;\n });\n };\n /**\n * Returns the size of the viewport minus padding.\n * @private\n * @param {number} [opt_rotation] Take into account the rotation of the viewport when giving the size\n * @return {import(\"./size.js\").Size} Viewport size reduced by the padding.\n */\n View.prototype.getViewportSizeMinusPadding_ = function (opt_rotation) {\n var size = this.getViewportSize_(opt_rotation);\n var padding = this.padding_;\n if (padding) {\n size = [\n size[0] - padding[1] - padding[3],\n size[1] - padding[0] - padding[2],\n ];\n }\n return size;\n };\n /**\n * @return {State} View state.\n */\n View.prototype.getState = function () {\n var projection = this.getProjection();\n var resolution = /** @type {number} */ (this.getResolution());\n var rotation = this.getRotation();\n var center = /** @type {import(\"./coordinate.js\").Coordinate} */ (this.getCenterInternal());\n var padding = this.padding_;\n if (padding) {\n var reducedSize = this.getViewportSizeMinusPadding_();\n center = calculateCenterOn(center, this.getViewportSize_(), [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);\n }\n return {\n center: center.slice(0),\n projection: projection !== undefined ? projection : null,\n resolution: resolution,\n rotation: rotation,\n zoom: this.getZoom(),\n };\n };\n /**\n * Get the current zoom level. This method may return non-integer zoom levels\n * if the view does not constrain the resolution, or if an interaction or\n * animation is underway.\n * @return {number|undefined} Zoom.\n * @api\n */\n View.prototype.getZoom = function () {\n var zoom;\n var resolution = this.getResolution();\n if (resolution !== undefined) {\n zoom = this.getZoomForResolution(resolution);\n }\n return zoom;\n };\n /**\n * Get the zoom level for a resolution.\n * @param {number} resolution The resolution.\n * @return {number|undefined} The zoom level for the provided resolution.\n * @api\n */\n View.prototype.getZoomForResolution = function (resolution) {\n var offset = this.minZoom_ || 0;\n var max, zoomFactor;\n if (this.resolutions_) {\n var nearest = linearFindNearest(this.resolutions_, resolution, 1);\n offset = nearest;\n max = this.resolutions_[nearest];\n if (nearest == this.resolutions_.length - 1) {\n zoomFactor = 2;\n }\n else {\n zoomFactor = max / this.resolutions_[nearest + 1];\n }\n }\n else {\n max = this.maxResolution_;\n zoomFactor = this.zoomFactor_;\n }\n return offset + Math.log(max / resolution) / Math.log(zoomFactor);\n };\n /**\n * Get the resolution for a zoom level.\n * @param {number} zoom Zoom level.\n * @return {number} The view resolution for the provided zoom level.\n * @api\n */\n View.prototype.getResolutionForZoom = function (zoom) {\n if (this.resolutions_) {\n if (this.resolutions_.length <= 1) {\n return 0;\n }\n var baseLevel = clamp(Math.floor(zoom), 0, this.resolutions_.length - 2);\n var zoomFactor = this.resolutions_[baseLevel] / this.resolutions_[baseLevel + 1];\n return (this.resolutions_[baseLevel] /\n Math.pow(zoomFactor, clamp(zoom - baseLevel, 0, 1)));\n }\n else {\n return (this.maxResolution_ / Math.pow(this.zoomFactor_, zoom - this.minZoom_));\n }\n };\n /**\n * Fit the given geometry or extent based on the given map size and border.\n * The size is pixel dimensions of the box to fit the extent into.\n * In most cases you will want to use the map size, that is `map.getSize()`.\n * Takes care of the map angle.\n * @param {import(\"./geom/SimpleGeometry.js\").default|import(\"./extent.js\").Extent} geometryOrExtent The geometry or\n * extent to fit the view to.\n * @param {FitOptions} [opt_options] Options.\n * @api\n */\n View.prototype.fit = function (geometryOrExtent, opt_options) {\n /** @type {import(\"./geom/SimpleGeometry.js\").default} */\n var geometry;\n assert(Array.isArray(geometryOrExtent) ||\n typeof ( /** @type {?} */(geometryOrExtent).getSimplifiedGeometry) ===\n 'function', 24); // Invalid extent or geometry provided as `geometry`\n if (Array.isArray(geometryOrExtent)) {\n assert(!isEmpty(geometryOrExtent), 25); // Cannot fit empty extent provided as `geometry`\n var extent = fromUserExtent(geometryOrExtent, this.getProjection());\n geometry = polygonFromExtent(extent);\n }\n else if (geometryOrExtent.getType() === GeometryType.CIRCLE) {\n var extent = fromUserExtent(geometryOrExtent.getExtent(), this.getProjection());\n geometry = polygonFromExtent(extent);\n geometry.rotate(this.getRotation(), getCenter(extent));\n }\n else {\n var userProjection = getUserProjection();\n if (userProjection) {\n geometry = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (geometryOrExtent\n .clone()\n .transform(userProjection, this.getProjection()));\n }\n else {\n geometry = geometryOrExtent;\n }\n }\n this.fitInternal(geometry, opt_options);\n };\n /**\n * Calculate rotated extent\n * @param {import(\"./geom/SimpleGeometry.js\").default} geometry The geometry.\n * @return {import(\"./extent\").Extent} The rotated extent for the geometry.\n */\n View.prototype.rotatedExtentForGeometry = function (geometry) {\n var rotation = this.getRotation();\n var cosAngle = Math.cos(rotation);\n var sinAngle = Math.sin(-rotation);\n var coords = geometry.getFlatCoordinates();\n var stride = geometry.getStride();\n var minRotX = +Infinity;\n var minRotY = +Infinity;\n var maxRotX = -Infinity;\n var maxRotY = -Infinity;\n for (var i = 0, ii = coords.length; i < ii; i += stride) {\n var rotX = coords[i] * cosAngle - coords[i + 1] * sinAngle;\n var rotY = coords[i] * sinAngle + coords[i + 1] * cosAngle;\n minRotX = Math.min(minRotX, rotX);\n minRotY = Math.min(minRotY, rotY);\n maxRotX = Math.max(maxRotX, rotX);\n maxRotY = Math.max(maxRotY, rotY);\n }\n return [minRotX, minRotY, maxRotX, maxRotY];\n };\n /**\n * @param {import(\"./geom/SimpleGeometry.js\").default} geometry The geometry.\n * @param {FitOptions} [opt_options] Options.\n */\n View.prototype.fitInternal = function (geometry, opt_options) {\n var options = opt_options || {};\n var size = options.size;\n if (!size) {\n size = this.getViewportSizeMinusPadding_();\n }\n var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0];\n var nearest = options.nearest !== undefined ? options.nearest : false;\n var minResolution;\n if (options.minResolution !== undefined) {\n minResolution = options.minResolution;\n }\n else if (options.maxZoom !== undefined) {\n minResolution = this.getResolutionForZoom(options.maxZoom);\n }\n else {\n minResolution = 0;\n }\n var rotatedExtent = this.rotatedExtentForGeometry(geometry);\n // calculate resolution\n var resolution = this.getResolutionForExtentInternal(rotatedExtent, [\n size[0] - padding[1] - padding[3],\n size[1] - padding[0] - padding[2],\n ]);\n resolution = isNaN(resolution)\n ? minResolution\n : Math.max(resolution, minResolution);\n resolution = this.getConstrainedResolution(resolution, nearest ? 0 : 1);\n // calculate center\n var rotation = this.getRotation();\n var sinAngle = Math.sin(rotation);\n var cosAngle = Math.cos(rotation);\n var centerRot = getCenter(rotatedExtent);\n centerRot[0] += ((padding[1] - padding[3]) / 2) * resolution;\n centerRot[1] += ((padding[0] - padding[2]) / 2) * resolution;\n var centerX = centerRot[0] * cosAngle - centerRot[1] * sinAngle;\n var centerY = centerRot[1] * cosAngle + centerRot[0] * sinAngle;\n var center = this.getConstrainedCenter([centerX, centerY], resolution);\n var callback = options.callback ? options.callback : VOID;\n if (options.duration !== undefined) {\n this.animateInternal({\n resolution: resolution,\n center: center,\n duration: options.duration,\n easing: options.easing,\n }, callback);\n }\n else {\n this.targetResolution_ = resolution;\n this.targetCenter_ = center;\n this.applyTargetState_(false, true);\n animationCallback(callback, true);\n }\n };\n /**\n * Center on coordinate and view position.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n * @api\n */\n View.prototype.centerOn = function (coordinate, size, position) {\n this.centerOnInternal(fromUserCoordinate(coordinate, this.getProjection()), size, position);\n };\n /**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n */\n View.prototype.centerOnInternal = function (coordinate, size, position) {\n this.setCenterInternal(calculateCenterOn(coordinate, size, position, this.getResolution(), this.getRotation()));\n };\n /**\n * Calculates the shift between map and viewport center.\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array|undefined} Center shift.\n */\n View.prototype.calculateCenterShift = function (center, resolution, rotation, size) {\n var centerShift;\n var padding = this.padding_;\n if (padding && center) {\n var reducedSize = this.getViewportSizeMinusPadding_(-rotation);\n var shiftedCenter = calculateCenterOn(center, size, [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);\n centerShift = [\n center[0] - shiftedCenter[0],\n center[1] - shiftedCenter[1],\n ];\n }\n return centerShift;\n };\n /**\n * @return {boolean} Is defined.\n */\n View.prototype.isDef = function () {\n return !!this.getCenterInternal() && this.getResolution() !== undefined;\n };\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n * @api\n */\n View.prototype.adjustCenter = function (deltaCoordinates) {\n var center = toUserCoordinate(this.targetCenter_, this.getProjection());\n this.setCenter([\n center[0] + deltaCoordinates[0],\n center[1] + deltaCoordinates[1],\n ]);\n };\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n */\n View.prototype.adjustCenterInternal = function (deltaCoordinates) {\n var center = this.targetCenter_;\n this.setCenterInternal([\n center[0] + deltaCoordinates[0],\n center[1] + deltaCoordinates[1],\n ]);\n };\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n * @api\n */\n View.prototype.adjustResolution = function (ratio, opt_anchor) {\n var anchor = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());\n this.adjustResolutionInternal(ratio, anchor);\n };\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n */\n View.prototype.adjustResolutionInternal = function (ratio, opt_anchor) {\n var isMoving = this.getAnimating() || this.getInteracting();\n var size = this.getViewportSize_(this.getRotation());\n var newResolution = this.constraints_.resolution(this.targetResolution_ * ratio, 0, size, isMoving);\n if (opt_anchor) {\n this.targetCenter_ = this.calculateCenterZoom(newResolution, opt_anchor);\n }\n this.targetResolution_ *= ratio;\n this.applyTargetState_();\n };\n /**\n * Adds a value to the view zoom level, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom level.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n * @api\n */\n View.prototype.adjustZoom = function (delta, opt_anchor) {\n this.adjustResolution(Math.pow(this.zoomFactor_, -delta), opt_anchor);\n };\n /**\n * Adds a value to the view rotation, optionally using an anchor. Any rotation\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The rotation center.\n * @api\n */\n View.prototype.adjustRotation = function (delta, opt_anchor) {\n if (opt_anchor) {\n opt_anchor = fromUserCoordinate(opt_anchor, this.getProjection());\n }\n this.adjustRotationInternal(delta, opt_anchor);\n };\n /**\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The rotation center.\n */\n View.prototype.adjustRotationInternal = function (delta, opt_anchor) {\n var isMoving = this.getAnimating() || this.getInteracting();\n var newRotation = this.constraints_.rotation(this.targetRotation_ + delta, isMoving);\n if (opt_anchor) {\n this.targetCenter_ = this.calculateCenterRotate(newRotation, opt_anchor);\n }\n this.targetRotation_ += delta;\n this.applyTargetState_();\n };\n /**\n * Set the center of the current view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n * @observable\n * @api\n */\n View.prototype.setCenter = function (center) {\n this.setCenterInternal(fromUserCoordinate(center, this.getProjection()));\n };\n /**\n * Set the center using the view projection (not the user projection).\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n */\n View.prototype.setCenterInternal = function (center) {\n this.targetCenter_ = center;\n this.applyTargetState_();\n };\n /**\n * @param {import(\"./ViewHint.js\").default} hint Hint.\n * @param {number} delta Delta.\n * @return {number} New value.\n */\n View.prototype.setHint = function (hint, delta) {\n this.hints_[hint] += delta;\n this.changed();\n return this.hints_[hint];\n };\n /**\n * Set the resolution for this view. Any resolution constraint will apply.\n * @param {number|undefined} resolution The resolution of the view.\n * @observable\n * @api\n */\n View.prototype.setResolution = function (resolution) {\n this.targetResolution_ = resolution;\n this.applyTargetState_();\n };\n /**\n * Set the rotation for this view. Any rotation constraint will apply.\n * @param {number} rotation The rotation of the view in radians.\n * @observable\n * @api\n */\n View.prototype.setRotation = function (rotation) {\n this.targetRotation_ = rotation;\n this.applyTargetState_();\n };\n /**\n * Zoom to a specific zoom level. Any resolution constrain will apply.\n * @param {number} zoom Zoom level.\n * @api\n */\n View.prototype.setZoom = function (zoom) {\n this.setResolution(this.getResolutionForZoom(zoom));\n };\n /**\n * Recompute rotation/resolution/center based on target values.\n * Note: we have to compute rotation first, then resolution and center considering that\n * parameters can influence one another in case a view extent constraint is present.\n * @param {boolean} [opt_doNotCancelAnims] Do not cancel animations.\n * @param {boolean} [opt_forceMoving] Apply constraints as if the view is moving.\n * @private\n */\n View.prototype.applyTargetState_ = function (opt_doNotCancelAnims, opt_forceMoving) {\n var isMoving = this.getAnimating() || this.getInteracting() || opt_forceMoving;\n // compute rotation\n var newRotation = this.constraints_.rotation(this.targetRotation_, isMoving);\n var size = this.getViewportSize_(newRotation);\n var newResolution = this.constraints_.resolution(this.targetResolution_, 0, size, isMoving);\n var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, isMoving, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));\n if (this.get(ViewProperty.ROTATION) !== newRotation) {\n this.set(ViewProperty.ROTATION, newRotation);\n }\n if (this.get(ViewProperty.RESOLUTION) !== newResolution) {\n this.set(ViewProperty.RESOLUTION, newResolution);\n }\n if (!this.get(ViewProperty.CENTER) ||\n !equals(this.get(ViewProperty.CENTER), newCenter)) {\n this.set(ViewProperty.CENTER, newCenter);\n }\n if (this.getAnimating() && !opt_doNotCancelAnims) {\n this.cancelAnimations();\n }\n this.cancelAnchor_ = undefined;\n };\n /**\n * If any constraints need to be applied, an animation will be triggered.\n * This is typically done on interaction end.\n * Note: calling this with a duration of 0 will apply the constrained values straight away,\n * without animation.\n * @param {number} [opt_duration] The animation duration in ms.\n * @param {number} [opt_resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n */\n View.prototype.resolveConstraints = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n var duration = opt_duration !== undefined ? opt_duration : 200;\n var direction = opt_resolutionDirection || 0;\n var newRotation = this.constraints_.rotation(this.targetRotation_);\n var size = this.getViewportSize_(newRotation);\n var newResolution = this.constraints_.resolution(this.targetResolution_, direction, size);\n var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, false, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));\n if (duration === 0 && !this.cancelAnchor_) {\n this.targetResolution_ = newResolution;\n this.targetRotation_ = newRotation;\n this.targetCenter_ = newCenter;\n this.applyTargetState_();\n return;\n }\n var anchor = opt_anchor || (duration === 0 ? this.cancelAnchor_ : undefined);\n this.cancelAnchor_ = undefined;\n if (this.getResolution() !== newResolution ||\n this.getRotation() !== newRotation ||\n !this.getCenterInternal() ||\n !equals(this.getCenterInternal(), newCenter)) {\n if (this.getAnimating()) {\n this.cancelAnimations();\n }\n this.animateInternal({\n rotation: newRotation,\n center: newCenter,\n resolution: newResolution,\n duration: duration,\n easing: easeOut,\n anchor: anchor,\n });\n }\n };\n /**\n * Notify the View that an interaction has started.\n * The view state will be resolved to a stable one if needed\n * (depending on its constraints).\n * @api\n */\n View.prototype.beginInteraction = function () {\n this.resolveConstraints(0);\n this.setHint(ViewHint.INTERACTING, 1);\n };\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number} [opt_duration] Animation duration in ms.\n * @param {number} [opt_resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n * @api\n */\n View.prototype.endInteraction = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n var anchor = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());\n this.endInteractionInternal(opt_duration, opt_resolutionDirection, anchor);\n };\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number} [opt_duration] Animation duration in ms.\n * @param {number} [opt_resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [opt_anchor] The origin of the transformation.\n */\n View.prototype.endInteractionInternal = function (opt_duration, opt_resolutionDirection, opt_anchor) {\n this.setHint(ViewHint.INTERACTING, -1);\n this.resolveConstraints(opt_duration, opt_resolutionDirection, opt_anchor);\n };\n /**\n * Get a valid position for the view center according to the current constraints.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} targetCenter Target center position.\n * @param {number} [opt_targetResolution] Target resolution. If not supplied, the current one will be used.\n * This is useful to guess a valid center position at a different zoom level.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Valid center position.\n */\n View.prototype.getConstrainedCenter = function (targetCenter, opt_targetResolution) {\n var size = this.getViewportSize_(this.getRotation());\n return this.constraints_.center(targetCenter, opt_targetResolution || this.getResolution(), size);\n };\n /**\n * Get a valid zoom level according to the current view constraints.\n * @param {number|undefined} targetZoom Target zoom.\n * @param {number} [opt_direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid zoom level.\n */\n View.prototype.getConstrainedZoom = function (targetZoom, opt_direction) {\n var targetRes = this.getResolutionForZoom(targetZoom);\n return this.getZoomForResolution(this.getConstrainedResolution(targetRes, opt_direction));\n };\n /**\n * Get a valid resolution according to the current view constraints.\n * @param {number|undefined} targetResolution Target resolution.\n * @param {number} [opt_direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid resolution.\n */\n View.prototype.getConstrainedResolution = function (targetResolution, opt_direction) {\n var direction = opt_direction || 0;\n var size = this.getViewportSize_(this.getRotation());\n return this.constraints_.resolution(targetResolution, direction, size);\n };\n return View;\n}(BaseObject));\n/**\n * @param {Function} callback Callback.\n * @param {*} returnValue Return value.\n */\nfunction animationCallback(callback, returnValue) {\n setTimeout(function () {\n callback(returnValue);\n }, 0);\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./centerconstraint.js\").Type} The constraint.\n */\nexport function createCenterConstraint(options) {\n if (options.extent !== undefined) {\n var smooth = options.smoothExtentConstraint !== undefined\n ? options.smoothExtentConstraint\n : true;\n return createExtent(options.extent, options.constrainOnlyCenter, smooth);\n }\n var projection = createProjection(options.projection, 'EPSG:3857');\n if (options.multiWorld !== true && projection.isGlobal()) {\n var extent = projection.getExtent().slice();\n extent[0] = -Infinity;\n extent[2] = Infinity;\n return createExtent(extent, false, false);\n }\n return centerNone;\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {{constraint: import(\"./resolutionconstraint.js\").Type, maxResolution: number,\n * minResolution: number, minZoom: number, zoomFactor: number}} The constraint.\n */\nexport function createResolutionConstraint(options) {\n var resolutionConstraint;\n var maxResolution;\n var minResolution;\n // TODO: move these to be ol constants\n // see https://github.com/openlayers/openlayers/issues/2076\n var defaultMaxZoom = 28;\n var defaultZoomFactor = 2;\n var minZoom = options.minZoom !== undefined ? options.minZoom : DEFAULT_MIN_ZOOM;\n var maxZoom = options.maxZoom !== undefined ? options.maxZoom : defaultMaxZoom;\n var zoomFactor = options.zoomFactor !== undefined ? options.zoomFactor : defaultZoomFactor;\n var multiWorld = options.multiWorld !== undefined ? options.multiWorld : false;\n var smooth = options.smoothResolutionConstraint !== undefined\n ? options.smoothResolutionConstraint\n : true;\n var showFullExtent = options.showFullExtent !== undefined ? options.showFullExtent : false;\n var projection = createProjection(options.projection, 'EPSG:3857');\n var projExtent = projection.getExtent();\n var constrainOnlyCenter = options.constrainOnlyCenter;\n var extent = options.extent;\n if (!multiWorld && !extent && projection.isGlobal()) {\n constrainOnlyCenter = false;\n extent = projExtent;\n }\n if (options.resolutions !== undefined) {\n var resolutions = options.resolutions;\n maxResolution = resolutions[minZoom];\n minResolution =\n resolutions[maxZoom] !== undefined\n ? resolutions[maxZoom]\n : resolutions[resolutions.length - 1];\n if (options.constrainResolution) {\n resolutionConstraint = createSnapToResolutions(resolutions, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n }\n else {\n // calculate the default min and max resolution\n var size = !projExtent\n ? // use an extent that can fit the whole world if need be\n (360 * METERS_PER_UNIT[Units.DEGREES]) / projection.getMetersPerUnit()\n : Math.max(getWidth(projExtent), getHeight(projExtent));\n var defaultMaxResolution = size / DEFAULT_TILE_SIZE / Math.pow(defaultZoomFactor, DEFAULT_MIN_ZOOM);\n var defaultMinResolution = defaultMaxResolution /\n Math.pow(defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM);\n // user provided maxResolution takes precedence\n maxResolution = options.maxResolution;\n if (maxResolution !== undefined) {\n minZoom = 0;\n }\n else {\n maxResolution = defaultMaxResolution / Math.pow(zoomFactor, minZoom);\n }\n // user provided minResolution takes precedence\n minResolution = options.minResolution;\n if (minResolution === undefined) {\n if (options.maxZoom !== undefined) {\n if (options.maxResolution !== undefined) {\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);\n }\n else {\n minResolution = defaultMaxResolution / Math.pow(zoomFactor, maxZoom);\n }\n }\n else {\n minResolution = defaultMinResolution;\n }\n }\n // given discrete zoom levels, minResolution may be different than provided\n maxZoom =\n minZoom +\n Math.floor(Math.log(maxResolution / minResolution) / Math.log(zoomFactor));\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom);\n if (options.constrainResolution) {\n resolutionConstraint = createSnapToPower(zoomFactor, maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n else {\n resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n }\n return {\n constraint: resolutionConstraint,\n maxResolution: maxResolution,\n minResolution: minResolution,\n minZoom: minZoom,\n zoomFactor: zoomFactor,\n };\n}\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./rotationconstraint.js\").Type} Rotation constraint.\n */\nexport function createRotationConstraint(options) {\n var enableRotation = options.enableRotation !== undefined ? options.enableRotation : true;\n if (enableRotation) {\n var constrainRotation = options.constrainRotation;\n if (constrainRotation === undefined || constrainRotation === true) {\n return createSnapToZero();\n }\n else if (constrainRotation === false) {\n return rotationNone;\n }\n else if (typeof constrainRotation === 'number') {\n return createSnapToN(constrainRotation);\n }\n else {\n return rotationNone;\n }\n }\n else {\n return disable;\n }\n}\n/**\n * Determine if an animation involves no view change.\n * @param {Animation} animation The animation.\n * @return {boolean} The animation involves no view change.\n */\nexport function isNoopAnimation(animation) {\n if (animation.sourceCenter && animation.targetCenter) {\n if (!coordinatesEqual(animation.sourceCenter, animation.targetCenter)) {\n return false;\n }\n }\n if (animation.sourceResolution !== animation.targetResolution) {\n return false;\n }\n if (animation.sourceRotation !== animation.targetRotation) {\n return false;\n }\n return true;\n}\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @return {import(\"./coordinate.js\").Coordinate} Shifted center.\n */\nfunction calculateCenterOn(coordinate, size, position, resolution, rotation) {\n // calculate rotated position\n var cosAngle = Math.cos(-rotation);\n var sinAngle = Math.sin(-rotation);\n var rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n var rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n rotX += (size[0] / 2 - position[0]) * resolution;\n rotY += (position[1] - size[1] / 2) * resolution;\n // go back to original angle\n sinAngle = -sinAngle; // go back to original rotation\n var centerX = rotX * cosAngle - rotY * sinAngle;\n var centerY = rotY * cosAngle + rotX * sinAngle;\n return [centerX, centerY];\n}\nexport default View;\n//# sourceMappingURL=View.js.map","/**\n * @module ol/size\n */\n/**\n * An array of numbers representing a size: `[width, height]`.\n * @typedef {Array} Size\n * @api\n */\n/**\n * Returns a buffered size.\n * @param {Size} size Size.\n * @param {number} num The amount by which to buffer.\n * @param {Size} [opt_size] Optional reusable size array.\n * @return {Size} The buffered size.\n */\nexport function buffer(size, num, opt_size) {\n if (opt_size === undefined) {\n opt_size = [0, 0];\n }\n opt_size[0] = size[0] + 2 * num;\n opt_size[1] = size[1] + 2 * num;\n return opt_size;\n}\n/**\n * Determines if a size has a positive area.\n * @param {Size} size The size to test.\n * @return {boolean} The size has a positive area.\n */\nexport function hasArea(size) {\n return size[0] > 0 && size[1] > 0;\n}\n/**\n * Returns a size scaled by a ratio. The result will be an array of integers.\n * @param {Size} size Size.\n * @param {number} ratio Ratio.\n * @param {Size} [opt_size] Optional reusable size array.\n * @return {Size} The scaled size.\n */\nexport function scale(size, ratio, opt_size) {\n if (opt_size === undefined) {\n opt_size = [0, 0];\n }\n opt_size[0] = (size[0] * ratio + 0.5) | 0;\n opt_size[1] = (size[1] * ratio + 0.5) | 0;\n return opt_size;\n}\n/**\n * Returns an `Size` array for the passed in number (meaning: square) or\n * `Size` array.\n * (meaning: non-square),\n * @param {number|Size} size Width and height.\n * @param {Size} [opt_size] Optional reusable size array.\n * @return {Size} Size.\n * @api\n */\nexport function toSize(size, opt_size) {\n if (Array.isArray(size)) {\n return size;\n }\n else {\n if (opt_size === undefined) {\n opt_size = [size, size];\n }\n else {\n opt_size[0] = size;\n opt_size[1] = size;\n }\n return opt_size;\n }\n}\n//# sourceMappingURL=size.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/PluggableMap\n */\nimport BaseObject from './Object.js';\nimport Collection from './Collection.js';\nimport CollectionEventType from './CollectionEventType.js';\nimport EventType from './events/EventType.js';\nimport LayerGroup from './layer/Group.js';\nimport MapBrowserEvent from './MapBrowserEvent.js';\nimport MapBrowserEventHandler from './MapBrowserEventHandler.js';\nimport MapBrowserEventType from './MapBrowserEventType.js';\nimport MapEvent from './MapEvent.js';\nimport MapEventType from './MapEventType.js';\nimport MapProperty from './MapProperty.js';\nimport ObjectEventType from './ObjectEventType.js';\nimport PointerEventType from './pointer/EventType.js';\nimport RenderEventType from './render/EventType.js';\nimport TileQueue, { getTilePriority } from './TileQueue.js';\nimport View from './View.js';\nimport ViewHint from './ViewHint.js';\nimport { DEVICE_PIXEL_RATIO, PASSIVE_EVENT_LISTENERS } from './has.js';\nimport { TRUE } from './functions.js';\nimport { apply as applyTransform, create as createTransform, } from './transform.js';\nimport { assert } from './asserts.js';\nimport { clone, createOrUpdateEmpty, equals, getForViewAndSize, isEmpty, } from './extent.js';\nimport { fromUserCoordinate, toUserCoordinate } from './proj.js';\nimport { hasArea } from './size.js';\nimport { listen, unlistenByKey } from './events.js';\nimport { removeNode } from './dom.js';\n/**\n * State of the current frame. Only `pixelRatio`, `time` and `viewState` should\n * be used in applications.\n * @typedef {Object} FrameState\n * @property {number} pixelRatio The pixel ratio of the frame.\n * @property {number} time The time when rendering of the frame was requested.\n * @property {import(\"./View.js\").State} viewState The state of the current view.\n * @property {boolean} animate Animate.\n * @property {import(\"./transform.js\").Transform} coordinateToPixelTransform CoordinateToPixelTransform.\n * @property {import(\"rbush\").default} declutterTree DeclutterTree.\n * @property {null|import(\"./extent.js\").Extent} extent Extent.\n * @property {number} index Index.\n * @property {Array} layerStatesArray LayerStatesArray.\n * @property {number} layerIndex LayerIndex.\n * @property {import(\"./transform.js\").Transform} pixelToCoordinateTransform PixelToCoordinateTransform.\n * @property {Array} postRenderFunctions PostRenderFunctions.\n * @property {import(\"./size.js\").Size} size Size.\n * @property {TileQueue} tileQueue TileQueue.\n * @property {!Object>} usedTiles UsedTiles.\n * @property {Array} viewHints ViewHints.\n * @property {!Object>} wantedTiles WantedTiles.\n */\n/**\n * @typedef {function(PluggableMap, ?FrameState): any} PostRenderFunction\n */\n/**\n * @typedef {Object} AtPixelOptions\n * @property {undefined|function(import(\"./layer/Layer.js\").default): boolean} [layerFilter] Layer filter\n * function. The filter function will receive one argument, the\n * {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.\n * Only layers which are visible and for which this function returns `true`\n * will be tested for features. By default, all visible layers will be tested.\n * @property {number} [hitTolerance=0] Hit-detection tolerance in css pixels. Pixels\n * inside the radius around the given position will be checked for features.\n * @property {boolean} [checkWrapped=true] Check-Wrapped Will check for for wrapped geometries inside the range of\n * +/- 1 world width. Works only if a projection is used that can be wrapped.\n */\n/**\n * @typedef {Object} MapOptionsInternal\n * @property {Collection} [controls] Controls.\n * @property {Collection} [interactions] Interactions.\n * @property {HTMLElement|Document} keyboardEventTarget KeyboardEventTarget.\n * @property {Collection} overlays Overlays.\n * @property {Object} values Values.\n */\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:layergroup'|'change:size'|'change:target'|'change:view'} MapObjectEventTypes\n */\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} PluggableMapOnSignature\n */\n/**\n * Object literal with config options for the map.\n * @typedef {Object} MapOptions\n * @property {Collection|Array} [controls]\n * Controls initially added to the map. If not specified,\n * {@link module:ol/control.defaults} is used.\n * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between\n * physical pixels and device-independent pixels (dips) on the device.\n * @property {Collection|Array} [interactions]\n * Interactions that are initially added to the map. If not specified,\n * {@link module:ol/interaction.defaults} is used.\n * @property {HTMLElement|Document|string} [keyboardEventTarget] The element to\n * listen to keyboard events on. This determines when the `KeyboardPan` and\n * `KeyboardZoom` interactions trigger. For example, if this option is set to\n * `document` the keyboard interactions will always trigger. If this option is\n * not specified, the element the library listens to keyboard events on is the\n * map target (i.e. the user-provided div for the map). If this is not\n * `document`, the target element needs to be focused for key events to be\n * emitted, requiring that the target element has a `tabindex` attribute.\n * @property {Array|Collection|LayerGroup} [layers]\n * Layers. If this is not defined, a map with no layers will be rendered. Note\n * that layers are rendered in the order supplied, so if you want, for example,\n * a vector layer to appear on top of a tile layer, it must come after the tile\n * layer.\n * @property {number} [maxTilesLoading=16] Maximum number tiles to load\n * simultaneously.\n * @property {number} [moveTolerance=1] The minimum distance in pixels the\n * cursor must move to be detected as a map move event instead of a click.\n * Increasing this value can make it easier to click on the map.\n * @property {Collection|Array} [overlays]\n * Overlays initially added to the map. By default, no overlays are added.\n * @property {HTMLElement|string} [target] The container for the map, either the\n * element itself or the `id` of the element. If not specified at construction\n * time, {@link module:ol/Map~Map#setTarget} must be called for the map to be\n * rendered. If passed by element, the container can be in a secondary document.\n * @property {View} [view] The map's view. No layer sources will be\n * fetched unless this is specified at construction time or through\n * {@link module:ol/Map~Map#setView}.\n */\n/**\n * @api\n */\nvar PluggableMap = /** @class */ (function (_super) {\n __extends(PluggableMap, _super);\n /**\n * @param {MapOptions} options Map options.\n */\n function PluggableMap(options) {\n var _this = _super.call(this) || this;\n /***\n * @type {PluggableMapOnSignature}\n */\n _this.on;\n /***\n * @type {PluggableMapOnSignature}\n */\n _this.once;\n /***\n * @type {PluggableMapOnSignature}\n */\n _this.un;\n var optionsInternal = createOptionsInternal(options);\n /** @private */\n _this.boundHandleBrowserEvent_ = _this.handleBrowserEvent.bind(_this);\n /**\n * @type {number}\n * @private\n */\n _this.maxTilesLoading_ =\n options.maxTilesLoading !== undefined ? options.maxTilesLoading : 16;\n /**\n * @private\n * @type {number}\n */\n _this.pixelRatio_ =\n options.pixelRatio !== undefined\n ? options.pixelRatio\n : DEVICE_PIXEL_RATIO;\n /**\n * @private\n * @type {*}\n */\n _this.postRenderTimeoutHandle_;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.animationDelayKey_;\n /**\n * @private\n */\n _this.animationDelay_ = /** @this {PluggableMap} */ function () {\n this.animationDelayKey_ = undefined;\n this.renderFrame_(Date.now());\n }.bind(_this);\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n _this.coordinateToPixelTransform_ = createTransform();\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n _this.pixelToCoordinateTransform_ = createTransform();\n /**\n * @private\n * @type {number}\n */\n _this.frameIndex_ = 0;\n /**\n * @private\n * @type {?FrameState}\n */\n _this.frameState_ = null;\n /**\n * The extent at the previous 'moveend' event.\n * @private\n * @type {import(\"./extent.js\").Extent}\n */\n _this.previousExtent_ = null;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.viewPropertyListenerKey_ = null;\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n _this.viewChangeListenerKey_ = null;\n /**\n * @private\n * @type {?Array}\n */\n _this.layerGroupPropertyListenerKeys_ = null;\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.viewport_ = document.createElement('div');\n _this.viewport_.className =\n 'ol-viewport' + ('ontouchstart' in window ? ' ol-touch' : '');\n _this.viewport_.style.position = 'relative';\n _this.viewport_.style.overflow = 'hidden';\n _this.viewport_.style.width = '100%';\n _this.viewport_.style.height = '100%';\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.overlayContainer_ = document.createElement('div');\n _this.overlayContainer_.style.position = 'absolute';\n _this.overlayContainer_.style.zIndex = '0';\n _this.overlayContainer_.style.width = '100%';\n _this.overlayContainer_.style.height = '100%';\n _this.overlayContainer_.style.pointerEvents = 'none';\n _this.overlayContainer_.className = 'ol-overlaycontainer';\n _this.viewport_.appendChild(_this.overlayContainer_);\n /**\n * @private\n * @type {!HTMLElement}\n */\n _this.overlayContainerStopEvent_ = document.createElement('div');\n _this.overlayContainerStopEvent_.style.position = 'absolute';\n _this.overlayContainerStopEvent_.style.zIndex = '0';\n _this.overlayContainerStopEvent_.style.width = '100%';\n _this.overlayContainerStopEvent_.style.height = '100%';\n _this.overlayContainerStopEvent_.style.pointerEvents = 'none';\n _this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';\n _this.viewport_.appendChild(_this.overlayContainerStopEvent_);\n /**\n * @private\n * @type {MapBrowserEventHandler}\n */\n _this.mapBrowserEventHandler_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.moveTolerance_ = options.moveTolerance;\n /**\n * @private\n * @type {HTMLElement|Document}\n */\n _this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;\n /**\n * @private\n * @type {?Array}\n */\n _this.keyHandlerKeys_ = null;\n /**\n * @type {Collection}\n * @protected\n */\n _this.controls = optionsInternal.controls || new Collection();\n /**\n * @type {Collection}\n * @protected\n */\n _this.interactions = optionsInternal.interactions || new Collection();\n /**\n * @type {Collection}\n * @private\n */\n _this.overlays_ = optionsInternal.overlays;\n /**\n * A lookup of overlays by id.\n * @private\n * @type {Object}\n */\n _this.overlayIdIndex_ = {};\n /**\n * @type {import(\"./renderer/Map.js\").default}\n * @private\n */\n _this.renderer_ = null;\n /**\n * @type {undefined|function(Event): void}\n * @private\n */\n _this.handleResize_;\n /**\n * @private\n * @type {!Array}\n */\n _this.postRenderFunctions_ = [];\n /**\n * @private\n * @type {TileQueue}\n */\n _this.tileQueue_ = new TileQueue(_this.getTilePriority.bind(_this), _this.handleTileChange_.bind(_this));\n _this.addChangeListener(MapProperty.LAYERGROUP, _this.handleLayerGroupChanged_);\n _this.addChangeListener(MapProperty.VIEW, _this.handleViewChanged_);\n _this.addChangeListener(MapProperty.SIZE, _this.handleSizeChanged_);\n _this.addChangeListener(MapProperty.TARGET, _this.handleTargetChanged_);\n // setProperties will trigger the rendering of the map if the map\n // is \"defined\" already.\n _this.setProperties(optionsInternal.values);\n _this.controls.forEach(\n /**\n * @param {import(\"./control/Control.js\").default} control Control.\n * @this {PluggableMap}\n */\n function (control) {\n control.setMap(this);\n }.bind(_this));\n _this.controls.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(this);\n }.bind(_this));\n _this.controls.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(null);\n }.bind(_this));\n _this.interactions.forEach(\n /**\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction.\n * @this {PluggableMap}\n */\n function (interaction) {\n interaction.setMap(this);\n }.bind(_this));\n _this.interactions.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(this);\n }.bind(_this));\n _this.interactions.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n event.element.setMap(null);\n }.bind(_this));\n _this.overlays_.forEach(_this.addOverlayInternal_.bind(_this));\n _this.overlays_.addEventListener(CollectionEventType.ADD, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n this.addOverlayInternal_(\n /** @type {import(\"./Overlay.js\").default} */ (event.element));\n }.bind(_this));\n _this.overlays_.addEventListener(CollectionEventType.REMOVE, \n /**\n * @param {import(\"./Collection.js\").CollectionEvent} event CollectionEvent.\n */\n function (event) {\n var overlay = /** @type {import(\"./Overlay.js\").default} */ (event.element);\n var id = overlay.getId();\n if (id !== undefined) {\n delete this.overlayIdIndex_[id.toString()];\n }\n event.element.setMap(null);\n }.bind(_this));\n return _this;\n }\n /**\n * @abstract\n * @return {import(\"./renderer/Map.js\").default} The map renderer\n */\n PluggableMap.prototype.createRenderer = function () {\n throw new Error('Use a map type that has a createRenderer method');\n };\n /**\n * Add the given control to the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @api\n */\n PluggableMap.prototype.addControl = function (control) {\n this.getControls().push(control);\n };\n /**\n * Add the given interaction to the map. If you want to add an interaction\n * at another point of the collection use `getInteraction()` and the methods\n * available on {@link module:ol/Collection~Collection}. This can be used to\n * stop the event propagation from the handleEvent function. The interactions\n * get to handle the events in the reverse order of this collection.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to add.\n * @api\n */\n PluggableMap.prototype.addInteraction = function (interaction) {\n this.getInteractions().push(interaction);\n };\n /**\n * Adds the given layer to the top of this map. If you want to add a layer\n * elsewhere in the stack, use `getLayers()` and the methods available on\n * {@link module:ol/Collection~Collection}.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @api\n */\n PluggableMap.prototype.addLayer = function (layer) {\n var layers = this.getLayerGroup().getLayers();\n layers.push(layer);\n };\n /**\n * Add the given overlay to the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @api\n */\n PluggableMap.prototype.addOverlay = function (overlay) {\n this.getOverlays().push(overlay);\n };\n /**\n * This deals with map's overlay collection changes.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @private\n */\n PluggableMap.prototype.addOverlayInternal_ = function (overlay) {\n var id = overlay.getId();\n if (id !== undefined) {\n this.overlayIdIndex_[id.toString()] = overlay;\n }\n overlay.setMap(this);\n };\n /**\n *\n * Clean up.\n */\n PluggableMap.prototype.disposeInternal = function () {\n this.setTarget(null);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Detect features that intersect a pixel on the viewport, and execute a\n * callback with each intersecting feature. Layers included in the detection can\n * be configured through the `layerFilter` option in `opt_options`.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {function(import(\"./Feature.js\").FeatureLike, import(\"./layer/Layer.js\").default, import(\"./geom/SimpleGeometry.js\").default): T} callback Feature callback. The callback will be\n * called with two arguments. The first argument is one\n * {@link module:ol/Feature feature} or\n * {@link module:ol/render/Feature render feature} at the pixel, the second is\n * the {@link module:ol/layer/Layer layer} of the feature and will be null for\n * unmanaged layers. To stop detection, callback functions can return a\n * truthy value.\n * @param {AtPixelOptions} [opt_options] Optional options.\n * @return {T|undefined} Callback result, i.e. the return value of last\n * callback execution, or the first truthy callback return value.\n * @template S,T\n * @api\n */\n PluggableMap.prototype.forEachFeatureAtPixel = function (pixel, callback, opt_options) {\n if (!this.frameState_) {\n return;\n }\n var coordinate = this.getCoordinateFromPixelInternal(pixel);\n opt_options = opt_options !== undefined ? opt_options : {};\n var hitTolerance = opt_options.hitTolerance !== undefined ? opt_options.hitTolerance : 0;\n var layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;\n var checkWrapped = opt_options.checkWrapped !== false;\n return this.renderer_.forEachFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, callback, null, layerFilter, null);\n };\n /**\n * Get all features that intersect a pixel on the viewport.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions} [opt_options] Optional options.\n * @return {Array} The detected features or\n * an empty array if none were found.\n * @api\n */\n PluggableMap.prototype.getFeaturesAtPixel = function (pixel, opt_options) {\n var features = [];\n this.forEachFeatureAtPixel(pixel, function (feature) {\n features.push(feature);\n }, opt_options);\n return features;\n };\n /**\n * Detect layers that have a color value at a pixel on the viewport, and\n * execute a callback with each matching layer. Layers included in the\n * detection can be configured through `opt_layerFilter`.\n *\n * Note: this may give false positives unless the map layers have had different `className`\n * properties assigned to them.\n *\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {function(this: S, import(\"./layer/Layer.js\").default, (Uint8ClampedArray|Uint8Array)): T} callback\n * Layer callback. This callback will receive two arguments: first is the\n * {@link module:ol/layer/Layer layer}, second argument is an array representing\n * [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types\n * that do not currently support this argument. To stop detection, callback\n * functions can return a truthy value.\n * @param {AtPixelOptions} [opt_options] Configuration options.\n * @return {T|undefined} Callback result, i.e. the return value of last\n * callback execution, or the first truthy callback return value.\n * @template S,T\n * @api\n */\n PluggableMap.prototype.forEachLayerAtPixel = function (pixel, callback, opt_options) {\n if (!this.frameState_) {\n return;\n }\n var options = opt_options || {};\n var hitTolerance = options.hitTolerance !== undefined ? options.hitTolerance : 0;\n var layerFilter = options.layerFilter || TRUE;\n return this.renderer_.forEachLayerAtPixel(pixel, this.frameState_, hitTolerance, callback, layerFilter);\n };\n /**\n * Detect if features intersect a pixel on the viewport. Layers included in the\n * detection can be configured through `opt_layerFilter`.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions} [opt_options] Optional options.\n * @return {boolean} Is there a feature at the given pixel?\n * @api\n */\n PluggableMap.prototype.hasFeatureAtPixel = function (pixel, opt_options) {\n if (!this.frameState_) {\n return false;\n }\n var coordinate = this.getCoordinateFromPixelInternal(pixel);\n opt_options = opt_options !== undefined ? opt_options : {};\n var layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;\n var hitTolerance = opt_options.hitTolerance !== undefined ? opt_options.hitTolerance : 0;\n var checkWrapped = opt_options.checkWrapped !== false;\n return this.renderer_.hasFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, layerFilter, null);\n };\n /**\n * Returns the coordinate in user projection for a browser event.\n * @param {MouseEvent} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\n PluggableMap.prototype.getEventCoordinate = function (event) {\n return this.getCoordinateFromPixel(this.getEventPixel(event));\n };\n /**\n * Returns the coordinate in view projection for a browser event.\n * @param {MouseEvent} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n */\n PluggableMap.prototype.getEventCoordinateInternal = function (event) {\n return this.getCoordinateFromPixelInternal(this.getEventPixel(event));\n };\n /**\n * Returns the map pixel position for a browser event relative to the viewport.\n * @param {UIEvent} event Event.\n * @return {import(\"./pixel.js\").Pixel} Pixel.\n * @api\n */\n PluggableMap.prototype.getEventPixel = function (event) {\n var viewportPosition = this.viewport_.getBoundingClientRect();\n var eventPosition = \n //FIXME Are we really calling this with a TouchEvent anywhere?\n 'changedTouches' in event\n ? /** @type {TouchEvent} */ (event).changedTouches[0]\n : /** @type {MouseEvent} */ (event);\n return [\n eventPosition.clientX - viewportPosition.left,\n eventPosition.clientY - viewportPosition.top,\n ];\n };\n /**\n * Get the target in which this map is rendered.\n * Note that this returns what is entered as an option or in setTarget:\n * if that was an element, it returns an element; if a string, it returns that.\n * @return {HTMLElement|string|undefined} The Element or id of the Element that the\n * map is rendered in.\n * @observable\n * @api\n */\n PluggableMap.prototype.getTarget = function () {\n return /** @type {HTMLElement|string|undefined} */ (this.get(MapProperty.TARGET));\n };\n /**\n * Get the DOM element into which this map is rendered. In contrast to\n * `getTarget` this method always return an `Element`, or `null` if the\n * map has no target.\n * @return {HTMLElement} The element that the map is rendered in.\n * @api\n */\n PluggableMap.prototype.getTargetElement = function () {\n var target = this.getTarget();\n if (target !== undefined) {\n return typeof target === 'string'\n ? document.getElementById(target)\n : target;\n }\n else {\n return null;\n }\n };\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * user projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n * @api\n */\n PluggableMap.prototype.getCoordinateFromPixel = function (pixel) {\n return toUserCoordinate(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());\n };\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * map view projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n */\n PluggableMap.prototype.getCoordinateFromPixelInternal = function (pixel) {\n var frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n else {\n return applyTransform(frameState.pixelToCoordinateTransform, pixel.slice());\n }\n };\n /**\n * Get the map controls. Modifying this collection changes the controls\n * associated with the map.\n * @return {Collection} Controls.\n * @api\n */\n PluggableMap.prototype.getControls = function () {\n return this.controls;\n };\n /**\n * Get the map overlays. Modifying this collection changes the overlays\n * associated with the map.\n * @return {Collection} Overlays.\n * @api\n */\n PluggableMap.prototype.getOverlays = function () {\n return this.overlays_;\n };\n /**\n * Get an overlay by its identifier (the value returned by overlay.getId()).\n * Note that the index treats string and numeric identifiers as the same. So\n * `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.\n * @param {string|number} id Overlay identifier.\n * @return {import(\"./Overlay.js\").default} Overlay.\n * @api\n */\n PluggableMap.prototype.getOverlayById = function (id) {\n var overlay = this.overlayIdIndex_[id.toString()];\n return overlay !== undefined ? overlay : null;\n };\n /**\n * Get the map interactions. Modifying this collection changes the interactions\n * associated with the map.\n *\n * Interactions are used for e.g. pan, zoom and rotate.\n * @return {Collection} Interactions.\n * @api\n */\n PluggableMap.prototype.getInteractions = function () {\n return this.interactions;\n };\n /**\n * Get the layergroup associated with this map.\n * @return {LayerGroup} A layer group containing the layers in this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.getLayerGroup = function () {\n return /** @type {LayerGroup} */ (this.get(MapProperty.LAYERGROUP));\n };\n /**\n * Get the collection of layers associated with this map.\n * @return {!Collection} Layers.\n * @api\n */\n PluggableMap.prototype.getLayers = function () {\n var layers = this.getLayerGroup().getLayers();\n return layers;\n };\n /**\n * @return {boolean} Layers have sources that are still loading.\n */\n PluggableMap.prototype.getLoading = function () {\n var layerStatesArray = this.getLayerGroup().getLayerStatesArray();\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layer = layerStatesArray[i].layer;\n var source = /** @type {import(\"./layer/Layer.js\").default} */ (layer).getSource();\n if (source && source.loading) {\n return true;\n }\n }\n return false;\n };\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the user\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n * @api\n */\n PluggableMap.prototype.getPixelFromCoordinate = function (coordinate) {\n var viewCoordinate = fromUserCoordinate(coordinate, this.getView().getProjection());\n return this.getPixelFromCoordinateInternal(viewCoordinate);\n };\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the map view\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n */\n PluggableMap.prototype.getPixelFromCoordinateInternal = function (coordinate) {\n var frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n else {\n return applyTransform(frameState.coordinateToPixelTransform, coordinate.slice(0, 2));\n }\n };\n /**\n * Get the map renderer.\n * @return {import(\"./renderer/Map.js\").default} Renderer\n */\n PluggableMap.prototype.getRenderer = function () {\n return this.renderer_;\n };\n /**\n * Get the size of this map.\n * @return {import(\"./size.js\").Size|undefined} The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n PluggableMap.prototype.getSize = function () {\n return /** @type {import(\"./size.js\").Size|undefined} */ (this.get(MapProperty.SIZE));\n };\n /**\n * Get the view associated with this map. A view manages properties such as\n * center and resolution.\n * @return {View} The view that controls this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.getView = function () {\n return /** @type {View} */ (this.get(MapProperty.VIEW));\n };\n /**\n * Get the element that serves as the map viewport.\n * @return {HTMLElement} Viewport.\n * @api\n */\n PluggableMap.prototype.getViewport = function () {\n return this.viewport_;\n };\n /**\n * Get the element that serves as the container for overlays. Elements added to\n * this container will let mousedown and touchstart events through to the map,\n * so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}\n * events.\n * @return {!HTMLElement} The map's overlay container.\n */\n PluggableMap.prototype.getOverlayContainer = function () {\n return this.overlayContainer_;\n };\n /**\n * Get the element that serves as a container for overlays that don't allow\n * event propagation. Elements added to this container won't let mousedown and\n * touchstart events through to the map, so clicks and gestures on an overlay\n * don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @return {!HTMLElement} The map's overlay container that stops events.\n */\n PluggableMap.prototype.getOverlayContainerStopEvent = function () {\n return this.overlayContainerStopEvent_;\n };\n /**\n * @return {!Document} The document where the map is displayed.\n */\n PluggableMap.prototype.getOwnerDocument = function () {\n var targetElement = this.getTargetElement();\n return targetElement ? targetElement.ownerDocument : document;\n };\n /**\n * @param {import(\"./Tile.js\").default} tile Tile.\n * @param {string} tileSourceKey Tile source key.\n * @param {import(\"./coordinate.js\").Coordinate} tileCenter Tile center.\n * @param {number} tileResolution Tile resolution.\n * @return {number} Tile priority.\n */\n PluggableMap.prototype.getTilePriority = function (tile, tileSourceKey, tileCenter, tileResolution) {\n return getTilePriority(this.frameState_, tile, tileSourceKey, tileCenter, tileResolution);\n };\n /**\n * @param {UIEvent} browserEvent Browser event.\n * @param {string} [opt_type] Type.\n */\n PluggableMap.prototype.handleBrowserEvent = function (browserEvent, opt_type) {\n var type = opt_type || browserEvent.type;\n var mapBrowserEvent = new MapBrowserEvent(type, this, browserEvent);\n this.handleMapBrowserEvent(mapBrowserEvent);\n };\n /**\n * @param {MapBrowserEvent} mapBrowserEvent The event to handle.\n */\n PluggableMap.prototype.handleMapBrowserEvent = function (mapBrowserEvent) {\n if (!this.frameState_) {\n // With no view defined, we cannot translate pixels into geographical\n // coordinates so interactions cannot be used.\n return;\n }\n var originalEvent = /** @type {PointerEvent} */ (mapBrowserEvent.originalEvent);\n var eventType = originalEvent.type;\n if (eventType === PointerEventType.POINTERDOWN ||\n eventType === EventType.WHEEL ||\n eventType === EventType.KEYDOWN) {\n var doc = this.getOwnerDocument();\n var rootNode = this.viewport_.getRootNode\n ? this.viewport_.getRootNode()\n : doc;\n var target = /** @type {Node} */ (originalEvent.target);\n if (\n // Abort if the target is a child of the container for elements whose events are not meant\n // to be handled by map interactions.\n this.overlayContainerStopEvent_.contains(target) ||\n // Abort if the event target is a child of the container that is no longer in the page.\n // It's possible for the target to no longer be in the page if it has been removed in an\n // event listener, this might happen in a Control that recreates it's content based on\n // user interaction either manually or via a render in something like https://reactjs.org/\n !(rootNode === doc ? doc.documentElement : rootNode).contains(target)) {\n return;\n }\n }\n mapBrowserEvent.frameState = this.frameState_;\n if (this.dispatchEvent(mapBrowserEvent) !== false) {\n var interactionsArray = this.getInteractions().getArray().slice();\n for (var i = interactionsArray.length - 1; i >= 0; i--) {\n var interaction = interactionsArray[i];\n if (interaction.getMap() !== this ||\n !interaction.getActive() ||\n !this.getTargetElement()) {\n continue;\n }\n var cont = interaction.handleEvent(mapBrowserEvent);\n if (!cont || mapBrowserEvent.propagationStopped) {\n break;\n }\n }\n }\n };\n /**\n * @protected\n */\n PluggableMap.prototype.handlePostRender = function () {\n var frameState = this.frameState_;\n // Manage the tile queue\n // Image loads are expensive and a limited resource, so try to use them\n // efficiently:\n // * When the view is static we allow a large number of parallel tile loads\n // to complete the frame as quickly as possible.\n // * When animating or interacting, image loads can cause janks, so we reduce\n // the maximum number of loads per frame and limit the number of parallel\n // tile loads to remain reactive to view changes and to reduce the chance of\n // loading tiles that will quickly disappear from view.\n var tileQueue = this.tileQueue_;\n if (!tileQueue.isEmpty()) {\n var maxTotalLoading = this.maxTilesLoading_;\n var maxNewLoads = maxTotalLoading;\n if (frameState) {\n var hints = frameState.viewHints;\n if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) {\n var lowOnFrameBudget = Date.now() - frameState.time > 8;\n maxTotalLoading = lowOnFrameBudget ? 0 : 8;\n maxNewLoads = lowOnFrameBudget ? 0 : 2;\n }\n }\n if (tileQueue.getTilesLoading() < maxTotalLoading) {\n tileQueue.reprioritize(); // FIXME only call if view has changed\n tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);\n }\n }\n if (frameState &&\n this.hasListener(RenderEventType.RENDERCOMPLETE) &&\n !frameState.animate &&\n !this.tileQueue_.getTilesLoading() &&\n !this.getLoading()) {\n this.renderer_.dispatchRenderEvent(RenderEventType.RENDERCOMPLETE, frameState);\n }\n var postRenderFunctions = this.postRenderFunctions_;\n for (var i = 0, ii = postRenderFunctions.length; i < ii; ++i) {\n postRenderFunctions[i](this, frameState);\n }\n postRenderFunctions.length = 0;\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleSizeChanged_ = function () {\n if (this.getView() && !this.getView().getAnimating()) {\n this.getView().resolveConstraints(0);\n }\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleTargetChanged_ = function () {\n // target may be undefined, null, a string or an Element.\n // If it's a string we convert it to an Element before proceeding.\n // If it's not now an Element we remove the viewport from the DOM.\n // If it's an Element we append the viewport element to it.\n var targetElement;\n if (this.getTarget()) {\n targetElement = this.getTargetElement();\n }\n if (this.mapBrowserEventHandler_) {\n for (var i = 0, ii = this.keyHandlerKeys_.length; i < ii; ++i) {\n unlistenByKey(this.keyHandlerKeys_[i]);\n }\n this.keyHandlerKeys_ = null;\n this.viewport_.removeEventListener(EventType.CONTEXTMENU, this.boundHandleBrowserEvent_);\n this.viewport_.removeEventListener(EventType.WHEEL, this.boundHandleBrowserEvent_);\n if (this.handleResize_ !== undefined) {\n removeEventListener(EventType.RESIZE, this.handleResize_, false);\n this.handleResize_ = undefined;\n }\n this.mapBrowserEventHandler_.dispose();\n this.mapBrowserEventHandler_ = null;\n removeNode(this.viewport_);\n }\n if (!targetElement) {\n if (this.renderer_) {\n clearTimeout(this.postRenderTimeoutHandle_);\n this.postRenderTimeoutHandle_ = undefined;\n this.postRenderFunctions_.length = 0;\n this.renderer_.dispose();\n this.renderer_ = null;\n }\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n this.animationDelayKey_ = undefined;\n }\n }\n else {\n targetElement.appendChild(this.viewport_);\n if (!this.renderer_) {\n this.renderer_ = this.createRenderer();\n }\n this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, this.moveTolerance_);\n for (var key in MapBrowserEventType) {\n this.mapBrowserEventHandler_.addEventListener(MapBrowserEventType[key], this.handleMapBrowserEvent.bind(this));\n }\n this.viewport_.addEventListener(EventType.CONTEXTMENU, this.boundHandleBrowserEvent_, false);\n this.viewport_.addEventListener(EventType.WHEEL, this.boundHandleBrowserEvent_, PASSIVE_EVENT_LISTENERS ? { passive: false } : false);\n var keyboardEventTarget = !this.keyboardEventTarget_\n ? targetElement\n : this.keyboardEventTarget_;\n this.keyHandlerKeys_ = [\n listen(keyboardEventTarget, EventType.KEYDOWN, this.handleBrowserEvent, this),\n listen(keyboardEventTarget, EventType.KEYPRESS, this.handleBrowserEvent, this),\n ];\n if (!this.handleResize_) {\n this.handleResize_ = this.updateSize.bind(this);\n window.addEventListener(EventType.RESIZE, this.handleResize_, false);\n }\n }\n this.updateSize();\n // updateSize calls setSize, so no need to call this.render\n // ourselves here.\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleTileChange_ = function () {\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleViewPropertyChanged_ = function () {\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleViewChanged_ = function () {\n if (this.viewPropertyListenerKey_) {\n unlistenByKey(this.viewPropertyListenerKey_);\n this.viewPropertyListenerKey_ = null;\n }\n if (this.viewChangeListenerKey_) {\n unlistenByKey(this.viewChangeListenerKey_);\n this.viewChangeListenerKey_ = null;\n }\n var view = this.getView();\n if (view) {\n this.updateViewportSize_();\n this.viewPropertyListenerKey_ = listen(view, ObjectEventType.PROPERTYCHANGE, this.handleViewPropertyChanged_, this);\n this.viewChangeListenerKey_ = listen(view, EventType.CHANGE, this.handleViewPropertyChanged_, this);\n view.resolveConstraints(0);\n }\n this.render();\n };\n /**\n * @private\n */\n PluggableMap.prototype.handleLayerGroupChanged_ = function () {\n if (this.layerGroupPropertyListenerKeys_) {\n this.layerGroupPropertyListenerKeys_.forEach(unlistenByKey);\n this.layerGroupPropertyListenerKeys_ = null;\n }\n var layerGroup = this.getLayerGroup();\n if (layerGroup) {\n this.layerGroupPropertyListenerKeys_ = [\n listen(layerGroup, ObjectEventType.PROPERTYCHANGE, this.render, this),\n listen(layerGroup, EventType.CHANGE, this.render, this),\n ];\n }\n this.render();\n };\n /**\n * @return {boolean} Is rendered.\n */\n PluggableMap.prototype.isRendered = function () {\n return !!this.frameState_;\n };\n /**\n * Requests an immediate render in a synchronous manner.\n * @api\n */\n PluggableMap.prototype.renderSync = function () {\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n }\n this.animationDelay_();\n };\n /**\n * Redraws all text after new fonts have loaded\n */\n PluggableMap.prototype.redrawText = function () {\n var layerStates = this.getLayerGroup().getLayerStatesArray();\n for (var i = 0, ii = layerStates.length; i < ii; ++i) {\n var layer = layerStates[i].layer;\n if (layer.hasRenderer()) {\n layer.getRenderer().handleFontsChanged();\n }\n }\n };\n /**\n * Request a map rendering (at the next animation frame).\n * @api\n */\n PluggableMap.prototype.render = function () {\n if (this.renderer_ && this.animationDelayKey_ === undefined) {\n this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_);\n }\n };\n /**\n * Remove the given control from the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @return {import(\"./control/Control.js\").default|undefined} The removed control (or undefined\n * if the control was not found).\n * @api\n */\n PluggableMap.prototype.removeControl = function (control) {\n return this.getControls().remove(control);\n };\n /**\n * Remove the given interaction from the map.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to remove.\n * @return {import(\"./interaction/Interaction.js\").default|undefined} The removed interaction (or\n * undefined if the interaction was not found).\n * @api\n */\n PluggableMap.prototype.removeInteraction = function (interaction) {\n return this.getInteractions().remove(interaction);\n };\n /**\n * Removes the given layer from the map.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @return {import(\"./layer/Base.js\").default|undefined} The removed layer (or undefined if the\n * layer was not found).\n * @api\n */\n PluggableMap.prototype.removeLayer = function (layer) {\n var layers = this.getLayerGroup().getLayers();\n return layers.remove(layer);\n };\n /**\n * Remove the given overlay from the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @return {import(\"./Overlay.js\").default|undefined} The removed overlay (or undefined\n * if the overlay was not found).\n * @api\n */\n PluggableMap.prototype.removeOverlay = function (overlay) {\n return this.getOverlays().remove(overlay);\n };\n /**\n * @param {number} time Time.\n * @private\n */\n PluggableMap.prototype.renderFrame_ = function (time) {\n var _this = this;\n var size = this.getSize();\n var view = this.getView();\n var previousFrameState = this.frameState_;\n /** @type {?FrameState} */\n var frameState = null;\n if (size !== undefined && hasArea(size) && view && view.isDef()) {\n var viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);\n var viewState = view.getState();\n frameState = {\n animate: false,\n coordinateToPixelTransform: this.coordinateToPixelTransform_,\n declutterTree: null,\n extent: getForViewAndSize(viewState.center, viewState.resolution, viewState.rotation, size),\n index: this.frameIndex_++,\n layerIndex: 0,\n layerStatesArray: this.getLayerGroup().getLayerStatesArray(),\n pixelRatio: this.pixelRatio_,\n pixelToCoordinateTransform: this.pixelToCoordinateTransform_,\n postRenderFunctions: [],\n size: size,\n tileQueue: this.tileQueue_,\n time: time,\n usedTiles: {},\n viewState: viewState,\n viewHints: viewHints,\n wantedTiles: {},\n };\n }\n this.frameState_ = frameState;\n this.renderer_.renderFrame(frameState);\n if (frameState) {\n if (frameState.animate) {\n this.render();\n }\n Array.prototype.push.apply(this.postRenderFunctions_, frameState.postRenderFunctions);\n if (previousFrameState) {\n var moveStart = !this.previousExtent_ ||\n (!isEmpty(this.previousExtent_) &&\n !equals(frameState.extent, this.previousExtent_));\n if (moveStart) {\n this.dispatchEvent(new MapEvent(MapEventType.MOVESTART, this, previousFrameState));\n this.previousExtent_ = createOrUpdateEmpty(this.previousExtent_);\n }\n }\n var idle = this.previousExtent_ &&\n !frameState.viewHints[ViewHint.ANIMATING] &&\n !frameState.viewHints[ViewHint.INTERACTING] &&\n !equals(frameState.extent, this.previousExtent_);\n if (idle) {\n this.dispatchEvent(new MapEvent(MapEventType.MOVEEND, this, frameState));\n clone(frameState.extent, this.previousExtent_);\n }\n }\n this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState));\n if (!this.postRenderTimeoutHandle_) {\n this.postRenderTimeoutHandle_ = setTimeout(function () {\n _this.postRenderTimeoutHandle_ = undefined;\n _this.handlePostRender();\n }, 0);\n }\n };\n /**\n * Sets the layergroup of this map.\n * @param {LayerGroup} layerGroup A layer group containing the layers in this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.setLayerGroup = function (layerGroup) {\n this.set(MapProperty.LAYERGROUP, layerGroup);\n };\n /**\n * Set the size of this map.\n * @param {import(\"./size.js\").Size|undefined} size The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n PluggableMap.prototype.setSize = function (size) {\n this.set(MapProperty.SIZE, size);\n };\n /**\n * Set the target element to render this map into.\n * @param {HTMLElement|string|undefined} target The Element or id of the Element\n * that the map is rendered in.\n * @observable\n * @api\n */\n PluggableMap.prototype.setTarget = function (target) {\n this.set(MapProperty.TARGET, target);\n };\n /**\n * Set the view for this map.\n * @param {View} view The view that controls this map.\n * @observable\n * @api\n */\n PluggableMap.prototype.setView = function (view) {\n this.set(MapProperty.VIEW, view);\n };\n /**\n * Force a recalculation of the map viewport size. This should be called when\n * third-party code changes the size of the map viewport.\n * @api\n */\n PluggableMap.prototype.updateSize = function () {\n var targetElement = this.getTargetElement();\n var size = undefined;\n if (targetElement) {\n var computedStyle = getComputedStyle(targetElement);\n var width = targetElement.offsetWidth -\n parseFloat(computedStyle['borderLeftWidth']) -\n parseFloat(computedStyle['paddingLeft']) -\n parseFloat(computedStyle['paddingRight']) -\n parseFloat(computedStyle['borderRightWidth']);\n var height = targetElement.offsetHeight -\n parseFloat(computedStyle['borderTopWidth']) -\n parseFloat(computedStyle['paddingTop']) -\n parseFloat(computedStyle['paddingBottom']) -\n parseFloat(computedStyle['borderBottomWidth']);\n if (!isNaN(width) && !isNaN(height)) {\n size = [width, height];\n if (!hasArea(size)) {\n // eslint-disable-next-line\n console.warn(\"No map visible because the map container's width or height are 0.\");\n }\n }\n }\n this.setSize(size);\n this.updateViewportSize_();\n };\n /**\n * Recomputes the viewport size and save it on the view object (if any)\n * @private\n */\n PluggableMap.prototype.updateViewportSize_ = function () {\n var view = this.getView();\n if (view) {\n var size = undefined;\n var computedStyle = getComputedStyle(this.viewport_);\n if (computedStyle.width && computedStyle.height) {\n size = [\n parseInt(computedStyle.width, 10),\n parseInt(computedStyle.height, 10),\n ];\n }\n view.setViewportSize(size);\n }\n };\n return PluggableMap;\n}(BaseObject));\n/**\n * @param {MapOptions} options Map options.\n * @return {MapOptionsInternal} Internal map options.\n */\nfunction createOptionsInternal(options) {\n /**\n * @type {HTMLElement|Document}\n */\n var keyboardEventTarget = null;\n if (options.keyboardEventTarget !== undefined) {\n keyboardEventTarget =\n typeof options.keyboardEventTarget === 'string'\n ? document.getElementById(options.keyboardEventTarget)\n : options.keyboardEventTarget;\n }\n /**\n * @type {Object}\n */\n var values = {};\n var layerGroup = options.layers &&\n typeof ( /** @type {?} */(options.layers).getLayers) === 'function'\n ? /** @type {LayerGroup} */ (options.layers)\n : new LayerGroup({ layers: /** @type {Collection} */ (options.layers) });\n values[MapProperty.LAYERGROUP] = layerGroup;\n values[MapProperty.TARGET] = options.target;\n values[MapProperty.VIEW] =\n options.view !== undefined ? options.view : new View();\n var controls;\n if (options.controls !== undefined) {\n if (Array.isArray(options.controls)) {\n controls = new Collection(options.controls.slice());\n }\n else {\n assert(typeof ( /** @type {?} */(options.controls).getArray) === 'function', 47); // Expected `controls` to be an array or an `import(\"./Collection.js\").Collection`\n controls = /** @type {Collection} */ (options.controls);\n }\n }\n var interactions;\n if (options.interactions !== undefined) {\n if (Array.isArray(options.interactions)) {\n interactions = new Collection(options.interactions.slice());\n }\n else {\n assert(typeof ( /** @type {?} */(options.interactions).getArray) ===\n 'function', 48); // Expected `interactions` to be an array or an `import(\"./Collection.js\").Collection`\n interactions = /** @type {Collection} */ (options.interactions);\n }\n }\n var overlays;\n if (options.overlays !== undefined) {\n if (Array.isArray(options.overlays)) {\n overlays = new Collection(options.overlays.slice());\n }\n else {\n assert(typeof ( /** @type {?} */(options.overlays).getArray) === 'function', 49); // Expected `overlays` to be an array or an `import(\"./Collection.js\").Collection`\n overlays = options.overlays;\n }\n }\n else {\n overlays = new Collection();\n }\n return {\n controls: controls,\n interactions: interactions,\n keyboardEventTarget: keyboardEventTarget,\n overlays: overlays,\n values: values,\n };\n}\nexport default PluggableMap;\n//# sourceMappingURL=PluggableMap.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Control\n */\nimport BaseObject from '../Object.js';\nimport MapEventType from '../MapEventType.js';\nimport { VOID } from '../functions.js';\nimport { listen, unlistenByKey } from '../events.js';\nimport { removeNode } from '../dom.js';\n/**\n * @typedef {Object} Options\n * @property {HTMLElement} [element] The element is the control's\n * container element. This only needs to be specified if you're developing\n * a custom control.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n * @property {HTMLElement|string} [target] Specify a target if you want\n * the control to be rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A control is a visible widget with a DOM element in a fixed position on the\n * screen. They can involve user input (buttons), or be informational only;\n * the position is determined using CSS. By default these are placed in the\n * container with CSS class name `ol-overlaycontainer-stopevent`, but can use\n * any outside DOM element.\n *\n * This is the base class for controls. You can use it for simple custom\n * controls by creating the element with listeners, creating an instance:\n * ```js\n * var myControl = new Control({element: myElement});\n * ```\n * and then adding this to the map.\n *\n * The main advantage of having this as a control rather than a simple separate\n * DOM element is that preventing propagation is handled for you. Controls\n * will also be objects in a {@link module:ol/Collection~Collection}, so you can use their methods.\n *\n * You can also extend this base for your own control class. See\n * examples/custom-controls for an example of how to do this.\n *\n * @api\n */\nvar Control = /** @class */ (function (_super) {\n __extends(Control, _super);\n /**\n * @param {Options} options Control options.\n */\n function Control(options) {\n var _this = _super.call(this) || this;\n var element = options.element;\n if (element && !options.target && !element.style.pointerEvents) {\n element.style.pointerEvents = 'auto';\n }\n /**\n * @protected\n * @type {HTMLElement}\n */\n _this.element = element ? element : null;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.target_ = null;\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = null;\n /**\n * @protected\n * @type {!Array}\n */\n _this.listenerKeys = [];\n if (options.render) {\n _this.render = options.render;\n }\n if (options.target) {\n _this.setTarget(options.target);\n }\n return _this;\n }\n /**\n * Clean up.\n */\n Control.prototype.disposeInternal = function () {\n removeNode(this.element);\n _super.prototype.disposeInternal.call(this);\n };\n /**\n * Get the map associated with this control.\n * @return {import(\"../PluggableMap.js\").default} Map.\n * @api\n */\n Control.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @api\n */\n Control.prototype.setMap = function (map) {\n if (this.map_) {\n removeNode(this.element);\n }\n for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {\n unlistenByKey(this.listenerKeys[i]);\n }\n this.listenerKeys.length = 0;\n this.map_ = map;\n if (this.map_) {\n var target = this.target_\n ? this.target_\n : map.getOverlayContainerStopEvent();\n target.appendChild(this.element);\n if (this.render !== VOID) {\n this.listenerKeys.push(listen(map, MapEventType.POSTRENDER, this.render, this));\n }\n map.render();\n }\n };\n /**\n * Renders the control.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @api\n */\n Control.prototype.render = function (mapEvent) { };\n /**\n * This function is used to set a target element for the control. It has no\n * effect if it is called after the control has been added to the map (i.e.\n * after `setMap` is called on the control). If no `target` is set in the\n * options passed to the control constructor and if `setTarget` is not called\n * then the control is added to the map's overlay container.\n * @param {HTMLElement|string} target Target.\n * @api\n */\n Control.prototype.setTarget = function (target) {\n this.target_ =\n typeof target === 'string' ? document.getElementById(target) : target;\n };\n return Control;\n}(BaseObject));\nexport default Control;\n//# sourceMappingURL=Control.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Attribution\n */\nimport Control from './Control.js';\nimport EventType from '../events/EventType.js';\nimport { CLASS_COLLAPSED, CLASS_CONTROL, CLASS_UNSELECTABLE } from '../css.js';\nimport { equals } from '../array.js';\nimport { inView } from '../layer/Layer.js';\nimport { removeChildren, replaceNode } from '../dom.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-attribution'] CSS class name.\n * @property {HTMLElement|string} [target] Specify a target if you\n * want the control to be rendered outside of the map's\n * viewport.\n * @property {boolean} [collapsible] Specify if attributions can\n * be collapsed. If not specified, sources control this behavior with their\n * `attributionsCollapsible` setting.\n * @property {boolean} [collapsed=true] Specify if attributions should\n * be collapsed at startup.\n * @property {string} [tipLabel='Attributions'] Text label to use for the button tip.\n * @property {string} [label='i'] Text label to use for the\n * collapsed attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [expandClassName=className + '-expand'] CSS class name for the\n * collapsed attributions button.\n * @property {string|HTMLElement} [collapseLabel='»'] Text label to use\n * for the expanded attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [collapseClassName=className + '-collapse'] CSS class name for the\n * expanded attributions button.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n */\n/**\n * @classdesc\n * Control to show all the attributions associated with the layer sources\n * in the map. This control is one of the default controls included in maps.\n * By default it will show in the bottom right portion of the map, but this can\n * be changed by using a css selector for `.ol-attribution`.\n *\n * @api\n */\nvar Attribution = /** @class */ (function (_super) {\n __extends(Attribution, _super);\n /**\n * @param {Options} [opt_options] Attribution options.\n */\n function Attribution(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render,\n target: options.target,\n }) || this;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.ulElement_ = document.createElement('ul');\n /**\n * @private\n * @type {boolean}\n */\n _this.collapsed_ =\n options.collapsed !== undefined ? options.collapsed : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.userCollapsed_ = _this.collapsed_;\n /**\n * @private\n * @type {boolean}\n */\n _this.overrideCollapsible_ = options.collapsible !== undefined;\n /**\n * @private\n * @type {boolean}\n */\n _this.collapsible_ =\n options.collapsible !== undefined ? options.collapsible : true;\n if (!_this.collapsible_) {\n _this.collapsed_ = false;\n }\n var className = options.className !== undefined ? options.className : 'ol-attribution';\n var tipLabel = options.tipLabel !== undefined ? options.tipLabel : 'Attributions';\n var expandClassName = options.expandClassName !== undefined\n ? options.expandClassName\n : className + '-expand';\n var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\\u00BB';\n var collapseClassName = options.collapseClassName !== undefined\n ? options.collapseClassName\n : className + '-collpase';\n if (typeof collapseLabel === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.collapseLabel_ = document.createElement('span');\n _this.collapseLabel_.textContent = collapseLabel;\n _this.collapseLabel_.className = collapseClassName;\n }\n else {\n _this.collapseLabel_ = collapseLabel;\n }\n var label = options.label !== undefined ? options.label : 'i';\n if (typeof label === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.label_ = document.createElement('span');\n _this.label_.textContent = label;\n _this.label_.className = expandClassName;\n }\n else {\n _this.label_ = label;\n }\n var activeLabel = _this.collapsible_ && !_this.collapsed_ ? _this.collapseLabel_ : _this.label_;\n /**\n * @private\n * @type {HTMLElement}\n */\n _this.toggleButton_ = document.createElement('button');\n _this.toggleButton_.setAttribute('type', 'button');\n _this.toggleButton_.setAttribute('aria-expanded', String(!_this.collapsed_));\n _this.toggleButton_.title = tipLabel;\n _this.toggleButton_.appendChild(activeLabel);\n _this.toggleButton_.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = className +\n ' ' +\n CLASS_UNSELECTABLE +\n ' ' +\n CLASS_CONTROL +\n (_this.collapsed_ && _this.collapsible_ ? ' ' + CLASS_COLLAPSED : '') +\n (_this.collapsible_ ? '' : ' ol-uncollapsible');\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(_this.toggleButton_);\n element.appendChild(_this.ulElement_);\n /**\n * A list of currently rendered resolutions.\n * @type {Array}\n * @private\n */\n _this.renderedAttributions_ = [];\n /**\n * @private\n * @type {boolean}\n */\n _this.renderedVisible_ = true;\n return _this;\n }\n /**\n * Collect a list of visible attributions and set the collapsible state.\n * @param {import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n * @return {Array} Attributions.\n * @private\n */\n Attribution.prototype.collectSourceAttributions_ = function (frameState) {\n /**\n * Used to determine if an attribution already exists.\n * @type {!Object}\n */\n var lookup = {};\n /**\n * A list of visible attributions.\n * @type {Array}\n */\n var visibleAttributions = [];\n var collapsible = true;\n var layerStatesArray = frameState.layerStatesArray;\n for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n var layerState = layerStatesArray[i];\n if (!inView(layerState, frameState.viewState)) {\n continue;\n }\n var source = /** @type {import(\"../layer/Layer.js\").default} */ (layerState.layer).getSource();\n if (!source) {\n continue;\n }\n var attributionGetter = source.getAttributions();\n if (!attributionGetter) {\n continue;\n }\n var attributions = attributionGetter(frameState);\n if (!attributions) {\n continue;\n }\n collapsible =\n collapsible && source.getAttributionsCollapsible() !== false;\n if (Array.isArray(attributions)) {\n for (var j = 0, jj = attributions.length; j < jj; ++j) {\n if (!(attributions[j] in lookup)) {\n visibleAttributions.push(attributions[j]);\n lookup[attributions[j]] = true;\n }\n }\n }\n else {\n if (!(attributions in lookup)) {\n visibleAttributions.push(attributions);\n lookup[attributions] = true;\n }\n }\n }\n if (!this.overrideCollapsible_) {\n this.setCollapsible(collapsible);\n }\n return visibleAttributions;\n };\n /**\n * @private\n * @param {?import(\"../PluggableMap.js\").FrameState} frameState Frame state.\n */\n Attribution.prototype.updateElement_ = function (frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n var attributions = this.collectSourceAttributions_(frameState);\n var visible = attributions.length > 0;\n if (this.renderedVisible_ != visible) {\n this.element.style.display = visible ? '' : 'none';\n this.renderedVisible_ = visible;\n }\n if (equals(attributions, this.renderedAttributions_)) {\n return;\n }\n removeChildren(this.ulElement_);\n // append the attributions\n for (var i = 0, ii = attributions.length; i < ii; ++i) {\n var element = document.createElement('li');\n element.innerHTML = attributions[i];\n this.ulElement_.appendChild(element);\n }\n this.renderedAttributions_ = attributions;\n };\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Attribution.prototype.handleClick_ = function (event) {\n event.preventDefault();\n this.handleToggle_();\n this.userCollapsed_ = this.collapsed_;\n };\n /**\n * @private\n */\n Attribution.prototype.handleToggle_ = function () {\n this.element.classList.toggle(CLASS_COLLAPSED);\n if (this.collapsed_) {\n replaceNode(this.collapseLabel_, this.label_);\n }\n else {\n replaceNode(this.label_, this.collapseLabel_);\n }\n this.collapsed_ = !this.collapsed_;\n this.toggleButton_.setAttribute('aria-expanded', String(!this.collapsed_));\n };\n /**\n * Return `true` if the attribution is collapsible, `false` otherwise.\n * @return {boolean} True if the widget is collapsible.\n * @api\n */\n Attribution.prototype.getCollapsible = function () {\n return this.collapsible_;\n };\n /**\n * Set whether the attribution should be collapsible.\n * @param {boolean} collapsible True if the widget is collapsible.\n * @api\n */\n Attribution.prototype.setCollapsible = function (collapsible) {\n if (this.collapsible_ === collapsible) {\n return;\n }\n this.collapsible_ = collapsible;\n this.element.classList.toggle('ol-uncollapsible');\n if (this.userCollapsed_) {\n this.handleToggle_();\n }\n };\n /**\n * Collapse or expand the attribution according to the passed parameter. Will\n * not do anything if the attribution isn't collapsible or if the current\n * collapsed state is already the one requested.\n * @param {boolean} collapsed True if the widget is collapsed.\n * @api\n */\n Attribution.prototype.setCollapsed = function (collapsed) {\n this.userCollapsed_ = collapsed;\n if (!this.collapsible_ || this.collapsed_ === collapsed) {\n return;\n }\n this.handleToggle_();\n };\n /**\n * Return `true` when the attribution is currently collapsed or `false`\n * otherwise.\n * @return {boolean} True if the widget is collapsed.\n * @api\n */\n Attribution.prototype.getCollapsed = function () {\n return this.collapsed_;\n };\n /**\n * Update the attribution element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n Attribution.prototype.render = function (mapEvent) {\n this.updateElement_(mapEvent.frameState);\n };\n return Attribution;\n}(Control));\nexport default Attribution;\n//# sourceMappingURL=Attribution.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Rotate\n */\nimport Control from './Control.js';\nimport EventType from '../events/EventType.js';\nimport { CLASS_CONTROL, CLASS_HIDDEN, CLASS_UNSELECTABLE } from '../css.js';\nimport { easeOut } from '../easing.js';\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-rotate'] CSS class name.\n * @property {string|HTMLElement} [label='⇧'] Text label to use for the rotate button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.\n * @property {string} [compassClassName='ol-compass'] CSS class name for the compass.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {boolean} [autoHide=true] Hide the control when rotation is 0.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when the control should\n * be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {function():void} [resetNorth] Function called when the control is clicked.\n * This will override the default `resetNorth`.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A button control to reset rotation to 0.\n * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css\n * selector is added to the button when the rotation is 0.\n *\n * @api\n */\nvar Rotate = /** @class */ (function (_super) {\n __extends(Rotate, _super);\n /**\n * @param {Options} [opt_options] Rotate options.\n */\n function Rotate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n render: options.render,\n target: options.target,\n }) || this;\n var className = options.className !== undefined ? options.className : 'ol-rotate';\n var label = options.label !== undefined ? options.label : '\\u21E7';\n var compassClassName = options.compassClassName !== undefined\n ? options.compassClassName\n : 'ol-compass';\n /**\n * @type {HTMLElement}\n * @private\n */\n _this.label_ = null;\n if (typeof label === 'string') {\n _this.label_ = document.createElement('span');\n _this.label_.className = compassClassName;\n _this.label_.textContent = label;\n }\n else {\n _this.label_ = label;\n _this.label_.classList.add(compassClassName);\n }\n var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';\n var button = document.createElement('button');\n button.className = className + '-reset';\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(_this.label_);\n button.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(button);\n _this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;\n /**\n * @type {number}\n * @private\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n /**\n * @type {boolean}\n * @private\n */\n _this.autoHide_ = options.autoHide !== undefined ? options.autoHide : true;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.rotation_ = undefined;\n if (_this.autoHide_) {\n _this.element.classList.add(CLASS_HIDDEN);\n }\n return _this;\n }\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Rotate.prototype.handleClick_ = function (event) {\n event.preventDefault();\n if (this.callResetNorth_ !== undefined) {\n this.callResetNorth_();\n }\n else {\n this.resetNorth_();\n }\n };\n /**\n * @private\n */\n Rotate.prototype.resetNorth_ = function () {\n var map = this.getMap();\n var view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n var rotation = view.getRotation();\n if (rotation !== undefined) {\n if (this.duration_ > 0 && rotation % (2 * Math.PI) !== 0) {\n view.animate({\n rotation: 0,\n duration: this.duration_,\n easing: easeOut,\n });\n }\n else {\n view.setRotation(0);\n }\n }\n };\n /**\n * Update the rotate control element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n Rotate.prototype.render = function (mapEvent) {\n var frameState = mapEvent.frameState;\n if (!frameState) {\n return;\n }\n var rotation = frameState.viewState.rotation;\n if (rotation != this.rotation_) {\n var transform = 'rotate(' + rotation + 'rad)';\n if (this.autoHide_) {\n var contains = this.element.classList.contains(CLASS_HIDDEN);\n if (!contains && rotation === 0) {\n this.element.classList.add(CLASS_HIDDEN);\n }\n else if (contains && rotation !== 0) {\n this.element.classList.remove(CLASS_HIDDEN);\n }\n }\n this.label_.style.transform = transform;\n }\n this.rotation_ = rotation;\n };\n return Rotate;\n}(Control));\nexport default Rotate;\n//# sourceMappingURL=Rotate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/control/Zoom\n */\nimport Control from './Control.js';\nimport EventType from '../events/EventType.js';\nimport { CLASS_CONTROL, CLASS_UNSELECTABLE } from '../css.js';\nimport { easeOut } from '../easing.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {string} [className='ol-zoom'] CSS class name.\n * @property {string} [zoomInClassName=className + '-in'] CSS class name for the zoom-in button.\n * @property {string} [zoomOutClassName=className + '-out'] CSS class name for the zoom-out button.\n * @property {string|HTMLElement} [zoomInLabel='+'] Text label to use for the zoom-in\n * button. Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string|HTMLElement} [zoomOutLabel='-'] Text label to use for the zoom-out button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.\n * @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.\n * @property {number} [delta=1] The zoom delta applied on each click.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n/**\n * @classdesc\n * A control with 2 buttons, one for zoom in and one for zoom out.\n * This control is one of the default controls of a map. To style this control\n * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.\n *\n * @api\n */\nvar Zoom = /** @class */ (function (_super) {\n __extends(Zoom, _super);\n /**\n * @param {Options} [opt_options] Zoom options.\n */\n function Zoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, {\n element: document.createElement('div'),\n target: options.target,\n }) || this;\n var className = options.className !== undefined ? options.className : 'ol-zoom';\n var delta = options.delta !== undefined ? options.delta : 1;\n var zoomInClassName = options.zoomInClassName !== undefined\n ? options.zoomInClassName\n : className + '-in';\n var zoomOutClassName = options.zoomOutClassName !== undefined\n ? options.zoomOutClassName\n : className + '-out';\n var zoomInLabel = options.zoomInLabel !== undefined ? options.zoomInLabel : '+';\n var zoomOutLabel = options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\\u2212';\n var zoomInTipLabel = options.zoomInTipLabel !== undefined ? options.zoomInTipLabel : 'Zoom in';\n var zoomOutTipLabel = options.zoomOutTipLabel !== undefined\n ? options.zoomOutTipLabel\n : 'Zoom out';\n var inElement = document.createElement('button');\n inElement.className = zoomInClassName;\n inElement.setAttribute('type', 'button');\n inElement.title = zoomInTipLabel;\n inElement.appendChild(typeof zoomInLabel === 'string'\n ? document.createTextNode(zoomInLabel)\n : zoomInLabel);\n inElement.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this, delta), false);\n var outElement = document.createElement('button');\n outElement.className = zoomOutClassName;\n outElement.setAttribute('type', 'button');\n outElement.title = zoomOutTipLabel;\n outElement.appendChild(typeof zoomOutLabel === 'string'\n ? document.createTextNode(zoomOutLabel)\n : zoomOutLabel);\n outElement.addEventListener(EventType.CLICK, _this.handleClick_.bind(_this, -delta), false);\n var cssClasses = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;\n var element = _this.element;\n element.className = cssClasses;\n element.appendChild(inElement);\n element.appendChild(outElement);\n /**\n * @type {number}\n * @private\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * @param {number} delta Zoom delta.\n * @param {MouseEvent} event The event to handle\n * @private\n */\n Zoom.prototype.handleClick_ = function (delta, event) {\n event.preventDefault();\n this.zoomByDelta_(delta);\n };\n /**\n * @param {number} delta Zoom delta.\n * @private\n */\n Zoom.prototype.zoomByDelta_ = function (delta) {\n var map = this.getMap();\n var view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n var currentZoom = view.getZoom();\n if (currentZoom !== undefined) {\n var newZoom = view.getConstrainedZoom(currentZoom + delta);\n if (this.duration_ > 0) {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n zoom: newZoom,\n duration: this.duration_,\n easing: easeOut,\n });\n }\n else {\n view.setZoom(newZoom);\n }\n }\n };\n return Zoom;\n}(Control));\nexport default Zoom;\n//# sourceMappingURL=Zoom.js.map","/**\n * @module ol/control\n */\nimport Attribution from './control/Attribution.js';\nimport Collection from './Collection.js';\nimport Rotate from './control/Rotate.js';\nimport Zoom from './control/Zoom.js';\nexport { default as Attribution } from './control/Attribution.js';\nexport { default as Control } from './control/Control.js';\nexport { default as FullScreen } from './control/FullScreen.js';\nexport { default as MousePosition } from './control/MousePosition.js';\nexport { default as OverviewMap } from './control/OverviewMap.js';\nexport { default as Rotate } from './control/Rotate.js';\nexport { default as ScaleLine } from './control/ScaleLine.js';\nexport { default as Zoom } from './control/Zoom.js';\nexport { default as ZoomSlider } from './control/ZoomSlider.js';\nexport { default as ZoomToExtent } from './control/ZoomToExtent.js';\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [attribution=true] Include\n * {@link module:ol/control/Attribution~Attribution}.\n * @property {import(\"./control/Attribution.js\").Options} [attributionOptions]\n * Options for {@link module:ol/control/Attribution~Attribution}.\n * @property {boolean} [rotate=true] Include\n * {@link module:ol/control/Rotate~Rotate}.\n * @property {import(\"./control/Rotate.js\").Options} [rotateOptions] Options\n * for {@link module:ol/control/Rotate~Rotate}.\n * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.\n * @property {import(\"./control/Zoom.js\").Options} [zoomOptions] Options for\n * {@link module:ol/control/Zoom~Zoom}.\n * @api\n */\n/**\n * Set of controls included in maps by default. Unless configured otherwise,\n * this returns a collection containing an instance of each of the following\n * controls:\n * * {@link module:ol/control/Zoom~Zoom}\n * * {@link module:ol/control/Rotate~Rotate}\n * * {@link module:ol/control/Attribution~Attribution}\n *\n * @param {DefaultsOptions} [opt_options]\n * Defaults options.\n * @return {Collection}\n * Controls.\n * @api\n */\nexport function defaults(opt_options) {\n var options = opt_options ? opt_options : {};\n var controls = new Collection();\n var zoomControl = options.zoom !== undefined ? options.zoom : true;\n if (zoomControl) {\n controls.push(new Zoom(options.zoomOptions));\n }\n var rotateControl = options.rotate !== undefined ? options.rotate : true;\n if (rotateControl) {\n controls.push(new Rotate(options.rotateOptions));\n }\n var attributionControl = options.attribution !== undefined ? options.attribution : true;\n if (attributionControl) {\n controls.push(new Attribution(options.attributionOptions));\n }\n return controls;\n}\n//# sourceMappingURL=control.js.map","/**\n * @module ol/interaction/Property\n */\n/**\n * @enum {string}\n */\nexport default {\n ACTIVE: 'active',\n};\n//# sourceMappingURL=Property.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Interaction\n */\nimport BaseObject from '../Object.js';\nimport InteractionProperty from './Property.js';\nimport { easeOut, linear } from '../easing.js';\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").CombinedOnSignature} InteractionOnSignature\n */\n/**\n * Object literal with config options for interactions.\n * @typedef {Object} InteractionOptions\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} handleEvent\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. If the function returns a falsy value, propagation of\n * the event to other interactions in the map's interactions chain will be\n * prevented (this includes functions with no explicit return). The interactions\n * are traversed in reverse order of the interactions collection of the map.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * User actions that change the state of the map. Some are similar to controls,\n * but are not associated with a DOM element.\n * For example, {@link module:ol/interaction/KeyboardZoom~KeyboardZoom} is\n * functionally the same as {@link module:ol/control/Zoom~Zoom}, but triggered\n * by a keyboard event not a button element event.\n * Although interactions do not have a DOM element, some of them do render\n * vectors and so are visible on the screen.\n * @api\n */\nvar Interaction = /** @class */ (function (_super) {\n __extends(Interaction, _super);\n /**\n * @param {InteractionOptions} [opt_options] Options.\n */\n function Interaction(opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {InteractionOnSignature}\n */\n _this.on;\n /***\n * @type {InteractionOnSignature}\n */\n _this.once;\n /***\n * @type {InteractionOnSignature}\n */\n _this.un;\n if (opt_options && opt_options.handleEvent) {\n _this.handleEvent = opt_options.handleEvent;\n }\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default}\n */\n _this.map_ = null;\n _this.setActive(true);\n return _this;\n }\n /**\n * Return whether the interaction is currently active.\n * @return {boolean} `true` if the interaction is active, `false` otherwise.\n * @observable\n * @api\n */\n Interaction.prototype.getActive = function () {\n return /** @type {boolean} */ (this.get(InteractionProperty.ACTIVE));\n };\n /**\n * Get the map associated with this interaction.\n * @return {import(\"../PluggableMap.js\").default} Map.\n * @api\n */\n Interaction.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event}.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n Interaction.prototype.handleEvent = function (mapBrowserEvent) {\n return true;\n };\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n Interaction.prototype.setActive = function (active) {\n this.set(InteractionProperty.ACTIVE, active);\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Interaction.prototype.setMap = function (map) {\n this.map_ = map;\n };\n return Interaction;\n}(BaseObject));\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {import(\"../coordinate.js\").Coordinate} delta Delta.\n * @param {number} [opt_duration] Duration.\n */\nexport function pan(view, delta, opt_duration) {\n var currentCenter = view.getCenterInternal();\n if (currentCenter) {\n var center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];\n view.animateInternal({\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: linear,\n center: view.getConstrainedCenter(center),\n });\n }\n}\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {number} delta Delta from previous zoom level.\n * @param {import(\"../coordinate.js\").Coordinate} [opt_anchor] Anchor coordinate in the user projection.\n * @param {number} [opt_duration] Duration.\n */\nexport function zoomByDelta(view, delta, opt_anchor, opt_duration) {\n var currentZoom = view.getZoom();\n if (currentZoom === undefined) {\n return;\n }\n var newZoom = view.getConstrainedZoom(currentZoom + delta);\n var newResolution = view.getResolutionForZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n resolution: newResolution,\n anchor: opt_anchor,\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: easeOut,\n });\n}\nexport default Interaction;\n//# sourceMappingURL=Interaction.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/DoubleClickZoom\n */\nimport Interaction, { zoomByDelta } from './Interaction.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [delta=1] The zoom delta applied on each double click.\n */\n/**\n * @classdesc\n * Allows the user to zoom by double-clicking on the map.\n * @api\n */\nvar DoubleClickZoom = /** @class */ (function (_super) {\n __extends(DoubleClickZoom, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function DoubleClickZoom(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {number}\n */\n _this.delta_ = options.delta ? options.delta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a\n * doubleclick) and eventually zooms the map.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n DoubleClickZoom.prototype.handleEvent = function (mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {\n var browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);\n var map = mapBrowserEvent.map;\n var anchor = mapBrowserEvent.coordinate;\n var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;\n var view = map.getView();\n zoomByDelta(view, delta, anchor, this.duration_);\n browserEvent.preventDefault();\n stopEvent = true;\n }\n return !stopEvent;\n };\n return DoubleClickZoom;\n}(Interaction));\nexport default DoubleClickZoom;\n//# sourceMappingURL=DoubleClickZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Pointer\n */\nimport Interaction from './Interaction.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport { getValues } from '../obj.js';\n/**\n * @typedef {Object} Options\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleDownEvent]\n * Function handling \"down\" events. If the function returns `true` then a drag\n * sequence is started.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleDragEvent]\n * Function handling \"drag\" events. This function is called on \"move\" events\n * during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleEvent]\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. The function may return `false` to prevent the\n * propagation of the event to other interactions in the map's interactions\n * chain.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleMoveEvent]\n * Function handling \"move\" events. This function is called on \"move\" events.\n * This functions is also called during a drag sequence, so during a drag\n * sequence both the `handleDragEvent` function and this function are called.\n * If `handleDownEvent` is defined and it returns true this function will not\n * be called during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleUpEvent]\n * Function handling \"up\" events. If the function returns `false` then the\n * current drag sequence is stopped.\n * @property {function(boolean):boolean} [stopDown]\n * Should the down event be propagated to other interactions, or should be\n * stopped?\n */\n/**\n * @classdesc\n * Base class that calls user-defined functions on `down`, `move` and `up`\n * events. This class also manages \"drag sequences\".\n *\n * When the `handleDownEvent` user function returns `true` a drag sequence is\n * started. During a drag sequence the `handleDragEvent` user function is\n * called on `move` events. The drag sequence ends when the `handleUpEvent`\n * user function is called and returns `false`.\n * @api\n */\nvar PointerInteraction = /** @class */ (function (_super) {\n __extends(PointerInteraction, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function PointerInteraction(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, \n /** @type {import(\"./Interaction.js\").InteractionOptions} */ (options)) || this;\n if (options.handleDownEvent) {\n _this.handleDownEvent = options.handleDownEvent;\n }\n if (options.handleDragEvent) {\n _this.handleDragEvent = options.handleDragEvent;\n }\n if (options.handleMoveEvent) {\n _this.handleMoveEvent = options.handleMoveEvent;\n }\n if (options.handleUpEvent) {\n _this.handleUpEvent = options.handleUpEvent;\n }\n if (options.stopDown) {\n _this.stopDown = options.stopDown;\n }\n /**\n * @type {boolean}\n * @protected\n */\n _this.handlingDownUpSequence = false;\n /**\n * @type {!Object}\n * @private\n */\n _this.trackedPointers_ = {};\n /**\n * @type {Array}\n * @protected\n */\n _this.targetPointers = [];\n return _this;\n }\n /**\n * Returns the current number of pointers involved in the interaction,\n * e.g. `2` when two fingers are used.\n * @return {number} The number of pointers.\n * @api\n */\n PointerInteraction.prototype.getPointerCount = function () {\n return this.targetPointers.length;\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleDownEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleDragEvent = function (mapBrowserEvent) { };\n /**\n * Handles the {@link module:ol/MapBrowserEvent map browser event} and may call into\n * other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are\n * detected.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n PointerInteraction.prototype.handleEvent = function (mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent) {\n return true;\n }\n var stopEvent = false;\n this.updateTrackedPointers_(mapBrowserEvent);\n if (this.handlingDownUpSequence) {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {\n this.handleDragEvent(mapBrowserEvent);\n // prevent page scrolling during dragging\n mapBrowserEvent.originalEvent.preventDefault();\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {\n var handledUp = this.handleUpEvent(mapBrowserEvent);\n this.handlingDownUpSequence =\n handledUp && this.targetPointers.length > 0;\n }\n }\n else {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {\n var handled = this.handleDownEvent(mapBrowserEvent);\n this.handlingDownUpSequence = handled;\n stopEvent = this.stopDown(handled);\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {\n this.handleMoveEvent(mapBrowserEvent);\n }\n }\n return !stopEvent;\n };\n /**\n * Handle pointer move events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleMoveEvent = function (mapBrowserEvent) { };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleUpEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * This function is used to determine if \"down\" events should be propagated\n * to other interactions or should be stopped.\n * @param {boolean} handled Was the event handled by the interaction?\n * @return {boolean} Should the `down` event be stopped?\n */\n PointerInteraction.prototype.stopDown = function (handled) {\n return handled;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @private\n */\n PointerInteraction.prototype.updateTrackedPointers_ = function (mapBrowserEvent) {\n if (isPointerDraggingEvent(mapBrowserEvent)) {\n var event_1 = mapBrowserEvent.originalEvent;\n var id = event_1.pointerId.toString();\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {\n delete this.trackedPointers_[id];\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {\n this.trackedPointers_[id] = event_1;\n }\n else if (id in this.trackedPointers_) {\n // update only when there was a pointerdown event for this pointer\n this.trackedPointers_[id] = event_1;\n }\n this.targetPointers = getValues(this.trackedPointers_);\n }\n };\n return PointerInteraction;\n}(Interaction));\n/**\n * @param {Array} pointerEvents List of events.\n * @return {import(\"../pixel.js\").Pixel} Centroid pixel.\n */\nexport function centroid(pointerEvents) {\n var length = pointerEvents.length;\n var clientX = 0;\n var clientY = 0;\n for (var i = 0; i < length; i++) {\n clientX += pointerEvents[i].clientX;\n clientY += pointerEvents[i].clientY;\n }\n return [clientX / length, clientY / length];\n}\n/**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} Whether the event is a pointerdown, pointerdrag\n * or pointerup event.\n */\nfunction isPointerDraggingEvent(mapBrowserEvent) {\n var type = mapBrowserEvent.type;\n return (type === MapBrowserEventType.POINTERDOWN ||\n type === MapBrowserEventType.POINTERDRAG ||\n type === MapBrowserEventType.POINTERUP);\n}\nexport default PointerInteraction;\n//# sourceMappingURL=Pointer.js.map","/**\n * @module ol/events/condition\n */\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport { FALSE, TRUE } from '../functions.js';\nimport { MAC, WEBKIT } from '../has.js';\nimport { assert } from '../asserts.js';\n/**\n * A function that takes an {@link module:ol/MapBrowserEvent} and returns a\n * `{boolean}`. If the condition is met, true should be returned.\n *\n * @typedef {function(this: ?, import(\"../MapBrowserEvent.js\").default): boolean} Condition\n */\n/**\n * Creates a condition function that passes when all provided conditions pass.\n * @param {...Condition} var_args Conditions to check.\n * @return {Condition} Condition function.\n */\nexport function all(var_args) {\n var conditions = arguments;\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} All conditions passed.\n */\n return function (event) {\n var pass = true;\n for (var i = 0, ii = conditions.length; i < ii; ++i) {\n pass = pass && conditions[i](event);\n if (!pass) {\n break;\n }\n }\n return pass;\n };\n}\n/**\n * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when\n * additionally the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt key is pressed.\n * @api\n */\nexport var altKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n !originalEvent.shiftKey);\n};\n/**\n * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise\n * (e.g. when additionally the platform-modifier-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt and shift keys are pressed.\n * @api\n */\nexport var altShiftKeysOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n originalEvent.shiftKey);\n};\n/**\n * Return `true` if the map has the focus. This condition requires a map target\n * element with a `tabindex` attribute, e.g. `
`.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} The map has the focus.\n * @api\n */\nexport var focus = function (event) {\n return event.target.getTargetElement().contains(document.activeElement);\n};\n/**\n * Return `true` if the map has the focus or no 'tabindex' attribute set.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} The map container has the focus or no 'tabindex' attribute.\n */\nexport var focusWithTabindex = function (event) {\n return event.map.getTargetElement().hasAttribute('tabindex')\n ? focus(event)\n : true;\n};\n/**\n * Return always true.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True.\n * @api\n */\nexport var always = TRUE;\n/**\n * Return `true` if the event is a `click` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `click` event.\n * @api\n */\nexport var click = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.CLICK;\n};\n/**\n * Return `true` if the event has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} The result.\n */\nexport var mouseActionButton = function (mapBrowserEvent) {\n var originalEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);\n return originalEvent.button == 0 && !(WEBKIT && MAC && originalEvent.ctrlKey);\n};\n/**\n * Return always false.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} False.\n * @api\n */\nexport var never = FALSE;\n/**\n * Return `true` if the browser event is a `pointermove` event, `false`\n * otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the browser event is a `pointermove` event.\n * @api\n */\nexport var pointerMove = function (mapBrowserEvent) {\n return mapBrowserEvent.type == 'pointermove';\n};\n/**\n * Return `true` if the event is a map `singleclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `singleclick` event.\n * @api\n */\nexport var singleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK;\n};\n/**\n * Return `true` if the event is a map `dblclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `dblclick` event.\n * @api\n */\nexport var doubleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == MapBrowserEventType.DBLCLICK;\n};\n/**\n * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is\n * pressed.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True only if there no modifier keys are pressed.\n * @api\n */\nexport var noModifierKeys = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (!originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n !originalEvent.shiftKey);\n};\n/**\n * Return `true` if only the platform-modifier-key (the meta-key on Mac,\n * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally\n * the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the platform modifier key is pressed.\n * @api\n */\nexport var platformModifierKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (!originalEvent.altKey &&\n (MAC ? originalEvent.metaKey : originalEvent.ctrlKey) &&\n !originalEvent.shiftKey);\n};\n/**\n * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when\n * additionally the alt-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the shift key is pressed.\n * @api\n */\nexport var shiftKeyOnly = function (mapBrowserEvent) {\n var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);\n return (!originalEvent.altKey &&\n !(originalEvent.metaKey || originalEvent.ctrlKey) &&\n originalEvent.shiftKey);\n};\n/**\n * Return `true` if the target element is not editable, i.e. not a ``-,\n * `