@opensystemslab/map 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDes
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- var C,z,T,E;S.finalized=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null===(y=(v=globalThis).reactiveElementPlatformSupport)||void 0===y||y.call(v,{ReactiveElement:S}),(null!==(_=(b=globalThis).reactiveElementVersions)&&void 0!==_?_:b.reactiveElementVersions=[]).push("1.0.0-rc.2");const O=globalThis.trustedTypes,P=O?O.createPolicy("lit-html",{createHTML:t=>t}):void 0,j=`lit$${(Math.random()+"").slice(9)}$`,R="?"+j,I=`<${R}>`,F=document,M=(t="")=>F.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,D=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,G=/-->/g,N=/>/g,B=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,q=/'/g,W=/"/g,V=/^(?:script|style|textarea)$/i,U=(H=1,(t,...e)=>({_$litType$:H,strings:t,values:e})),X=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Y=new WeakMap,Z=F.createTreeWalker(F,129,null,!1);var H,$,J,Q,tt,et,it;class ot{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const a=t.length-1,s=this.parts,[l,u]=((t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",a=L;for(let l=0;l<i;l++){const e=t[l];let i,s,u=-1,p=0;for(;p<e.length&&(a.lastIndex=p,s=a.exec(e),null!==s);)p=a.lastIndex,a===L?"!--"===s[1]?a=G:void 0!==s[1]?a=N:void 0!==s[2]?(V.test(s[2])&&(n=RegExp("</"+s[2],"g")),a=B):void 0!==s[3]&&(a=B):a===B?">"===s[0]?(a=null!=n?n:L,u=-1):void 0===s[1]?u=-2:(u=a.lastIndex-s[2].length,i=s[1],a=void 0===s[3]?B:'"'===s[3]?W:q):a===W||a===q?a=B:a===G||a===N?a=L:(a=B,n=void 0);const d=a===B&&t[l+1].startsWith("/>")?" ":"";r+=a===L?e+I:u>=0?(o.push(i),e.slice(0,u)+"$lit$"+e.slice(u)+j+d):e+j+(-2===u?(o.push(void 0),l):d)}const s=r+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==P?P.createHTML(s):s,o]})(t,e);if(this.el=ot.createElement(l,i),Z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Z.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(j)){const i=u[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(j),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?lt:"?"===e[1]?ut:"@"===e[1]?pt:st})}else s.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(V.test(o.tagName)){const t=o.textContent.split(j),e=t.length-1;if(e>0){o.textContent=O?O.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],M()),Z.nextNode(),s.push({type:2,index:++n});o.append(t[e],M())}}}else if(8===o.nodeType)if(o.data===R)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(j,t+1));)s.push({type:7,index:n}),t+=j.length-1}n++}}static createElement(t,e){const i=F.createElement("template");return i.innerHTML=t,i}}function nt(t,e,i=t,o){var n,r,a,s;if(e===X)return e;let l=void 0!==o?null===(n=i.Σi)||void 0===n?void 0:n[o]:i.Σo;const u=A(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==u&&(null===(r=null==l?void 0:l.O)||void 0===r||r.call(l,!1),void 0===u?l=void 0:(l=new u(t),l.T(t,i,o)),void 0!==o?(null!==(a=(s=i).Σi)&&void 0!==a?a:s.Σi=[])[o]=l:i.Σo=l),void 0!==l&&(e=nt(t,l.S(t,e.values),l,o)),e}class rt{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:i},parts:o}=this.D,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:F).importNode(i,!0);Z.currentNode=n;let r=Z.nextNode(),a=0,s=0,l=o[0];for(;void 0!==l;){if(a===l.index){let e;2===l.type?e=new at(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new dt(r,this,t)),this.l.push(e),l=o[++s]}a!==(null==l?void 0:l.index)&&(r=Z.nextNode(),a++)}return n}v(t){let e=0;for(const i of this.l)void 0!==i&&(void 0!==i.strings?(i.I(t,i,e),e+=i.strings.length-2):i.I(t[e])),e++}}class at{constructor(t,e,i,o){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=i,this.options=o}setConnected(t){var e;null===(e=this.P)||void 0===e||e.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,e=this){t=nt(this,t,e),A(t)?t===K||null==t||""===t?(this.H!==K&&this.R(),this.H=K):t!==this.H&&t!==X&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return D(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.g(t):this.m(t)}k(t,e=this.B){return this.A.parentNode.insertBefore(t,e)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const e=this.A.nextSibling;null!==e&&3===e.nodeType&&(null===this.B?null===e.nextSibling:e===this.B.previousSibling)?e.data=t:this.$(F.createTextNode(t)),this.H=t}_(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this.C(t):(void 0===o.el&&(o.el=ot.createElement(o.h,this.options)),o);if((null===(e=this.H)||void 0===e?void 0:e.D)===n)this.H.v(i);else{const t=new rt(n,this),e=t.u(this.options);t.v(i),this.$(e),this.H=t}}C(t){let e=Y.get(t.strings);return void 0===e&&Y.set(t.strings,e=new ot(t)),e}g(t){D(this.H)||(this.H=[],this.R());const e=this.H;let i,o=0;for(const n of t)o===e.length?e.push(i=new at(this.k(M()),this.k(M()),this,this.options)):i=e[o],i.I(n),o++;o<e.length&&(this.R(i&&i.B.nextSibling,o),e.length=o)}R(t=this.A.nextSibling,e){var i;for(null===(i=this.P)||void 0===i||i.call(this,!1,!0,e);t&&t!==this.B;){const e=t.nextSibling;t.remove(),t=e}}}class st{constructor(t,e,i,o,n){this.type=1,this.H=K,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill(K),this.strings=i):this.H=K}get tagName(){return this.element.tagName}I(t,e=this,i,o){const n=this.strings;let r=!1;if(void 0===n)t=nt(this,t,e,0),r=!A(t)||t!==this.H&&t!==X,r&&(this.H=t);else{const o=t;let a,s;for(t=n[0],a=0;a<n.length-1;a++)s=nt(this,o[i+a],e,a),s===X&&(s=this.H[a]),r||(r=!A(s)||s!==this.H[a]),s===K?t=K:t!==K&&(t+=(null!=s?s:"")+n[a+1]),this.H[a]=s}r&&!o&&this.W(t)}W(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class lt extends st{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===K?void 0:t}}class ut extends st{constructor(){super(...arguments),this.type=4}W(t){t&&t!==K?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class pt extends st{constructor(){super(...arguments),this.type=5}I(t,e=this){var i;if((t=null!==(i=nt(this,t,e,0))&&void 0!==i?i:K)===X)return;const o=this.H,n=t===K&&o!==K||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==K&&(o===K||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var e,i;"function"==typeof this.H?this.H.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this.H.handleEvent(t)}}class dt{constructor(t,e,i){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=e,this.options=i}I(t){nt(this,t)}}null===(z=(C=globalThis).litHtmlPlatformSupport)||void 0===z||z.call(C,ot,at),(null!==(T=(E=globalThis).litHtmlVersions)&&void 0!==T?T:E.litHtmlVersions=[]).push("2.0.0-rc.3"),(null!==($=(it=globalThis).litElementVersions)&&void 0!==$?$:it.litElementVersions=[]).push("3.0.0-rc.2");class ht extends S{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=((t,e,i)=>{var o,n;const r=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=r._$litPart$;if(void 0===a){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=a=new at(e.insertBefore(M(),t),t,void 0,i)}return a.I(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return X}}ht.finalized=!0,ht._$litElement$=!0,null===(Q=(J=globalThis).litElementHydrateSupport)||void 0===Q||Q.call(J,{LitElement:ht}),null===(et=(tt=globalThis).litElementPlatformSupport)||void 0===et||et.call(tt,{LitElement:ht});
17
+ var C,z,T,E;S.finalized=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null===(y=(v=globalThis).reactiveElementPlatformSupport)||void 0===y||y.call(v,{ReactiveElement:S}),(null!==(_=(b=globalThis).reactiveElementVersions)&&void 0!==_?_:b.reactiveElementVersions=[]).push("1.0.0-rc.2");const O=globalThis.trustedTypes,P=O?O.createPolicy("lit-html",{createHTML:t=>t}):void 0,j=`lit$${(Math.random()+"").slice(9)}$`,R="?"+j,I=`<${R}>`,F=document,M=(t="")=>F.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,D=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,G=/-->/g,N=/>/g,B=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,q=/'/g,W=/"/g,V=/^(?:script|style|textarea)$/i,U=($=1,(t,...e)=>({_$litType$:$,strings:t,values:e})),X=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Y=new WeakMap,Z=F.createTreeWalker(F,129,null,!1);var $,H,J,Q,tt,et,it;class ot{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const a=t.length-1,s=this.parts,[l,u]=((t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",a=L;for(let l=0;l<i;l++){const e=t[l];let i,s,u=-1,p=0;for(;p<e.length&&(a.lastIndex=p,s=a.exec(e),null!==s);)p=a.lastIndex,a===L?"!--"===s[1]?a=G:void 0!==s[1]?a=N:void 0!==s[2]?(V.test(s[2])&&(n=RegExp("</"+s[2],"g")),a=B):void 0!==s[3]&&(a=B):a===B?">"===s[0]?(a=null!=n?n:L,u=-1):void 0===s[1]?u=-2:(u=a.lastIndex-s[2].length,i=s[1],a=void 0===s[3]?B:'"'===s[3]?W:q):a===W||a===q?a=B:a===G||a===N?a=L:(a=B,n=void 0);const d=a===B&&t[l+1].startsWith("/>")?" ":"";r+=a===L?e+I:u>=0?(o.push(i),e.slice(0,u)+"$lit$"+e.slice(u)+j+d):e+j+(-2===u?(o.push(void 0),l):d)}const s=r+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==P?P.createHTML(s):s,o]})(t,e);if(this.el=ot.createElement(l,i),Z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Z.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(j)){const i=u[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(j),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?lt:"?"===e[1]?ut:"@"===e[1]?pt:st})}else s.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(V.test(o.tagName)){const t=o.textContent.split(j),e=t.length-1;if(e>0){o.textContent=O?O.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],M()),Z.nextNode(),s.push({type:2,index:++n});o.append(t[e],M())}}}else if(8===o.nodeType)if(o.data===R)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(j,t+1));)s.push({type:7,index:n}),t+=j.length-1}n++}}static createElement(t,e){const i=F.createElement("template");return i.innerHTML=t,i}}function nt(t,e,i=t,o){var n,r,a,s;if(e===X)return e;let l=void 0!==o?null===(n=i.Σi)||void 0===n?void 0:n[o]:i.Σo;const u=A(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==u&&(null===(r=null==l?void 0:l.O)||void 0===r||r.call(l,!1),void 0===u?l=void 0:(l=new u(t),l.T(t,i,o)),void 0!==o?(null!==(a=(s=i).Σi)&&void 0!==a?a:s.Σi=[])[o]=l:i.Σo=l),void 0!==l&&(e=nt(t,l.S(t,e.values),l,o)),e}class rt{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:i},parts:o}=this.D,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:F).importNode(i,!0);Z.currentNode=n;let r=Z.nextNode(),a=0,s=0,l=o[0];for(;void 0!==l;){if(a===l.index){let e;2===l.type?e=new at(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new dt(r,this,t)),this.l.push(e),l=o[++s]}a!==(null==l?void 0:l.index)&&(r=Z.nextNode(),a++)}return n}v(t){let e=0;for(const i of this.l)void 0!==i&&(void 0!==i.strings?(i.I(t,i,e),e+=i.strings.length-2):i.I(t[e])),e++}}class at{constructor(t,e,i,o){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=i,this.options=o}setConnected(t){var e;null===(e=this.P)||void 0===e||e.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,e=this){t=nt(this,t,e),A(t)?t===K||null==t||""===t?(this.H!==K&&this.R(),this.H=K):t!==this.H&&t!==X&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return D(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.g(t):this.m(t)}k(t,e=this.B){return this.A.parentNode.insertBefore(t,e)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const e=this.A.nextSibling;null!==e&&3===e.nodeType&&(null===this.B?null===e.nextSibling:e===this.B.previousSibling)?e.data=t:this.$(F.createTextNode(t)),this.H=t}_(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this.C(t):(void 0===o.el&&(o.el=ot.createElement(o.h,this.options)),o);if((null===(e=this.H)||void 0===e?void 0:e.D)===n)this.H.v(i);else{const t=new rt(n,this),e=t.u(this.options);t.v(i),this.$(e),this.H=t}}C(t){let e=Y.get(t.strings);return void 0===e&&Y.set(t.strings,e=new ot(t)),e}g(t){D(this.H)||(this.H=[],this.R());const e=this.H;let i,o=0;for(const n of t)o===e.length?e.push(i=new at(this.k(M()),this.k(M()),this,this.options)):i=e[o],i.I(n),o++;o<e.length&&(this.R(i&&i.B.nextSibling,o),e.length=o)}R(t=this.A.nextSibling,e){var i;for(null===(i=this.P)||void 0===i||i.call(this,!1,!0,e);t&&t!==this.B;){const e=t.nextSibling;t.remove(),t=e}}}class st{constructor(t,e,i,o,n){this.type=1,this.H=K,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill(K),this.strings=i):this.H=K}get tagName(){return this.element.tagName}I(t,e=this,i,o){const n=this.strings;let r=!1;if(void 0===n)t=nt(this,t,e,0),r=!A(t)||t!==this.H&&t!==X,r&&(this.H=t);else{const o=t;let a,s;for(t=n[0],a=0;a<n.length-1;a++)s=nt(this,o[i+a],e,a),s===X&&(s=this.H[a]),r||(r=!A(s)||s!==this.H[a]),s===K?t=K:t!==K&&(t+=(null!=s?s:"")+n[a+1]),this.H[a]=s}r&&!o&&this.W(t)}W(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class lt extends st{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===K?void 0:t}}class ut extends st{constructor(){super(...arguments),this.type=4}W(t){t&&t!==K?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class pt extends st{constructor(){super(...arguments),this.type=5}I(t,e=this){var i;if((t=null!==(i=nt(this,t,e,0))&&void 0!==i?i:K)===X)return;const o=this.H,n=t===K&&o!==K||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==K&&(o===K||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var e,i;"function"==typeof this.H?this.H.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this.H.handleEvent(t)}}class dt{constructor(t,e,i){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=e,this.options=i}I(t){nt(this,t)}}null===(z=(C=globalThis).litHtmlPlatformSupport)||void 0===z||z.call(C,ot,at),(null!==(T=(E=globalThis).litHtmlVersions)&&void 0!==T?T:E.litHtmlVersions=[]).push("2.0.0-rc.3"),(null!==(H=(it=globalThis).litElementVersions)&&void 0!==H?H:it.litElementVersions=[]).push("3.0.0-rc.2");class ht extends S{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=((t,e,i)=>{var o,n;const r=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=r._$litPart$;if(void 0===a){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=a=new at(e.insertBefore(M(),t),t,void 0,i)}return a.I(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return X}}ht.finalized=!0,ht._$litElement$=!0,null===(Q=(J=globalThis).litElementHydrateSupport)||void 0===Q||Q.call(J,{LitElement:ht}),null===(et=(tt=globalThis).litElementPlatformSupport)||void 0===et||et.call(tt,{LitElement:ht});
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
@@ -30,11 +30,11 @@ const ct=t=>e=>{return"function"==typeof e?(i=t,o=e,window.customElements.define
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */function mt(t){return gt(l(s({},t),{state:!0,attribute:!1}))}var vt=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}(),yt="propertychange",_t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function bt(t,e){return t>e?1:t<e?-1:0}function xt(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function kt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function wt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function St(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function Ct(){return!0}function zt(){return!1}function Tt(){}var Et="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function Ot(t){for(var e in t)delete t[e]}var Pt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function jt(t){var e;for(e in t)return!1;return!e}var Rt,It=(Rt=function(t,e){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Ft=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return It(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new vt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,Tt);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Ot(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=Tt,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(_t),Mt="change",At="error",Dt="clear",Lt="contextmenu",Gt="click",Nt="dblclick",Bt="keydown",qt="keypress",Wt="load",Vt="resize",Ut="touchmove",Xt="wheel";function Kt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Yt(t,e,i,o){return Kt(t,e,i,o,!0)}function Zt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Ot(t))}var Ht=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$t=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return Ht(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Mt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Kt(this,t[n],e);return o}return Kt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Yt(this,t[n],e)}else i=Yt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Zt(t[e]);else Zt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(Ft);$t.prototype.on,$t.prototype.once,$t.prototype.un;var Jt=$t;function Qt(){return function(){throw new Error("Unimplemented abstract method.")}()}var te=0;function ee(t){return t.ol_uid||(t.ol_uid=String(++te))}var ie=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oe=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return ie(e,t),e}(vt),ne=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,ee(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return ie(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&Et({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new oe(i,t,e)),i=yt,this.dispatchEvent(new oe(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Et(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],jt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Jt),re="postrender",ae="movestart",se="moveend",le="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ue=-1!==le.indexOf("firefox");-1!==le.indexOf("safari")&&le.indexOf("chrom");var pe=-1!==le.indexOf("webkit")&&-1==le.indexOf("edge"),de=-1!==le.indexOf("macintosh"),he="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ce="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,fe="undefined"!=typeof Image&&Image.prototype.decode,ge=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function me(t,e,i,o){var n;return i&&i.length?n=i.shift():ce?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function ve(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ye(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var _e=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),be=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return _e(e,t),e.prototype.disposeInternal=function(){ye(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ye(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Zt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Tt&&this.listenerKeys.push(Kt(t,re,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(ne),xe=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"),ke=["style","variant","weight","size","lineHeight","family"],we=function(t){var e=t.match(xe);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ke.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ke[o]]=r)}return i.families=i.family.split(/,\s?/),i};function Se(t){return 1===t?"":String(Math.round(100*t)/100)}var Ce="opacity",ze="visible",Te="extent",Ee="zIndex",Oe="maxResolution",Pe="minResolution",je="maxZoom",Re="minZoom",Ie="source",Fe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Me=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Fe(e,t),e}(Error);function Ae(t,e){if(!t)throw new Me(e)}function De(t,e,i){return Math.min(Math.max(t,e),i)}var Le="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ge="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ne(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return Be(t,e,i,o)}function Be(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function qe(t){return t*Math.PI/180}function We(t,e){var i=t%e;return i*e<0?i+e:i}function Ve(t,e,i){return t+i*(e-t)}var Ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xe=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Et({},e);return"object"==typeof e.properties&&(delete o.properties,Et(o,e.properties)),o[Ce]=void 0!==e.opacity?e.opacity:1,Ae("number"==typeof o[Ce],64),o[ze]=void 0===e.visible||e.visible,o[Ee]=e.zIndex,o[Oe]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Pe]=void 0!==e.minResolution?e.minResolution:0,o[Re]=void 0!==e.minZoom?e.minZoom:-1/0,o[je]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return Ue(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=De(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Qt()},e.prototype.getLayerStatesArray=function(t){return Qt()},e.prototype.getExtent=function(){return this.get(Te)},e.prototype.getMaxResolution=function(){return this.get(Oe)},e.prototype.getMinResolution=function(){return this.get(Pe)},e.prototype.getMinZoom=function(){return this.get(Re)},e.prototype.getMaxZoom=function(){return this.get(je)},e.prototype.getOpacity=function(){return this.get(Ce)},e.prototype.getSourceState=function(){return Qt()},e.prototype.getVisible=function(){return this.get(ze)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setExtent=function(t){this.set(Te,t)},e.prototype.setMaxResolution=function(t){this.set(Oe,t)},e.prototype.setMinResolution=function(t){this.set(Pe,t)},e.prototype.setMaxZoom=function(t){this.set(je,t)},e.prototype.setMinZoom=function(t){this.set(Re,t)},e.prototype.setOpacity=function(t){Ae("number"==typeof t,64),this.set(Ce,t)},e.prototype.setVisible=function(t){this.set(ze,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(ne),Ke="prerender",Ye="postrender",Ze="precompose",He="postcompose",$e="rendercomplete",Je="undefined",Qe="ready",ti=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ei(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var ii=function(t){function e(e){var i=this,o=Et({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Ie,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return ti(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Ie)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Je},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Zt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Kt(t,Mt,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Zt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Zt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Kt(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Ae(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Kt(this,Mt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Ie,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Xe),oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ni=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Gt,i.handleClick_.bind(i),!1);var d=n+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),h=i.element;return h.className=d,h.appendChild(i.toggleButton_),h.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return oi(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(ei(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var d=0,h=p.length;d<h;++d)p[d]in e||(i.push(p[d]),e[p[d]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!St(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?ve(this.collapseLabel_,this.label_):ve(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(be),ri="add",ai="remove",si=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),li="length",ui=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return si(e,t),e}(vt),pi=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return si(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(li)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ui(ri,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ui(ai,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ui(ai,o,t)),this.dispatchEvent(new ui(ri,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(li,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Me(58)},e}(ne);function di(t){return Math.pow(t,3)}function hi(t){return 1-di(1-t)}function ci(t){return 3*t*t-2*t*t*t}function fi(t){return t}var gi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Gt,i.handleClick_.bind(i),!1);var u=n+" ol-unselectable ol-control",p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return gi(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:hi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==i?n&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=o}this.rotation_=i}},e}(be),vi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",d=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=p,h.appendChild("string"==typeof l?document.createTextNode(l):l),h.addEventListener(Gt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=d,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Gt,i.handleClick_.bind(i,-r),!1);var f=n+" ol-unselectable ol-control",g=i.element;return g.className=f,g.appendChild(h),g.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return vi(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:hi})):e.setZoom(o)}}},e}(be),_i="pointermove",bi="pointerdown",xi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},ki={};ki[xi.RADIANS]=6370997/(2*Math.PI),ki[xi.DEGREES]=2*Math.PI*6370997/360,ki[xi.FEET]=.3048,ki[xi.METERS]=1,ki[xi.USFEET]=1200/3937;var wi=xi,Si=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ki[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),Ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zi=6378137*Math.PI,Ti=[-zi,-zi,zi,zi],Ei=[-180,-85,180,85],Oi=6378137*Math.log(Math.tan(Math.PI/2)),Pi=function(t){function e(e){return t.call(this,{code:e,units:wi.METERS,extent:Ti,global:!0,worldExtent:Ei,getPointResolution:function(t,e){return t/Le(e[1]/6378137)}})||this}return Ci(e,t),e}(Si),ji=[new Pi("EPSG:3857"),new Pi("EPSG:102100"),new Pi("EPSG:102113"),new Pi("EPSG:900913"),new Pi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Pi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ri(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=zi*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Oi?s=Oi:s<-Oi&&(s=-Oi),r[a+1]=s}return r}function Ii(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/zi,r[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return r}var Fi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mi=[-180,-90,180,90],Ai=6378137*Math.PI/180,Di=function(t){function e(e,i){return t.call(this,{code:e,units:wi.DEGREES,extent:Mi,axisOrientation:i,global:!0,metersPerUnit:Ai,worldExtent:Mi})||this}return Fi(e,t),e}(Si),Li=[new Di("CRS:84"),new Di("EPSG:4326","neu"),new Di("urn:ogc:def:crs:OGC:1.3:CRS84"),new Di("urn:ogc:def:crs:OGC:2:84"),new Di("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Di("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Di("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Gi={};var Ni={};function Bi(t,e,i){var o=t.getCode(),n=e.getCode();o in Ni||(Ni[o]={}),Ni[o][n]=i}var qi="bottom-left",Wi="bottom-right",Vi="top-left",Ui="top-right",Xi=0,Ki=1,Yi=2,Zi=4,Hi=8,$i=16;function Ji(t){for(var e=ao(),i=0,o=t.length;i<o;++i)fo(e,t[i]);return e}function Qi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function to(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function eo(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function io(t,e){return no(t,e[0],e[1])}function oo(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function no(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function ro(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Xi;return a<i?l|=$i:a>n&&(l|=Zi),s<o?l|=Hi:s>r&&(l|=Yi),l===Xi&&(l=Ki),l}function ao(){return[1/0,1/0,-1/0,-1/0]}function so(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function lo(t){return so(1/0,1/0,-1/0,-1/0,t)}function uo(t,e){var i=t[0],o=t[1];return so(i,o,i,o,e)}function po(t,e,i,o,n){return go(lo(n),t,e,i,o)}function ho(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function co(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function fo(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function go(t,e,i,o,n){for(;i<o;i+=n)mo(t,e[i],e[i+1]);return t}function mo(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function vo(t,e){var i;return(i=e(_o(t)))||(i=e(bo(t)))||(i=e(To(t)))?i:(i=e(zo(t)))||!1}function yo(t){var e=0;return Po(t)||(e=Eo(t)*So(t)),e}function _o(t){return[t[0],t[1]]}function bo(t){return[t[2],t[1]]}function xo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ko(t,e){var i;return e===qi?i=_o(t):e===Wi?i=bo(t):e===Vi?i=zo(t):e===Ui?i=To(t):Ae(!1,13),i}function wo(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,d=a*s,h=a*l,c=t[0],f=t[1],g=c-u+h,m=c-u-h,v=c+u-h,y=c+u+h,_=f-p-d,b=f-p+d,x=f+p+d,k=f+p-d;return so(Math.min(g,m,v,y),Math.min(_,b,x,k),Math.max(g,m,v,y),Math.max(_,b,x,k),n)}function So(t){return t[3]-t[1]}function Co(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return Oo(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):lo(o),o}function zo(t){return[t[0],t[3]]}function To(t){return[t[2],t[3]]}function Eo(t){return t[2]-t[0]}function Oo(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Po(t){return t[2]<t[0]||t[3]<t[1]}function jo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return so(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Ro="Point",Io="LineString",Fo="LinearRing",Mo="Polygon",Ao="MultiPoint",Do="MultiLineString",Lo="MultiPolygon",Go="GeometryCollection",No="Circle";function Bo(t,e,i){var o=i||6371008.8,n=qe(t[1]),r=qe(e[1]),a=(r-n)/2,s=qe(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function qo(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=qe(s-n)*(2+Math.sin(qe(r))+Math.sin(qe(l))),n=s,r=l}return i*e*e/2}function Wo(t,e){var i=e||{},o=i.radius||6371008.8,n=i.projection||"EPSG:3857",r=t.getType();r!==Go&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,d,h=0;switch(r){case Ro:case Ao:case Io:case Do:case Fo:break;case Mo:for(a=t.getCoordinates(),h=Math.abs(qo(a[0],o)),l=1,u=a.length;l<u;++l)h-=Math.abs(qo(a[l],o));break;case Lo:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],h+=Math.abs(qo(s[0],o)),p=1,d=s.length;p<d;++p)h-=Math.abs(qo(s[p],o));break;case Go:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)h+=Wo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return h}function Vo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],d=s[1],h=p-l,c=d-u,f=0===h&&0===c?0:(h*(n-l)+c*(r-u))/(h*h+c*c||0);return f<=0?(i=l,o=u):f>=1?(i=p,o=d):(i=l+f*h,o=u+f*c),[i,o]}function Uo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Xo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Ko(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Yo(t,e){return Math.sqrt(Ko(t,e))}function Zo(t,e){return Ko(t,Vo(t,e))}function Ho(t,e){if(e.canWrapX()){var i=Eo(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Eo(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function $o(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function Jo(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Qo(t){!function(t,e){Gi[t]=e}(t.getCode(),t),Bi(t,t,$o)}function tn(t){return"string"==typeof t?Gi[e=t]||Gi[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function en(t,e,i,o){var n,r=(t=tn(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/ki[o])}else{var a=t.getUnits();if(a==wi.DEGREES&&!o||o==wi.DEGREES)n=e;else{var s,l=sn(t,tn("EPSG:4326"));if(l===Jo&&a!==wi.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(Bo((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Bo(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?ki[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function on(t){!function(t){t.forEach(Qo)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Bi(e,t,$o)}))}))}function nn(t,e){return t?"string"==typeof t?tn(t):t:tn(e)}function rn(t,e){return un(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function an(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||sn(t,e)===$o)&&i}function sn(t,e){var i=function(t,e){var i;return t in Ni&&e in Ni[t]&&(i=Ni[t][e]),i}(t.getCode(),e.getCode());return i||(i=Jo),i}function ln(t,e){return sn(tn(t),tn(e))}function un(t,e,i){return ln(e,i)(t,void 0,t.length)}var pn,dn,hn;function cn(t,e){return t}function fn(t,e){return t}function gn(t,e){return t}function mn(t,e){return t}on(ji),on(Li),pn=ji,dn=Ri,hn=Ii,Li.forEach((function(t){pn.forEach((function(e){Bi(t,e,dn),Bi(e,t,hn)}))}));var vn,yn=new Array(6);function _n(t){return xn(t,1,0,0,1,0,0)}function bn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],d=e[3],h=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*d,t[3]=o*p+r*d,t[4]=i*h+n*c+a,t[5]=o*h+r*c+s,t}function xn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function kn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function wn(t,e,i){return bn(t,xn(yn,e,0,0,i,0,0))}function Sn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function Cn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Ae(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function zn(t){var e="matrix("+t.join(", ")+")";if(ce)return e;var i=vn||(vn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Tn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,En=/^([a-z]*)$|^hsla?\(.*\)$/i;function On(t){return"string"==typeof t?t:Mn(t)}var Pn,jn,Rn=(Pn={},jn=0,function(t){var e;if(Pn.hasOwnProperty(t))e=Pn[t];else{if(jn>=1024){var i=0;for(var o in Pn)0==(3&i++)&&(delete Pn[o],--jn)}e=function(t){var e,i,o,n,r;if(En.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Tn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Fn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Fn(r)):Ae(!1,14);return r}(t),Pn[t]=e,++jn}return e});function In(t){return Array.isArray(t)?t:Rn(t)}function Fn(t){return t[0]=De(t[0]+.5|0,0,255),t[1]=De(t[1]+.5|0,0,255),t[2]=De(t[2]+.5|0,0,255),t[3]=De(t[3],0,1),t}function Mn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function An(t,e,i){return e+":"+t+":"+(i?On(i):"null")}var Dn=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=An(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=An(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Ln=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Gn(t,e){Dn.expire()}var Nn=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return Ln(e,t),e.prototype.dispatchRenderEvent=function(t,e){Qt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;Sn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Cn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var d=u.projection,h=Ho(t.slice(),d),c=[[0,0]];if(d.canWrapX()&&o){var f=Eo(d.getExtent());c.push([-f,0],[f,0])}for(var g=e.layerStatesArray,m=g.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=g[b],k=x.layer;if(k.hasRenderer()&&ei(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?h:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var T=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*T})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Qt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,Ct,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Qt()},e.prototype.scheduleExpireIconCache=function(t){Dn.canExpireCache()&&t.postRenderFunctions.push(Gn)},e}(_t),Bn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Bn(e,t),e}(vt),Wn=[],Vn=[0,0,0,0],Un=new ne,Xn=new Ft;Xn.setSize=function(){console.warn("labelCache is deprecated.")};var Kn,Yn,Zn=null,Hn={},$n=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=tr(t+" "+a+" "+i+p,r),s!=p){var d=tr(t+" "+a+" "+i+s+","+p,r);l=l&&d!=e}}return!!l}function s(){for(var e=!0,i=Un.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Un.get(r)<100&&(a.apply(this,r.split("\n"))?(Ot(Hn),Zn=null,Kn=void 0,Un.set(r,100)):(Un.set(r,Un.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=we(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Un.get(u)&&(Un.set(u,100,!0),a(i.style,i.weight,l)||(Un.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Jn=function(t){var e=Hn[t];if(null==e){if(ce){var i=we(t),o=Qn(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Yn||((Yn=document.createElement("div")).innerHTML="M",Yn.style.minHeight="0",Yn.style.maxHeight="none",Yn.style.height="auto",Yn.style.padding="0",Yn.style.border="none",Yn.style.position="absolute",Yn.style.display="block",Yn.style.left="-99999px"),Yn.style.font=t,document.body.appendChild(Yn),e=Yn.offsetHeight,document.body.removeChild(Yn);Hn[t]=e}return e};function Qn(t,e){return Zn||(Zn=me(1,1)),t!=Kn&&(Zn.font=t,Kn=Zn.font),Zn.measureText(e)}function tr(t,e){return Qn(t,e).width}function er(t,e,i){if(e in i)return i[e];var o=tr(t,e);return i[e]=o,o}function ir(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Kt(Un,yt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return or(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new qn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Zt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ze,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,ei(s,i)&&(s.sourceState==Qe||s.sourceState==Je)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(He,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&ei(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var d=o(u,p);if(d)return d}}}},e}(Nn),rr="layergroup",ar="size",sr="target",lr="view",ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pr="layers",dr=function(t){function e(e){var i=this,o=e||{},n=Et({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(pr,i.handleLayersChanged_),r?Array.isArray(r)?r=new pi(r.slice(),{unique:!0}):Ae("function"==typeof r.getArray,43):r=new pi(void 0,{unique:!0}),i.setLayers(r),i}return ur(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Zt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Kt(t,ri,this.handleLayersAdd_,this),Kt(t,ai,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Zt);Ot(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[ee(r)]=[Kt(r,yt,this.handleLayerChange_,this),Kt(r,Mt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[ee(e)]=[Kt(e,yt,this.handleLayerChange_,this),Kt(e,Mt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=ee(t.element);this.listenerKeys_[e].forEach(Zt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(pr)},e.prototype.setLayers=function(t){this.set(pr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=Co(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Qe},e}(Xe),hr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return hr(e,t),e}(vt),fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return fr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(cr),mr={SINGLECLICK:"singleclick",CLICK:Gt,DBLCLICK:Nt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Kt(n,bi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Kt(n,_i,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Ut,o.boundHandleTouchMove_,!!ge&&{passive:!1}),o}return vr(e,t),e.prototype.emulateClick_=function(t){var e=new gr(mr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new gr(mr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new gr(mr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==mr.POINTERUP||e.type==mr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==mr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new gr(mr.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Zt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new gr(mr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?Tt:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Kt(n,mr.POINTERMOVE,this.handlePointerMove_,this),Kt(n,mr.POINTERUP,this.handlePointerUp_,this),Kt(this.element_,mr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Kt(this.element_.getRootNode(),mr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new gr(mr.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new gr(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Zt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Ut,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Zt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Zt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Ft),_r=1/0,br=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Ot(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Ae(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=_r&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==_r?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),xr=0,kr=1,wr=2,Sr=3,Cr=4,zr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Tr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return zr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Mt,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===wr||i===Sr||i===Cr){e.removeEventListener(Mt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==xr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(br);var Er=0,Or=1,Pr="center",jr="resolution",Rr="rotation";function Ir(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,d=s?s[1]:0,h=t[0]+l/2+p,c=t[2]-l/2+p,f=t[1]+u/2+d,g=t[3]-u/2+d;h>c&&(c=h=(c+h)/2),f>g&&(g=f=(g+f)/2);var m=De(o[0],h,c),v=De(o[1],f,g),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,h-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,f-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-g)/y)),[m,v]}}}function Fr(t){return t}function Mr(t,e,i,o){var n=Eo(e)/i[0],r=So(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Ar(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),De(o,i/2,2*e)}function Dr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Mr(t,o,s,n):t;return(void 0===i||i)&&l?Ar(r,u,e):De(r,e,u)}}}function Lr(t){return void 0!==t?0:void 0}function Gr(t){return void 0!==t?t:void 0}var Nr="XY",Br="XYZ",qr="XYM",Wr="XYZM";function Vr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function Ur(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],d=r[1],h=0,c=e;c<i;c+=o){var f=t[c]-p,g=t[c+1]-d;s[h++]=p+f*l-g*u,s[h++]=d+f*u+g*l;for(var m=c+2;m<c+o;++m)s[h++]=t[m]}return a&&s.length!=h&&(s.length=h),s}function Xr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Kr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yr=[1,0,0,1,0,0],Zr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&St(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Kr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Qt()},e.prototype.closestPointXY=function(t,e,i,o){return Qt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Qt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&lo(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){Qt()},e.prototype.scale=function(t,e,i){Qt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Qt()},e.prototype.getType=function(){return Qt()},e.prototype.applyTransform=function(t){Qt()},e.prototype.intersectsExtent=function(t){return Qt()},e.prototype.translate=function(t,e){Qt()},e.prototype.transform=function(t,e){var i=tn(t),o=i.getUnits()==wi.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=So(a)/So(r);return Sn(Yr,a[0],a[3],s,-s,0,0,0),Vr(t,0,t.length,n,Yr,o),ln(i,e)(t,o,n)}:ln(i,e);return this.applyTransform(o),this},e}(ne),Hr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function $r(t){var e;return t==Nr?e=2:t==Br||t==qr?e=3:t==Wr&&(e=4),e}var Jr=function(t){function e(){var e=t.call(this)||this;return e.layout=Nr,e.stride=2,e.flatCoordinates=null,e}return Hr(e,t),e.prototype.computeExtent=function(t){return po(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Qt()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=$r(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Qt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=$r(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Nr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Nr:3==t?e=Br:4==t&&(e=Wr);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Ur(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=xo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],d=0,h=e;h<i;h+=o){var c=t[h]-u,f=t[h+1]-p;l[d++]=u+n*c,l[d++]=p+r*f;for(var g=h+2;g<h+o;++g)l[d++]=t[g]}s&&l.length!=d&&(l.length=d)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Xr(i,0,i.length,o,t,e,i),this.changed()}},e}(Zr);function Qr(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,d=t[i+1]-u;if(0===p&&0===d)s=e;else{var h=((n-l)*p+(r-u)*d)/(p*p+d*d);if(h>1)s=i;else{if(h>0){for(var c=0;c<o;++c)a[c]=Ve(t[e+c],t[i+c],h);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function ta(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=Be(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function ea(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ta(t,e,s,o,n),e=s}return n}function ia(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var d,h;if(0===n){if((h=Be(a,s,t[e],t[e+1]))<u){for(d=0;d<o;++d)l[d]=t[e+d];return l.length=o,h}return u}for(var c=p||[NaN,NaN],f=e+o;f<i;)if(Qr(t,f-o,f,o,a,s,c),(h=Be(a,s,c[0],c[1]))<u){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o,f+=o}else f+=o*Math.max((Math.sqrt(h)-Math.sqrt(u))/n|0,1);if(r&&(Qr(t,i-o,e,o,a,s,c),(h=Be(a,s,c[0],c[1]))<u)){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o}return u}function oa(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=ia(t,e,f,o,n,r,a,s,l,u,d),e=f}return u}function na(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function ra(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function aa(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ra(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function sa(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var d=u.pop(),h=u.pop(),c=0,f=t[h],g=t[h+1],m=t[d],v=t[d+1],y=h+o;y<d;y+=o){var _=Ne(t[y],t[y+1],f,g,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,h+o<p&&u.push(h,p),p+o<d&&u.push(p,d))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function la(t,e){return e*Math.round(t/e)}function ua(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=la(t[e],n),p=la(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=la(t[e],n),l=la(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var d=la(t[e],n),h=la(t[e+1],n);if(e+=o,d!=s||h!=l){var c=s-u,f=l-p,g=d-u,m=h-p;c*m==f*g&&(c<0&&g<c||c==g||c>0&&g>c)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=d,l=h):(r[a++]=s,r[a++]=l,u=s,p=l,s=d,l=h)}}return r[a++]=s,r[a++]=l,a}function pa(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ua(t,e,p,o,n,r,a),s.push(a),e=p}return a}function da(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ha(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=da(t,e,u,o,r[a]),e=u}return r.length=a,r}function ca(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ha(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function fa(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function ga(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=fa(t,e,s,o),e=s}return n}var ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),va=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ma(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=sa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Nr)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr),ya=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_a=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ya(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=Be(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return uo(this.flatCoordinates,t)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return no(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=na(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr);function ba(t,e,i,o,n){return!vo(n,(function(n){return!xa(t,e,i,o,n[0],n[1])}))}function xa(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function ka(t,e,i,o,n,r){if(0===i.length)return!1;if(!xa(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(xa(t,i[a-1],i[a],o,n,r))return!1;return!0}function wa(t,e,i,o,n,r,a){for(var s,l,u,p,d,h,c,f=n[r+1],g=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],h=t[y-o+1],s=e;s<y;s+=o)d=t[s],c=t[s+1],(f<=h&&c<=f||h<=f&&f<=c)&&(u=(f-h)/(c-h)*(d-p)+p,g.push(u)),p=d,h=c}var _=NaN,b=-1/0;for(g.sort(bt),p=g[0],s=1,l=g.length;s<l;++s){d=g[s];var x=Math.abs(d-p);x>b&&ka(t,e,i,o,u=(p+d)/2,f)&&(_=u,b=x),p=d}return isNaN(_)&&(_=n[r]),a?(a.push(_,f,b),a):[_,f,b]}function Sa(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=wa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function Ca(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function za(t,e,i,o,n){var r=go([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!Oo(n,r)&&(!!oo(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||Ca(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=ro(t,e),r=ro(t,i);if(n===Ki||r===Ki)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],d=e[1],h=i[0],c=i[1],f=(c-d)/(h-p),g=void 0,m=void 0;r&Yi&&!(n&Yi)&&(o=(g=h-(c-u)/f)>=a&&g<=l),o||!(r&Zi)||n&Zi||(o=(m=c-(h-l)*f)>=s&&m<=u),o||!(r&Hi)||n&Hi||(o=(g=h-(c-s)/f)>=a&&g<=l),o||!(r&$i)||n&$i||(o=(m=c-(h-a)*f)>=s&&m<=u)}return o}(n,t,e)})))))}function Ta(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(za(t,e,i,o,n)||xa(t,e,i,o,n[0],n[1])||xa(t,e,i,o,n[0],n[3])||xa(t,e,i,o,n[2],n[1])||xa(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(ba(t,i[r-1],i[r],o,n)&&!za(t,i[r-1],i[r],o,n))return!1;return!0}function Ea(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Oa(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Pa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Oa(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function ja(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Oa(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Ea(t,e,l,o),e=l}return e}function Ra(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=ja(t,e,i[r],o,n);return e}var Ia=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fa=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Ia(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ea(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ga(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ja(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ha(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=xo(this.getExtent());this.flatInteriorPoint_=wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new _a(this.getFlatInteriorPoint(),qr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new va(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new va(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Pa(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ja(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=pa(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Nr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return Ta(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=aa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Jr),Ma=Fa;function Aa(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Fa(r,Nr,[r.length])}function Da(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var d=[l.length],h=new Fa(l,r,d);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*We(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(h,a,t.getRadius(),i),h}var La=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ga(t,e){setTimeout((function(){t(e)}),0)}function Na(t){return!(t.sourceCenter&&t.targetCenter&&!Uo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ba(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var qa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Et({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=nn(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=fn(o.center,i.projection_)),o.extent&&(o.extent=mn(o.extent,i.projection_)),i.applyOptions_(o),i}return La(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,h=nn(t.projection,"EPSG:3857"),c=h.getExtent(),f=t.constrainOnlyCenter,g=t.extent;u||g||!h.isGlobal()||(f=!1,g=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Mr(l,i,a,o):l;if(s)return void 0===e||e?Ar(n,p,u):De(n,u,p);var d=Math.min(p,n),h=Math.floor(xt(t,d,r));return t[h]>p&&h<t.length-1?t[h+1]:t[h]}}}(m,p,!f&&g,d):Dr(i,o,p,!f&&g,d)}else{var v=(c?Math.max(Eo(c),So(c)):360*ki[wi.DEGREES]/h.getMetersPerUnit())/256/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Mr(e,n,l,r):e,d=void 0!==i?i:0;if(u)return void 0===o||o?Ar(a,p,d):De(a,d,p);var h=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,f=Math.min(p,a),g=Math.floor(Math.log(e/f)/Math.log(t)+c),m=Math.max(h,g);return De(e/Math.pow(t,m),d,p)}}}(l,i,o,p,!f&&g,d):Dr(i,o,p,!f&&g,d)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ir(t.extent,t.constrainOnlyCenter,e)}var i=nn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Ir(o,!1,!1)}return Fr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||qe(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Gr:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Gr}return Lr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Et({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Et({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=Et({},o)).center=fn(o.center,this.getProjection())),o.anchor&&((o=Et({},o)).anchor=fn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],d={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||ci,callback:e};if(p.center&&(d.sourceCenter=a,d.targetCenter=p.center.slice(),a=d.targetCenter),void 0!==p.zoom?(d.sourceResolution=s,d.targetResolution=this.getResolutionForZoom(p.zoom),s=d.targetResolution):p.resolution&&(d.sourceResolution=s,d.targetResolution=p.resolution,s=d.targetResolution),void 0!==p.rotation){d.sourceRotation=l;var h=We(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=l+h,l=d.targetRotation}Na(d)?d.complete=!0:r+=d.duration,u.push(d)}this.animations_.push(u),this.setHint(Er,1),this.updateAnimations_()}else e&&Ga(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Er]>0},e.prototype.getInteracting=function(){return this.hints_[Or]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Er,-this.hints_[Er]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Ga(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var d=s.sourceCenter[0],h=s.sourceCenter[1],c=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=d+p*(c-d),m=h+p*(f-h);this.targetCenter_=[g,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?We(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Er,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Ga(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(Xo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?cn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Pr)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return gn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ae(i,1);var o=this.getResolution();Ae(void 0!==o,2);var n=this.getRotation();return Ae(void 0!==n,3),wo(i,o,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(jr)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(mn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Eo(t)/i[0],n=So(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Rr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ba(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=xt(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=De(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,De(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Ae(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Ae(!Po(t),25),i=Aa(o=mn(t,this.getProjection()));else if(t.getType()===No){var o;(i=Aa(o=mn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),xo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,d=n.length;p<d;p+=r){var h=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,h),s=Math.min(s,c),l=Math.max(l,h),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),d=Math.cos(u),h=xo(s);h[0]+=(r[1]-r[3])/2*l,h[1]+=(r[0]-r[2])/2*l;var c=h[0]*d-h[1]*p,f=h[1]*d+h[0]*p,g=this.getConstrainedCenter([c,f],l),m=i.callback?i.callback:Tt;void 0!==i.duration?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),Ga(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(fn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ba(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ba(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=cn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&fn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=fn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(fn(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Rr)!==o&&this.set(Rr,o),this.get(jr)!==r&&this.set(jr,r),this.get(Pr)&&Uo(this.get(Pr),a)||this.set(Pr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Uo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:hi,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Or,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&fn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Or,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(ne);function Wa(t){return t[0]>0&&t[1]>0}function Va(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Xa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new dr({layers:t.layers});r[rr]=a,r[sr]=t.target,r[lr]=t.view instanceof qa?t.view:new qa,void 0!==t.controls&&(Array.isArray(t.controls)?i=new pi(t.controls.slice()):(Ae("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new pi(t.interactions.slice()):(Ae("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new pi(t.overlays.slice()):(Ae("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new pi;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:he,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new pi,i.interactions=o.interactions||new pi,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Tr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(rr,i.handleLayerGroupChanged_),i.addChangeListener(lr,i.handleViewChanged_),i.addChangeListener(ar,i.handleSizeChanged_),i.addChangeListener(sr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof qa||e.view.then((function(t){n.setView(new qa(t))})),i.controls.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ai,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ai,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ri,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ai,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Ua(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:Ct,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||Ct;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:Ct,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(sr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return cn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?kn(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(rr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof pi)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=fn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?kn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ar)},e.prototype.getView=function(){return this.get(lr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return _r;if(!t.wantedTiles[i][e.getKey()])return _r;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new gr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===bi||i===Xt||i===Bt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Er]||n[Or]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener($e)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent($e,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Zt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Lt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Xt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(Vt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ye(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new yr(this,this.moveTolerance_),mr)this.mapBrowserEventHandler_.addEventListener(mr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Lt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Xt,this.boundHandleBrowserEvent_,!!ge&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Kt(n,Bt,this.handleBrowserEvent,this),Kt(n,qt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Vt,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Zt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Zt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Kt(t,yt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Kt(t,Mt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Zt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Kt(t,yt,this.render,this),Kt(t,Mt,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Wa(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:wo(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=wo(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!Po(this.previousExtent_)&&!ho(r.extent,this.previousExtent_))&&(this.dispatchEvent(new cr(ae,this,n)),this.previousExtent_=lo(this.previousExtent_));this.previousExtent_&&!r.viewHints[Er]&&!r.viewHints[Or]&&!ho(r.extent,this.previousExtent_)&&(this.dispatchEvent(new cr(se,this,r)),to(r.extent,this.previousExtent_))}this.dispatchEvent(new cr(re,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(rr,t)},e.prototype.setSize=function(t){this.set(ar,t)},e.prototype.setTarget=function(t){this.set(sr,t)},e.prototype.setView=function(t){if(!t||t instanceof qa)this.set(lr,t);else{this.set(lr,new qa);var e=this;t.then((function(t){e.setView(new qa(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Wa(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(ne),Ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ya="degrees",Za="imperial",Ha="nautical",$a="metric",Ja="us",Qa=[1,2,5],ts=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(o.units||$a),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Ka(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Ya?wi.DEGREES:wi.METERS,r=en(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,s=a*r,l="";if(o==Ya){var u=ki[wi.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==Za?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==Ha?(r/=1852,l="nm"):o==$a?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==Ja?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Ae(!1,33);for(var p,d,h,c,f=3*Math.floor(Math.log(a*r)/Math.log(10));;){h=Math.floor(f/3);var g=Math.pow(10,h);if(p=Qa[(f%3+3)%3]*g,d=Math.round(p/r),isNaN(d))return this.element.style.display="none",void(this.renderedVisible_=!1);if(d>=a)break;++f}c=this.scaleBar_?this.createScaleBar(d,p,l):p.toFixed(h<0?-h:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=en(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(be);function es(t){var e=t||{},i=new pi;return(void 0===e.zoom||e.zoom)&&i.push(new yi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new mi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ni(e.attributionOptions)),i}var is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var os=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return is(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Zt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Kt(t,Mt,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(Ae("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(ne),ns=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?tn(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===wi.TILE_PIXELS&&(o=tn(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Et({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Qt()},t.prototype.readFeature=function(t,e){return Qt()},t.prototype.readFeatures=function(t,e){return Qt()},t.prototype.readGeometry=function(t,e){return Qt()},t.prototype.readProjection=function(t){return Qt()},t.prototype.writeFeature=function(t,e){return Qt()},t.prototype.writeFeatures=function(t,e){return Qt()},t.prototype.writeGeometry=function(t,e){return Qt()},t}();function rs(t,e,i){var o,n=i?tn(i.featureProjection):null,r=i?tn(i.dataProjection):null;if(o=n&&r&&!an(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var as="arraybuffer",ss="json",ls="text",us="xml",ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ds(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var hs=function(t){function e(){return t.call(this)||this}return ps(e,t),e.prototype.getType=function(){return ss},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Qt()},e.prototype.readFeaturesFromObject=function(t,e){return Qt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Qt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(ds(t))},e.prototype.readProjectionFromObject=function(t){return Qt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Qt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Qt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Qt()},e}(ns);function cs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],d=t[e+1],h=0,c=[0],f=e+o;f<i;f+=o){var g=t[f],m=t[f+1];h+=Math.sqrt((g-p)*(g-p)+(m-d)*(m-d)),c.push(h),p=g,d=m}var v=n*h,y=function(t,e,i){for(var o,n,r=i||bt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(f=0;f<_;++f)b[f]=void 0===s?NaN:void 0===l?t[s+f]:Ve(t[s+f],t[s+o+f],l);return b}function fs(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var d=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var h=0;h<o-1;++h)a.push(Ve(t[(s-1)*o+h],t[s*o+h],d));return a.push(n),a}function gs(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vs=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ms(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?wt(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=qr&&this.layout!=Wr)return null;var i=void 0!==e&&e;return fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return cs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return gs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=sa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Nr)},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){return za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr),ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_s=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout()),wt(s,d.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return ys(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ea(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=qr&&this.layout!=Wr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return fs(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return fs(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ha(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new vs(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new vs(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];wt(t,cs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=sa(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Nr,o)},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(za(t,e,i[r],o,n))return!0;e=i[r]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=aa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Jr),bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xs=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return bs(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<eo(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=Be(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new _a(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new _a(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(no(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr);function ks(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=po(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var ws=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ss=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout());for(var h=s.length,c=d.getEnds(),f=0,g=c.length;f<g;++f)c[f]+=h;wt(s,d.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return ws(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;wt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ea(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=oa(t,e,f,o,n,r,a,s,l,u,d),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(ka(t,e,l,o,n,r))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ga(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ra(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ca(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ks(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Sa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new xs(this.getFlatInteriorPoints().slice(),qr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Pa(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ra(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],d=[];a=pa(t,e,p,o,n,r,a,d),s.push(d),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Nr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ma(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var d=new Ma(e.slice(n,l),t,s);o.push(d),n=l}return o},e.prototype.getType=function(){return Lo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ta(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=aa(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(Jr),Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function zs(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Ts=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return Cs(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Zt),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Kt(this.geometries_[t],Mt,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<eo(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){lo(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)co(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return zs(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Go},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=xo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(zs(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Zr),Es=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Os(t,e){if(!t)return null;var i;switch(t.type){case Ro:i=function(t){return new _a(t.coordinates)}(t);break;case Io:i=function(t){return new vs(t.coordinates)}(t);break;case Mo:i=function(t){return new Ma(t.coordinates)}(t);break;case Ao:i=function(t){return new xs(t.coordinates)}(t);break;case Do:i=function(t){return new _s(t.coordinates)}(t);break;case Lo:i=function(t){return new Ss(t.coordinates)}(t);break;case Go:i=function(t,e){var i=t.geometries.map((function(t){return Os(t,e)}));return new Ts(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return rs(i,!1,e)}function Ps(t,e){var i,o=(t=rs(t,!0,e)).getType();switch(o){case Ro:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Io:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ao:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Do:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Lo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Go:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Et({},e);return delete i.featureProjection,Ps(t,i)}))}}(t,e);break;case No:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var js=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=tn(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=tn(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Es(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Os((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new os;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Os(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=tn(i.properties.name):"EPSG"===i.type?e=tn("EPSG:"+i.properties.code):Ae(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ps(r,e),delete n[t.getGeometryName()]),jt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ps(t,this.adaptOptions(e))},e}(hs),Rs=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Is="fraction",Fs="pixels",Ms="bottom-left",As="bottom-right",Ds="top-left",Ls="top-right",Gs=0,Ns=1,Bs=2,qs=3,Ws=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Va(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Qt()},t.prototype.getImage=function(t){return Qt()},t.prototype.getHitDetectionImage=function(){return Qt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Qt()},t.prototype.getImageSize=function(){return Qt()},t.prototype.getOrigin=function(){return Qt()},t.prototype.getSize=function(){return Qt()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(t)},t.prototype.listenImageChange=function(t){Qt()},t.prototype.load=function(){Qt()},t.prototype.unlistenImageChange=function(t){Qt()},t}(),Vs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Us=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Vs(e,t),e.prototype.changed=function(){this.dispatchEvent(Mt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Qt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Qt()},e}(Ft),Xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ks(t,e,i){var o=t;if(o.src&&fe){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Yt(o,Wt,e),Yt(o,At,i)];return function(){a.forEach(Zt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Gs)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Gs,s.imageLoadFunction_=a,s}Xs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=qs,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=So(this.extent)/this.image_.height),this.state=Bs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Gs&&this.state!=qs||(this.state=Ns,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=So(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Us);var Ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zs=null,Hs=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return Ys(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Bs){Zs||(Zs=me(1,1)),Zs.drawImage(this.image_,0,0);try{Zs.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Zs=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt)},e.prototype.handleImageError_=function(){this.imageState_=qs,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Bs,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=me(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Gs){this.imageState_=Ns;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Bs){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=On(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ft);var $s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Js=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Ds,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Is,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Is,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Ae(!(void 0!==p&&l),4),Ae(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||ee(l)),Ae(void 0!==p&&p.length>0,6);var d=void 0!==o.src?Gs:Bs;return i.color_=void 0!==o.color?In(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Dn.get(e,o,r);return a||(a=new Hs(t,e,i,o,n,r),Dn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,d,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Ds,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return $s(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Is||this.anchorYUnits_==Is){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Is&&(t[0]*=e[0]),this.anchorYUnits_==Is&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ds){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ls&&this.anchorOrigin_!=As||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ms&&this.anchorOrigin_!=As||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ds){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ls&&this.offsetOrigin_!=As||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ms&&this.offsetOrigin_!=As||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Mt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Mt,t)},e}(Ws),Qs=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||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.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();function tl(t){return Array.isArray(t)?Mn(t):t}var el=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),il=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return el(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({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},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,o=me(i.size*t,i.size*t);this.draw_(i,o,t),e=o.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Bs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),d=p/l;if("miter"===t&&d<=i)return d*e;var h=e/2/d,c=e/2*(u/p),f=Math.sqrt((o+h)*(o+h)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=o*Math.sin(s),m=n-Math.sqrt(o*o-g*g),v=Math.sqrt(g*g+m*m)/g;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(f,y)}return 2*f},e.prototype.createRenderOptions=function(){var t,e="round",i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=tl(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o="#000"),e.fillStyle=tl(o),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=In(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=me(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Ws),ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return ol(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(il),rl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=ul,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,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.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=ul,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var al=null;function sl(t,e){if(!al){var i=new Rs({color:"rgba(255,255,255,0.4)"}),o=new Qs({color:"#3399CC",width:1.25});al=[new rl({image:new nl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return al}function ll(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Mo]=[new rl({fill:new Rs({color:[255,255,255,.5]})})],t[Lo]=t[Mo],t[Io]=[new rl({stroke:new Qs({color:e,width:5})}),new rl({stroke:new Qs({color:i,width:3})})],t[Do]=t[Io],t[No]=t[Mo].concat(t[Io]),t[Ro]=[new rl({image:new nl({radius:6,fill:new Rs({color:i}),stroke:new Qs({color:e,width:1.5})}),zIndex:1/0})],t[Ao]=t[Ro],t[Go]=t[Mo].concat(t[Io],t[Ro]),t}function ul(t){return t.getGeometry()}var pl=rl,dl="point",hl="line",cl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Va(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Rs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:dl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=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(e)?e.slice():e,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.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function fl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gl={
33
+ */function mt(t){return gt(l(s({},t),{state:!0,attribute:!1}))}var vt=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}(),yt="propertychange",_t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function bt(t,e){return t>e?1:t<e?-1:0}function xt(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function kt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function wt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function St(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function Ct(){return!0}function zt(){return!1}function Tt(){}var Et="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function Ot(t){for(var e in t)delete t[e]}var Pt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function jt(t){var e;for(e in t)return!1;return!e}var Rt,It=(Rt=function(t,e){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Ft=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return It(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new vt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,Tt);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Ot(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=Tt,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(_t),Mt="change",At="error",Dt="clear",Lt="contextmenu",Gt="click",Nt="dblclick",Bt="keydown",qt="keypress",Wt="load",Vt="resize",Ut="touchmove",Xt="wheel";function Kt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Yt(t,e,i,o){return Kt(t,e,i,o,!0)}function Zt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Ot(t))}var $t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ht=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return $t(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Mt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Kt(this,t[n],e);return o}return Kt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Yt(this,t[n],e)}else i=Yt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Zt(t[e]);else Zt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(Ft);Ht.prototype.on,Ht.prototype.once,Ht.prototype.un;var Jt=Ht;function Qt(){return function(){throw new Error("Unimplemented abstract method.")}()}var te=0;function ee(t){return t.ol_uid||(t.ol_uid=String(++te))}var ie=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oe=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return ie(e,t),e}(vt),ne=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,ee(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return ie(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&Et({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new oe(i,t,e)),i=yt,this.dispatchEvent(new oe(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Et(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],jt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Jt),re="postrender",ae="movestart",se="moveend",le="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ue=-1!==le.indexOf("firefox");-1!==le.indexOf("safari")&&le.indexOf("chrom");var pe=-1!==le.indexOf("webkit")&&-1==le.indexOf("edge"),de=-1!==le.indexOf("macintosh"),he="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ce="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,fe="undefined"!=typeof Image&&Image.prototype.decode,ge=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function me(t,e,i,o){var n;return i&&i.length?n=i.shift():ce?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function ve(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ye(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var _e=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),be=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return _e(e,t),e.prototype.disposeInternal=function(){ye(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ye(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Zt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Tt&&this.listenerKeys.push(Kt(t,re,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(ne),xe=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"),ke=["style","variant","weight","size","lineHeight","family"],we=function(t){var e=t.match(xe);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ke.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ke[o]]=r)}return i.families=i.family.split(/,\s?/),i};function Se(t){return 1===t?"":String(Math.round(100*t)/100)}var Ce="opacity",ze="visible",Te="extent",Ee="zIndex",Oe="maxResolution",Pe="minResolution",je="maxZoom",Re="minZoom",Ie="source",Fe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Me=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Fe(e,t),e}(Error);function Ae(t,e){if(!t)throw new Me(e)}function De(t,e,i){return Math.min(Math.max(t,e),i)}var Le="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ge="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ne(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return Be(t,e,i,o)}function Be(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function qe(t){return t*Math.PI/180}function We(t,e){var i=t%e;return i*e<0?i+e:i}function Ve(t,e,i){return t+i*(e-t)}var Ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xe=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Et({},e);return"object"==typeof e.properties&&(delete o.properties,Et(o,e.properties)),o[Ce]=void 0!==e.opacity?e.opacity:1,Ae("number"==typeof o[Ce],64),o[ze]=void 0===e.visible||e.visible,o[Ee]=e.zIndex,o[Oe]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Pe]=void 0!==e.minResolution?e.minResolution:0,o[Re]=void 0!==e.minZoom?e.minZoom:-1/0,o[je]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return Ue(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=De(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Qt()},e.prototype.getLayerStatesArray=function(t){return Qt()},e.prototype.getExtent=function(){return this.get(Te)},e.prototype.getMaxResolution=function(){return this.get(Oe)},e.prototype.getMinResolution=function(){return this.get(Pe)},e.prototype.getMinZoom=function(){return this.get(Re)},e.prototype.getMaxZoom=function(){return this.get(je)},e.prototype.getOpacity=function(){return this.get(Ce)},e.prototype.getSourceState=function(){return Qt()},e.prototype.getVisible=function(){return this.get(ze)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setExtent=function(t){this.set(Te,t)},e.prototype.setMaxResolution=function(t){this.set(Oe,t)},e.prototype.setMinResolution=function(t){this.set(Pe,t)},e.prototype.setMaxZoom=function(t){this.set(je,t)},e.prototype.setMinZoom=function(t){this.set(Re,t)},e.prototype.setOpacity=function(t){Ae("number"==typeof t,64),this.set(Ce,t)},e.prototype.setVisible=function(t){this.set(ze,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(ne),Ke="prerender",Ye="postrender",Ze="precompose",$e="postcompose",He="rendercomplete",Je="undefined",Qe="ready",ti=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ei(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var ii=function(t){function e(e){var i=this,o=Et({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Ie,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return ti(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Ie)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Je},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Zt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Kt(t,Mt,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Zt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Zt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Kt(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Ae(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Kt(this,Mt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Ie,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Xe),oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ni=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Gt,i.handleClick_.bind(i),!1);var d=n+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),h=i.element;return h.className=d,h.appendChild(i.toggleButton_),h.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return oi(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(ei(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var d=0,h=p.length;d<h;++d)p[d]in e||(i.push(p[d]),e[p[d]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!St(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?ve(this.collapseLabel_,this.label_):ve(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(be),ri="add",ai="remove",si=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),li="length",ui=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return si(e,t),e}(vt),pi=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return si(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(li)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ui(ri,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ui(ai,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ui(ai,o,t)),this.dispatchEvent(new ui(ri,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(li,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Me(58)},e}(ne);function di(t){return Math.pow(t,3)}function hi(t){return 1-di(1-t)}function ci(t){return 3*t*t-2*t*t*t}function fi(t){return t}var gi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Gt,i.handleClick_.bind(i),!1);var u=n+" ol-unselectable ol-control",p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return gi(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:hi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==i?n&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=o}this.rotation_=i}},e}(be),vi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",d=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=p,h.appendChild("string"==typeof l?document.createTextNode(l):l),h.addEventListener(Gt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=d,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Gt,i.handleClick_.bind(i,-r),!1);var f=n+" ol-unselectable ol-control",g=i.element;return g.className=f,g.appendChild(h),g.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return vi(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:hi})):e.setZoom(o)}}},e}(be),_i="pointermove",bi="pointerdown",xi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},ki={};ki[xi.RADIANS]=6370997/(2*Math.PI),ki[xi.DEGREES]=2*Math.PI*6370997/360,ki[xi.FEET]=.3048,ki[xi.METERS]=1,ki[xi.USFEET]=1200/3937;var wi=xi,Si=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ki[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),Ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zi=6378137*Math.PI,Ti=[-zi,-zi,zi,zi],Ei=[-180,-85,180,85],Oi=6378137*Math.log(Math.tan(Math.PI/2)),Pi=function(t){function e(e){return t.call(this,{code:e,units:wi.METERS,extent:Ti,global:!0,worldExtent:Ei,getPointResolution:function(t,e){return t/Le(e[1]/6378137)}})||this}return Ci(e,t),e}(Si),ji=[new Pi("EPSG:3857"),new Pi("EPSG:102100"),new Pi("EPSG:102113"),new Pi("EPSG:900913"),new Pi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Pi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ri(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=zi*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Oi?s=Oi:s<-Oi&&(s=-Oi),r[a+1]=s}return r}function Ii(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/zi,r[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return r}var Fi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mi=[-180,-90,180,90],Ai=6378137*Math.PI/180,Di=function(t){function e(e,i){return t.call(this,{code:e,units:wi.DEGREES,extent:Mi,axisOrientation:i,global:!0,metersPerUnit:Ai,worldExtent:Mi})||this}return Fi(e,t),e}(Si),Li=[new Di("CRS:84"),new Di("EPSG:4326","neu"),new Di("urn:ogc:def:crs:OGC:1.3:CRS84"),new Di("urn:ogc:def:crs:OGC:2:84"),new Di("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Di("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Di("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Gi={};var Ni={};function Bi(t,e,i){var o=t.getCode(),n=e.getCode();o in Ni||(Ni[o]={}),Ni[o][n]=i}var qi="bottom-left",Wi="bottom-right",Vi="top-left",Ui="top-right",Xi=0,Ki=1,Yi=2,Zi=4,$i=8,Hi=16;function Ji(t){for(var e=ao(),i=0,o=t.length;i<o;++i)fo(e,t[i]);return e}function Qi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function to(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function eo(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function io(t,e){return no(t,e[0],e[1])}function oo(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function no(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function ro(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Xi;return a<i?l|=Hi:a>n&&(l|=Zi),s<o?l|=$i:s>r&&(l|=Yi),l===Xi&&(l=Ki),l}function ao(){return[1/0,1/0,-1/0,-1/0]}function so(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function lo(t){return so(1/0,1/0,-1/0,-1/0,t)}function uo(t,e){var i=t[0],o=t[1];return so(i,o,i,o,e)}function po(t,e,i,o,n){return go(lo(n),t,e,i,o)}function ho(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function co(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function fo(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function go(t,e,i,o,n){for(;i<o;i+=n)mo(t,e[i],e[i+1]);return t}function mo(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function vo(t,e){var i;return(i=e(_o(t)))||(i=e(bo(t)))||(i=e(To(t)))?i:(i=e(zo(t)))||!1}function yo(t){var e=0;return Po(t)||(e=Eo(t)*So(t)),e}function _o(t){return[t[0],t[1]]}function bo(t){return[t[2],t[1]]}function xo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ko(t,e){var i;return e===qi?i=_o(t):e===Wi?i=bo(t):e===Vi?i=zo(t):e===Ui?i=To(t):Ae(!1,13),i}function wo(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,d=a*s,h=a*l,c=t[0],f=t[1],g=c-u+h,m=c-u-h,v=c+u-h,y=c+u+h,_=f-p-d,b=f-p+d,x=f+p+d,k=f+p-d;return so(Math.min(g,m,v,y),Math.min(_,b,x,k),Math.max(g,m,v,y),Math.max(_,b,x,k),n)}function So(t){return t[3]-t[1]}function Co(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return Oo(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):lo(o),o}function zo(t){return[t[0],t[3]]}function To(t){return[t[2],t[3]]}function Eo(t){return t[2]-t[0]}function Oo(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Po(t){return t[2]<t[0]||t[3]<t[1]}function jo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return so(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Ro="Point",Io="LineString",Fo="LinearRing",Mo="Polygon",Ao="MultiPoint",Do="MultiLineString",Lo="MultiPolygon",Go="GeometryCollection",No="Circle";function Bo(t,e,i){var o=i||6371008.8,n=qe(t[1]),r=qe(e[1]),a=(r-n)/2,s=qe(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function qo(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=qe(s-n)*(2+Math.sin(qe(r))+Math.sin(qe(l))),n=s,r=l}return i*e*e/2}function Wo(t,e){var i=e||{},o=i.radius||6371008.8,n=i.projection||"EPSG:3857",r=t.getType();r!==Go&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,d,h=0;switch(r){case Ro:case Ao:case Io:case Do:case Fo:break;case Mo:for(a=t.getCoordinates(),h=Math.abs(qo(a[0],o)),l=1,u=a.length;l<u;++l)h-=Math.abs(qo(a[l],o));break;case Lo:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],h+=Math.abs(qo(s[0],o)),p=1,d=s.length;p<d;++p)h-=Math.abs(qo(s[p],o));break;case Go:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)h+=Wo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return h}function Vo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],d=s[1],h=p-l,c=d-u,f=0===h&&0===c?0:(h*(n-l)+c*(r-u))/(h*h+c*c||0);return f<=0?(i=l,o=u):f>=1?(i=p,o=d):(i=l+f*h,o=u+f*c),[i,o]}function Uo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Xo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Ko(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Yo(t,e){return Math.sqrt(Ko(t,e))}function Zo(t,e){return Ko(t,Vo(t,e))}function $o(t,e){if(e.canWrapX()){var i=Eo(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Eo(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Ho(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function Jo(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Qo(t){!function(t,e){Gi[t]=e}(t.getCode(),t),Bi(t,t,Ho)}function tn(t){return"string"==typeof t?Gi[e=t]||Gi[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function en(t,e,i,o){var n,r=(t=tn(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/ki[o])}else{var a=t.getUnits();if(a==wi.DEGREES&&!o||o==wi.DEGREES)n=e;else{var s,l=sn(t,tn("EPSG:4326"));if(l===Jo&&a!==wi.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(Bo((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Bo(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?ki[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function on(t){!function(t){t.forEach(Qo)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Bi(e,t,Ho)}))}))}function nn(t,e){return t?"string"==typeof t?tn(t):t:tn(e)}function rn(t,e){return un(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function an(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||sn(t,e)===Ho)&&i}function sn(t,e){var i=function(t,e){var i;return t in Ni&&e in Ni[t]&&(i=Ni[t][e]),i}(t.getCode(),e.getCode());return i||(i=Jo),i}function ln(t,e){return sn(tn(t),tn(e))}function un(t,e,i){return ln(e,i)(t,void 0,t.length)}var pn,dn,hn;function cn(t,e){return t}function fn(t,e){return t}function gn(t,e){return t}function mn(t,e){return t}on(ji),on(Li),pn=ji,dn=Ri,hn=Ii,Li.forEach((function(t){pn.forEach((function(e){Bi(t,e,dn),Bi(e,t,hn)}))}));var vn,yn=new Array(6);function _n(t){return xn(t,1,0,0,1,0,0)}function bn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],d=e[3],h=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*d,t[3]=o*p+r*d,t[4]=i*h+n*c+a,t[5]=o*h+r*c+s,t}function xn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function kn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function wn(t,e,i){return bn(t,xn(yn,e,0,0,i,0,0))}function Sn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function Cn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Ae(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function zn(t){var e="matrix("+t.join(", ")+")";if(ce)return e;var i=vn||(vn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Tn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,En=/^([a-z]*)$|^hsla?\(.*\)$/i;function On(t){return"string"==typeof t?t:Mn(t)}var Pn,jn,Rn=(Pn={},jn=0,function(t){var e;if(Pn.hasOwnProperty(t))e=Pn[t];else{if(jn>=1024){var i=0;for(var o in Pn)0==(3&i++)&&(delete Pn[o],--jn)}e=function(t){var e,i,o,n,r;if(En.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Tn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Fn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Fn(r)):Ae(!1,14);return r}(t),Pn[t]=e,++jn}return e});function In(t){return Array.isArray(t)?t:Rn(t)}function Fn(t){return t[0]=De(t[0]+.5|0,0,255),t[1]=De(t[1]+.5|0,0,255),t[2]=De(t[2]+.5|0,0,255),t[3]=De(t[3],0,1),t}function Mn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function An(t,e,i){return e+":"+t+":"+(i?On(i):"null")}var Dn=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=An(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=An(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Ln=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Gn(t,e){Dn.expire()}var Nn=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return Ln(e,t),e.prototype.dispatchRenderEvent=function(t,e){Qt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;Sn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Cn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var d=u.projection,h=$o(t.slice(),d),c=[[0,0]];if(d.canWrapX()&&o){var f=Eo(d.getExtent());c.push([-f,0],[f,0])}for(var g=e.layerStatesArray,m=g.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=g[b],k=x.layer;if(k.hasRenderer()&&ei(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?h:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var T=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*T})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Qt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,Ct,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Qt()},e.prototype.scheduleExpireIconCache=function(t){Dn.canExpireCache()&&t.postRenderFunctions.push(Gn)},e}(_t),Bn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Bn(e,t),e}(vt),Wn=[],Vn=[0,0,0,0],Un=new ne,Xn=new Ft;Xn.setSize=function(){console.warn("labelCache is deprecated.")};var Kn,Yn,Zn=null,$n={},Hn=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=tr(t+" "+a+" "+i+p,r),s!=p){var d=tr(t+" "+a+" "+i+s+","+p,r);l=l&&d!=e}}return!!l}function s(){for(var e=!0,i=Un.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Un.get(r)<100&&(a.apply(this,r.split("\n"))?(Ot($n),Zn=null,Kn=void 0,Un.set(r,100)):(Un.set(r,Un.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=we(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Un.get(u)&&(Un.set(u,100,!0),a(i.style,i.weight,l)||(Un.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Jn=function(t){var e=$n[t];if(null==e){if(ce){var i=we(t),o=Qn(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Yn||((Yn=document.createElement("div")).innerHTML="M",Yn.style.minHeight="0",Yn.style.maxHeight="none",Yn.style.height="auto",Yn.style.padding="0",Yn.style.border="none",Yn.style.position="absolute",Yn.style.display="block",Yn.style.left="-99999px"),Yn.style.font=t,document.body.appendChild(Yn),e=Yn.offsetHeight,document.body.removeChild(Yn);$n[t]=e}return e};function Qn(t,e){return Zn||(Zn=me(1,1)),t!=Kn&&(Zn.font=t,Kn=Zn.font),Zn.measureText(e)}function tr(t,e){return Qn(t,e).width}function er(t,e,i){if(e in i)return i[e];var o=tr(t,e);return i[e]=o,o}function ir(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Kt(Un,yt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return or(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new qn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Zt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ze,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,ei(s,i)&&(s.sourceState==Qe||s.sourceState==Je)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent($e,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&ei(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var d=o(u,p);if(d)return d}}}},e}(Nn),rr="layergroup",ar="size",sr="target",lr="view",ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pr="layers",dr=function(t){function e(e){var i=this,o=e||{},n=Et({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(pr,i.handleLayersChanged_),r?Array.isArray(r)?r=new pi(r.slice(),{unique:!0}):Ae("function"==typeof r.getArray,43):r=new pi(void 0,{unique:!0}),i.setLayers(r),i}return ur(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Zt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Kt(t,ri,this.handleLayersAdd_,this),Kt(t,ai,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Zt);Ot(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[ee(r)]=[Kt(r,yt,this.handleLayerChange_,this),Kt(r,Mt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[ee(e)]=[Kt(e,yt,this.handleLayerChange_,this),Kt(e,Mt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=ee(t.element);this.listenerKeys_[e].forEach(Zt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(pr)},e.prototype.setLayers=function(t){this.set(pr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=Co(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Qe},e}(Xe),hr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return hr(e,t),e}(vt),fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return fr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(cr),mr={SINGLECLICK:"singleclick",CLICK:Gt,DBLCLICK:Nt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Kt(n,bi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Kt(n,_i,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Ut,o.boundHandleTouchMove_,!!ge&&{passive:!1}),o}return vr(e,t),e.prototype.emulateClick_=function(t){var e=new gr(mr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new gr(mr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new gr(mr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==mr.POINTERUP||e.type==mr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==mr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new gr(mr.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Zt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new gr(mr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?Tt:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Kt(n,mr.POINTERMOVE,this.handlePointerMove_,this),Kt(n,mr.POINTERUP,this.handlePointerUp_,this),Kt(this.element_,mr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Kt(this.element_.getRootNode(),mr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new gr(mr.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new gr(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Zt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Ut,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Zt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Zt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Ft),_r=1/0,br=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Ot(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Ae(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=_r&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==_r?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),xr=0,kr=1,wr=2,Sr=3,Cr=4,zr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Tr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return zr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Mt,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===wr||i===Sr||i===Cr){e.removeEventListener(Mt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==xr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(br);var Er=0,Or=1,Pr="center",jr="resolution",Rr="rotation";function Ir(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,d=s?s[1]:0,h=t[0]+l/2+p,c=t[2]-l/2+p,f=t[1]+u/2+d,g=t[3]-u/2+d;h>c&&(c=h=(c+h)/2),f>g&&(g=f=(g+f)/2);var m=De(o[0],h,c),v=De(o[1],f,g),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,h-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,f-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-g)/y)),[m,v]}}}function Fr(t){return t}function Mr(t,e,i,o){var n=Eo(e)/i[0],r=So(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Ar(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),De(o,i/2,2*e)}function Dr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Mr(t,o,s,n):t;return(void 0===i||i)&&l?Ar(r,u,e):De(r,e,u)}}}function Lr(t){return void 0!==t?0:void 0}function Gr(t){return void 0!==t?t:void 0}var Nr="XY",Br="XYZ",qr="XYM",Wr="XYZM";function Vr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function Ur(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],d=r[1],h=0,c=e;c<i;c+=o){var f=t[c]-p,g=t[c+1]-d;s[h++]=p+f*l-g*u,s[h++]=d+f*u+g*l;for(var m=c+2;m<c+o;++m)s[h++]=t[m]}return a&&s.length!=h&&(s.length=h),s}function Xr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Kr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yr=[1,0,0,1,0,0],Zr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&St(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Kr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Qt()},e.prototype.closestPointXY=function(t,e,i,o){return Qt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Qt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&lo(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){Qt()},e.prototype.scale=function(t,e,i){Qt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Qt()},e.prototype.getType=function(){return Qt()},e.prototype.applyTransform=function(t){Qt()},e.prototype.intersectsExtent=function(t){return Qt()},e.prototype.translate=function(t,e){Qt()},e.prototype.transform=function(t,e){var i=tn(t),o=i.getUnits()==wi.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=So(a)/So(r);return Sn(Yr,a[0],a[3],s,-s,0,0,0),Vr(t,0,t.length,n,Yr,o),ln(i,e)(t,o,n)}:ln(i,e);return this.applyTransform(o),this},e}(ne),$r=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Hr(t){var e;return t==Nr?e=2:t==Br||t==qr?e=3:t==Wr&&(e=4),e}var Jr=function(t){function e(){var e=t.call(this)||this;return e.layout=Nr,e.stride=2,e.flatCoordinates=null,e}return $r(e,t),e.prototype.computeExtent=function(t){return po(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Qt()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=Hr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Qt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=Hr(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Nr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Nr:3==t?e=Br:4==t&&(e=Wr);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Ur(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=xo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],d=0,h=e;h<i;h+=o){var c=t[h]-u,f=t[h+1]-p;l[d++]=u+n*c,l[d++]=p+r*f;for(var g=h+2;g<h+o;++g)l[d++]=t[g]}s&&l.length!=d&&(l.length=d)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Xr(i,0,i.length,o,t,e,i),this.changed()}},e}(Zr);function Qr(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,d=t[i+1]-u;if(0===p&&0===d)s=e;else{var h=((n-l)*p+(r-u)*d)/(p*p+d*d);if(h>1)s=i;else{if(h>0){for(var c=0;c<o;++c)a[c]=Ve(t[e+c],t[i+c],h);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function ta(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=Be(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function ea(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ta(t,e,s,o,n),e=s}return n}function ia(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var d,h;if(0===n){if((h=Be(a,s,t[e],t[e+1]))<u){for(d=0;d<o;++d)l[d]=t[e+d];return l.length=o,h}return u}for(var c=p||[NaN,NaN],f=e+o;f<i;)if(Qr(t,f-o,f,o,a,s,c),(h=Be(a,s,c[0],c[1]))<u){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o,f+=o}else f+=o*Math.max((Math.sqrt(h)-Math.sqrt(u))/n|0,1);if(r&&(Qr(t,i-o,e,o,a,s,c),(h=Be(a,s,c[0],c[1]))<u)){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o}return u}function oa(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=ia(t,e,f,o,n,r,a,s,l,u,d),e=f}return u}function na(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function ra(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function aa(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ra(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function sa(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var d=u.pop(),h=u.pop(),c=0,f=t[h],g=t[h+1],m=t[d],v=t[d+1],y=h+o;y<d;y+=o){var _=Ne(t[y],t[y+1],f,g,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,h+o<p&&u.push(h,p),p+o<d&&u.push(p,d))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function la(t,e){return e*Math.round(t/e)}function ua(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=la(t[e],n),p=la(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=la(t[e],n),l=la(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var d=la(t[e],n),h=la(t[e+1],n);if(e+=o,d!=s||h!=l){var c=s-u,f=l-p,g=d-u,m=h-p;c*m==f*g&&(c<0&&g<c||c==g||c>0&&g>c)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=d,l=h):(r[a++]=s,r[a++]=l,u=s,p=l,s=d,l=h)}}return r[a++]=s,r[a++]=l,a}function pa(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ua(t,e,p,o,n,r,a),s.push(a),e=p}return a}function da(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ha(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=da(t,e,u,o,r[a]),e=u}return r.length=a,r}function ca(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ha(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function fa(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function ga(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=fa(t,e,s,o),e=s}return n}var ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),va=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ma(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=sa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Nr)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr),ya=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_a=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ya(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=Be(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return uo(this.flatCoordinates,t)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return no(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=na(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr);function ba(t,e,i,o,n){return!vo(n,(function(n){return!xa(t,e,i,o,n[0],n[1])}))}function xa(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function ka(t,e,i,o,n,r){if(0===i.length)return!1;if(!xa(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(xa(t,i[a-1],i[a],o,n,r))return!1;return!0}function wa(t,e,i,o,n,r,a){for(var s,l,u,p,d,h,c,f=n[r+1],g=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],h=t[y-o+1],s=e;s<y;s+=o)d=t[s],c=t[s+1],(f<=h&&c<=f||h<=f&&f<=c)&&(u=(f-h)/(c-h)*(d-p)+p,g.push(u)),p=d,h=c}var _=NaN,b=-1/0;for(g.sort(bt),p=g[0],s=1,l=g.length;s<l;++s){d=g[s];var x=Math.abs(d-p);x>b&&ka(t,e,i,o,u=(p+d)/2,f)&&(_=u,b=x),p=d}return isNaN(_)&&(_=n[r]),a?(a.push(_,f,b),a):[_,f,b]}function Sa(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=wa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function Ca(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function za(t,e,i,o,n){var r=go([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!Oo(n,r)&&(!!oo(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||Ca(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=ro(t,e),r=ro(t,i);if(n===Ki||r===Ki)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],d=e[1],h=i[0],c=i[1],f=(c-d)/(h-p),g=void 0,m=void 0;r&Yi&&!(n&Yi)&&(o=(g=h-(c-u)/f)>=a&&g<=l),o||!(r&Zi)||n&Zi||(o=(m=c-(h-l)*f)>=s&&m<=u),o||!(r&$i)||n&$i||(o=(g=h-(c-s)/f)>=a&&g<=l),o||!(r&Hi)||n&Hi||(o=(m=c-(h-a)*f)>=s&&m<=u)}return o}(n,t,e)})))))}function Ta(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(za(t,e,i,o,n)||xa(t,e,i,o,n[0],n[1])||xa(t,e,i,o,n[0],n[3])||xa(t,e,i,o,n[2],n[1])||xa(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(ba(t,i[r-1],i[r],o,n)&&!za(t,i[r-1],i[r],o,n))return!1;return!0}function Ea(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Oa(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Pa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Oa(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function ja(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Oa(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Ea(t,e,l,o),e=l}return e}function Ra(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=ja(t,e,i[r],o,n);return e}var Ia=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fa=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Ia(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ea(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ga(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ja(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ha(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=xo(this.getExtent());this.flatInteriorPoint_=wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new _a(this.getFlatInteriorPoint(),qr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new va(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new va(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Pa(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ja(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=pa(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Nr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return Ta(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=aa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Jr),Ma=Fa;function Aa(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Fa(r,Nr,[r.length])}function Da(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var d=[l.length],h=new Fa(l,r,d);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*We(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(h,a,t.getRadius(),i),h}var La=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ga(t,e){setTimeout((function(){t(e)}),0)}function Na(t){return!(t.sourceCenter&&t.targetCenter&&!Uo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ba(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var qa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Et({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=nn(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=fn(o.center,i.projection_)),o.extent&&(o.extent=mn(o.extent,i.projection_)),i.applyOptions_(o),i}return La(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,h=nn(t.projection,"EPSG:3857"),c=h.getExtent(),f=t.constrainOnlyCenter,g=t.extent;u||g||!h.isGlobal()||(f=!1,g=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Mr(l,i,a,o):l;if(s)return void 0===e||e?Ar(n,p,u):De(n,u,p);var d=Math.min(p,n),h=Math.floor(xt(t,d,r));return t[h]>p&&h<t.length-1?t[h+1]:t[h]}}}(m,p,!f&&g,d):Dr(i,o,p,!f&&g,d)}else{var v=(c?Math.max(Eo(c),So(c)):360*ki[wi.DEGREES]/h.getMetersPerUnit())/256/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Mr(e,n,l,r):e,d=void 0!==i?i:0;if(u)return void 0===o||o?Ar(a,p,d):De(a,d,p);var h=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,f=Math.min(p,a),g=Math.floor(Math.log(e/f)/Math.log(t)+c),m=Math.max(h,g);return De(e/Math.pow(t,m),d,p)}}}(l,i,o,p,!f&&g,d):Dr(i,o,p,!f&&g,d)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Ir(t.extent,t.constrainOnlyCenter,e)}var i=nn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Ir(o,!1,!1)}return Fr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||qe(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Gr:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Gr}return Lr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Et({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Et({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=Et({},o)).center=fn(o.center,this.getProjection())),o.anchor&&((o=Et({},o)).anchor=fn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],d={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||ci,callback:e};if(p.center&&(d.sourceCenter=a,d.targetCenter=p.center.slice(),a=d.targetCenter),void 0!==p.zoom?(d.sourceResolution=s,d.targetResolution=this.getResolutionForZoom(p.zoom),s=d.targetResolution):p.resolution&&(d.sourceResolution=s,d.targetResolution=p.resolution,s=d.targetResolution),void 0!==p.rotation){d.sourceRotation=l;var h=We(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=l+h,l=d.targetRotation}Na(d)?d.complete=!0:r+=d.duration,u.push(d)}this.animations_.push(u),this.setHint(Er,1),this.updateAnimations_()}else e&&Ga(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Er]>0},e.prototype.getInteracting=function(){return this.hints_[Or]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Er,-this.hints_[Er]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Ga(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var d=s.sourceCenter[0],h=s.sourceCenter[1],c=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=d+p*(c-d),m=h+p*(f-h);this.targetCenter_=[g,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?We(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Er,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Ga(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(Xo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?cn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Pr)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return gn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ae(i,1);var o=this.getResolution();Ae(void 0!==o,2);var n=this.getRotation();return Ae(void 0!==n,3),wo(i,o,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(jr)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(mn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Eo(t)/i[0],n=So(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Rr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ba(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=xt(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=De(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,De(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Ae(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Ae(!Po(t),25),i=Aa(o=mn(t,this.getProjection()));else if(t.getType()===No){var o;(i=Aa(o=mn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),xo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,d=n.length;p<d;p+=r){var h=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,h),s=Math.min(s,c),l=Math.max(l,h),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),d=Math.cos(u),h=xo(s);h[0]+=(r[1]-r[3])/2*l,h[1]+=(r[0]-r[2])/2*l;var c=h[0]*d-h[1]*p,f=h[1]*d+h[0]*p,g=this.getConstrainedCenter([c,f],l),m=i.callback?i.callback:Tt;void 0!==i.duration?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),Ga(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(fn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ba(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ba(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=cn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&fn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=fn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(fn(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Rr)!==o&&this.set(Rr,o),this.get(jr)!==r&&this.set(jr,r),this.get(Pr)&&Uo(this.get(Pr),a)||this.set(Pr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Uo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:hi,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Or,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&fn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Or,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(ne);function Wa(t){return t[0]>0&&t[1]>0}function Va(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Xa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new dr({layers:t.layers});r[rr]=a,r[sr]=t.target,r[lr]=t.view instanceof qa?t.view:new qa,void 0!==t.controls&&(Array.isArray(t.controls)?i=new pi(t.controls.slice()):(Ae("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new pi(t.interactions.slice()):(Ae("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new pi(t.overlays.slice()):(Ae("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new pi;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:he,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new pi,i.interactions=o.interactions||new pi,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Tr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(rr,i.handleLayerGroupChanged_),i.addChangeListener(lr,i.handleViewChanged_),i.addChangeListener(ar,i.handleSizeChanged_),i.addChangeListener(sr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof qa||e.view.then((function(t){n.setView(new qa(t))})),i.controls.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ai,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ai,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ri,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ai,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Ua(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:Ct,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||Ct;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:Ct,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(sr)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return cn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?kn(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(rr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof pi)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=fn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?kn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ar)},e.prototype.getView=function(){return this.get(lr)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return _r;if(!t.wantedTiles[i][e.getKey()])return _r;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new gr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===bi||i===Xt||i===Bt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Er]||n[Or]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(He)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(He,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Zt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Lt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Xt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(Vt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ye(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new yr(this,this.moveTolerance_),mr)this.mapBrowserEventHandler_.addEventListener(mr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Lt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Xt,this.boundHandleBrowserEvent_,!!ge&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Kt(n,Bt,this.handleBrowserEvent,this),Kt(n,qt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Vt,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Zt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Zt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Kt(t,yt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Kt(t,Mt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Zt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Kt(t,yt,this.render,this),Kt(t,Mt,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Wa(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:wo(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=wo(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!Po(this.previousExtent_)&&!ho(r.extent,this.previousExtent_))&&(this.dispatchEvent(new cr(ae,this,n)),this.previousExtent_=lo(this.previousExtent_));this.previousExtent_&&!r.viewHints[Er]&&!r.viewHints[Or]&&!ho(r.extent,this.previousExtent_)&&(this.dispatchEvent(new cr(se,this,r)),to(r.extent,this.previousExtent_))}this.dispatchEvent(new cr(re,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(rr,t)},e.prototype.setSize=function(t){this.set(ar,t)},e.prototype.setTarget=function(t){this.set(sr,t)},e.prototype.setView=function(t){if(!t||t instanceof qa)this.set(lr,t);else{this.set(lr,new qa);var e=this;t.then((function(t){e.setView(new qa(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Wa(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(ne),Ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ya="degrees",Za="imperial",$a="nautical",Ha="metric",Ja="us",Qa=[1,2,5],ts=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(o.units||Ha),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Ka(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Ya?wi.DEGREES:wi.METERS,r=en(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,s=a*r,l="";if(o==Ya){var u=ki[wi.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==Za?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==$a?(r/=1852,l="nm"):o==Ha?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==Ja?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Ae(!1,33);for(var p,d,h,c,f=3*Math.floor(Math.log(a*r)/Math.log(10));;){h=Math.floor(f/3);var g=Math.pow(10,h);if(p=Qa[(f%3+3)%3]*g,d=Math.round(p/r),isNaN(d))return this.element.style.display="none",void(this.renderedVisible_=!1);if(d>=a)break;++f}c=this.scaleBar_?this.createScaleBar(d,p,l):p.toFixed(h<0?-h:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=en(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(be);function es(t){var e=t||{},i=new pi;return(void 0===e.zoom||e.zoom)&&i.push(new yi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new mi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ni(e.attributionOptions)),i}var is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var os=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return is(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Zt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Kt(t,Mt,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(Ae("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(ne),ns=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?tn(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===wi.TILE_PIXELS&&(o=tn(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Et({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Qt()},t.prototype.readFeature=function(t,e){return Qt()},t.prototype.readFeatures=function(t,e){return Qt()},t.prototype.readGeometry=function(t,e){return Qt()},t.prototype.readProjection=function(t){return Qt()},t.prototype.writeFeature=function(t,e){return Qt()},t.prototype.writeFeatures=function(t,e){return Qt()},t.prototype.writeGeometry=function(t,e){return Qt()},t}();function rs(t,e,i){var o,n=i?tn(i.featureProjection):null,r=i?tn(i.dataProjection):null;if(o=n&&r&&!an(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var as="arraybuffer",ss="json",ls="text",us="xml",ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ds(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var hs=function(t){function e(){return t.call(this)||this}return ps(e,t),e.prototype.getType=function(){return ss},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Qt()},e.prototype.readFeaturesFromObject=function(t,e){return Qt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(ds(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Qt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(ds(t))},e.prototype.readProjectionFromObject=function(t){return Qt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Qt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Qt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Qt()},e}(ns);function cs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],d=t[e+1],h=0,c=[0],f=e+o;f<i;f+=o){var g=t[f],m=t[f+1];h+=Math.sqrt((g-p)*(g-p)+(m-d)*(m-d)),c.push(h),p=g,d=m}var v=n*h,y=function(t,e,i){for(var o,n,r=i||bt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(f=0;f<_;++f)b[f]=void 0===s?NaN:void 0===l?t[s+f]:Ve(t[s+f],t[s+o+f],l);return b}function fs(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var d=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var h=0;h<o-1;++h)a.push(Ve(t[(s-1)*o+h],t[s*o+h],d));return a.push(n),a}function gs(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vs=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ms(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?wt(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=qr&&this.layout!=Wr)return null;var i=void 0!==e&&e;return fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return cs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return gs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=sa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Nr)},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){return za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr),ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_s=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout()),wt(s,d.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return ys(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ea(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=qr&&this.layout!=Wr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return fs(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return fs(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ha(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new vs(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new vs(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];wt(t,cs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=sa(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Nr,o)},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(za(t,e,i[r],o,n))return!0;e=i[r]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=aa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Jr),bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xs=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return bs(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?wt(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<eo(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=Be(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new _a(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new _a(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(no(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ra(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Jr);function ks(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=po(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var ws=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ss=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout());for(var h=s.length,c=d.getEnds(),f=0,g=c.length;f<g;++f)c[f]+=h;wt(s,d.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return ws(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;wt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<eo(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=ea(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=oa(t,e,f,o,n,r,a,s,l,u,d),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(ka(t,e,l,o,n,r))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ga(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ra(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ca(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ks(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Sa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new xs(this.getFlatInteriorPoints().slice(),qr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Pa(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ra(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],d=[];a=pa(t,e,p,o,n,r,a,d),s.push(d),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Nr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ma(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var d=new Ma(e.slice(n,l),t,s);o.push(d),n=l}return o},e.prototype.getType=function(){return Lo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ta(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=aa(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(Jr),Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function zs(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Ts=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return Cs(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Zt),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Kt(this.geometries_[t],Mt,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){if(o<eo(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){lo(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)co(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return zs(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Go},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=xo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(zs(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Zr),Es=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Os(t,e){if(!t)return null;var i;switch(t.type){case Ro:i=function(t){return new _a(t.coordinates)}(t);break;case Io:i=function(t){return new vs(t.coordinates)}(t);break;case Mo:i=function(t){return new Ma(t.coordinates)}(t);break;case Ao:i=function(t){return new xs(t.coordinates)}(t);break;case Do:i=function(t){return new _s(t.coordinates)}(t);break;case Lo:i=function(t){return new Ss(t.coordinates)}(t);break;case Go:i=function(t,e){var i=t.geometries.map((function(t){return Os(t,e)}));return new Ts(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return rs(i,!1,e)}function Ps(t,e){var i,o=(t=rs(t,!0,e)).getType();switch(o){case Ro:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Io:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ao:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Do:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Lo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Go:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Et({},e);return delete i.featureProjection,Ps(t,i)}))}}(t,e);break;case No:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var js=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=tn(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=tn(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Es(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Os((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new os;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Os(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=tn(i.properties.name):"EPSG"===i.type?e=tn("EPSG:"+i.properties.code):Ae(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ps(r,e),delete n[t.getGeometryName()]),jt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ps(t,this.adaptOptions(e))},e}(hs),Rs=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Is="fraction",Fs="pixels",Ms="bottom-left",As="bottom-right",Ds="top-left",Ls="top-right",Gs=0,Ns=1,Bs=2,qs=3,Ws=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Va(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Qt()},t.prototype.getImage=function(t){return Qt()},t.prototype.getHitDetectionImage=function(){return Qt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Qt()},t.prototype.getImageSize=function(){return Qt()},t.prototype.getOrigin=function(){return Qt()},t.prototype.getSize=function(){return Qt()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(t)},t.prototype.listenImageChange=function(t){Qt()},t.prototype.load=function(){Qt()},t.prototype.unlistenImageChange=function(t){Qt()},t}(),Vs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Us=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Vs(e,t),e.prototype.changed=function(){this.dispatchEvent(Mt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Qt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Qt()},e}(Ft),Xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ks(t,e,i){var o=t;if(o.src&&fe){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Yt(o,Wt,e),Yt(o,At,i)];return function(){a.forEach(Zt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Gs)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Gs,s.imageLoadFunction_=a,s}Xs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=qs,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=So(this.extent)/this.image_.height),this.state=Bs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Gs&&this.state!=qs||(this.state=Ns,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=So(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Us);var Ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zs=null,$s=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return Ys(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Bs){Zs||(Zs=me(1,1)),Zs.drawImage(this.image_,0,0);try{Zs.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Zs=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt)},e.prototype.handleImageError_=function(){this.imageState_=qs,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Bs,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=me(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Gs){this.imageState_=Ns;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Bs){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=On(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ft);var Hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Js=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Ds,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Is,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Is,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Ae(!(void 0!==p&&l),4),Ae(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||ee(l)),Ae(void 0!==p&&p.length>0,6);var d=void 0!==o.src?Gs:Bs;return i.color_=void 0!==o.color?In(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Dn.get(e,o,r);return a||(a=new $s(t,e,i,o,n,r),Dn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,d,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Ds,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return Hs(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Is||this.anchorYUnits_==Is){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Is&&(t[0]*=e[0]),this.anchorYUnits_==Is&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ds){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ls&&this.anchorOrigin_!=As||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ms&&this.anchorOrigin_!=As||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ds){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ls&&this.offsetOrigin_!=As||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ms&&this.offsetOrigin_!=As||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Mt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Mt,t)},e}(Ws),Qs=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||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.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();function tl(t){return Array.isArray(t)?Mn(t):t}var el=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),il=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return el(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({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},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,o=me(i.size*t,i.size*t);this.draw_(i,o,t),e=o.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Bs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),d=p/l;if("miter"===t&&d<=i)return d*e;var h=e/2/d,c=e/2*(u/p),f=Math.sqrt((o+h)*(o+h)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=o*Math.sin(s),m=n-Math.sqrt(o*o-g*g),v=Math.sqrt(g*g+m*m)/g;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(f,y)}return 2*f},e.prototype.createRenderOptions=function(){var t,e="round",i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=tl(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o="#000"),e.fillStyle=tl(o),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=In(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=me(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Ws),ol=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return ol(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(il),rl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=ul,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,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.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=ul,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var al=null;function sl(t,e){if(!al){var i=new Rs({color:"rgba(255,255,255,0.4)"}),o=new Qs({color:"#3399CC",width:1.25});al=[new rl({image:new nl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return al}function ll(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Mo]=[new rl({fill:new Rs({color:[255,255,255,.5]})})],t[Lo]=t[Mo],t[Io]=[new rl({stroke:new Qs({color:e,width:5})}),new rl({stroke:new Qs({color:i,width:3})})],t[Do]=t[Io],t[No]=t[Mo].concat(t[Io]),t[Ro]=[new rl({image:new nl({radius:6,fill:new Rs({color:i}),stroke:new Qs({color:e,width:1.5})}),zIndex:1/0})],t[Ao]=t[Ro],t[Go]=t[Mo].concat(t[Io],t[Ro]),t}function ul(t){return t.getGeometry()}var pl=rl,dl="point",hl="line",cl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Va(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Rs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:dl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=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(e)?e.slice():e,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.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function fl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gl={
34
34
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
- read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,d=i?n-1:0,h=i?-1:1,c=t[e+d];for(d+=h,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+d],d+=h,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+d],d+=h,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,d=p>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,f=o?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=p?(s=0,a=p):a+d>=1?(s=(e*l-1)*Math.pow(2,n),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=f,a/=256,u-=8);t[i+c-f]|=128*g}},ml=yl,vl=gl;function yl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}yl.Varint=0,yl.Fixed64=1,yl.Bytes=2,yl.Fixed32=5;var _l="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function bl(t){return t.type===yl.Bytes?t.readVarint()+t.pos:t.pos+1}function xl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function kl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function wl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function zl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ol(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function jl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Rl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Il(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}yl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Rl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Rl(this.buf,this.pos)+4294967296*Rl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Rl(this.buf,this.pos)+4294967296*Fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=vl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=vl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return xl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[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,e=this.pos;return this.pos=t,t-e>=12&&_l?function(t,e,i){return _l.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==yl.Bytes)return t.push(this.readVarint(e));var i=bl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==yl.Bytes)return t.push(this.readSVarint());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==yl.Bytes)return t.push(this.readBoolean());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==yl.Bytes)return t.push(this.readFloat());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==yl.Bytes)return t.push(this.readDouble());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==yl.Bytes)return t.push(this.readFixed32());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==yl.Bytes)return t.push(this.readSFixed32());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==yl.Bytes)return t.push(this.readFixed64());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==yl.Bytes)return t.push(this.readSFixed64());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===yl.Varint)for(;this.buf[this.pos++]>127;);else if(e===yl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===yl.Fixed32)this.pos+=4;else{if(e!==yl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Il(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Il(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Il(this.buf,-1&t,this.pos),Il(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Il(this.buf,-1&t,this.pos),Il(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,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,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(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 e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&kl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),vl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),vl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&kl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,yl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ol,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,jl,e)},writeBytesField:function(t,e){this.writeTag(t,yl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,yl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,yl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,yl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,yl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,yl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,yl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,yl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,yl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,yl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ml=[1,0,0,1,0,0],Al=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Ro?uo(this.flatCoordinates_):po(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=xo(this.getExtent());this.flatInteriorPoints_=wa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ks(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Sa(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=cs(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=cs(t,e,r,2,.5);wt(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=tn(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=So(i)/So(e);Sn(Ml,i[0],i[3],o,-o,0,0,0),Vr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ml,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Al.prototype.getEndss=Al.prototype.getEnds,Al.prototype.getFlatCoordinates=Al.prototype.getOrientedFlatCoordinates;var Dl=Al,Ll=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Gl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Nl,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Nl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>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;e.values.push(o)}}function Bl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function ql(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Bl,n,o),n}var Wl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new Si({code:"",units:wi.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Dl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Ll(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var d=t.readVarint();r=7&d,a=d>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Ae(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Ro:Ao:2===t?i=1===e?Io:Do:3===t&&(i=Mo);return i}(n,l.length);if(this.featureClass_===Dl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Mo){for(var d=[],h=0,c=0,f=0,g=l.length;f<g;++f){var m=l[f];if(Oa(s,h,m,2)){if(0===d.length)continue;d[d.length-1].push(l[c])}else d.push(l.slice(c,f+1));c=f+1,h=m}p=d.length>1?new Ss(s,Nr,d):new Ma(s,Nr,l)}else p=u===Ro?new _a(s,Nr):u===Io?new vs(s,Nr):u===Mo?new Ma(s,Nr,l):u===Ao?new xs(s,Nr):u===Do?new _s(s,Nr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=rs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return as},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=tn(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new ml(t),a=r.readFields(Gl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var d=0,h=u.length;d<h;++d){var c=ql(r,u,d);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(ns),Vl="active",Ul=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Xl(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:hi})}}var Kl=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Ul(e,t),e.prototype.getActive=function(){return this.get(Vl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Vl,t)},e.prototype.setMap=function(t){this.map_=t},e}(ne),Yl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return Yl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==mr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Xl(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Kl),Hl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function $l(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var Jl=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return Hl(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==mr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==mr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==mr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==mr.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===mr.POINTERDOWN||e===mr.POINTERDRAG||e===mr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==mr.POINTERUP?delete this.trackedPointers_[i]:(t.type==mr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Pt(this.trackedPointers_)}},e}(Kl);function Ql(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var tu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},eu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},iu=Ct,ou=function(t){var e=t.originalEvent;return 0==e.button&&!(pe&&de&&e.ctrlKey)},nu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ru=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},au=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},su=function(t){var e=t.originalEvent;return Ae(void 0!==e,56),"mouse"==e.pointerType},lu=function(t){var e=t.originalEvent;return Ae(void 0!==e,56),e.isPrimary&&0===e.button},uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pu=function(t){function e(e){var i=t.call(this,{stopDown:zt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:Ql(nu,lu);return i.condition_=o.onFocusOnly?Ql(eu,n):n,i.noKinetic_=!1,i}return uu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=$l(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Xo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:hi})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Jl),du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hu=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:zt})||this).condition_=o.condition?o.condition:tu,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return du(e,t),e.prototype.handleDragEvent=function(t){if(su(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Lr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!su(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!su(t)&&(!(!ou(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Jl),cu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fu=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return cu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ma([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(_t),gu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mu="boxstart",vu="boxdrag",yu="boxend",_u="boxcancel",bu=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return gu(e,t),e}(vt),xu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new fu(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:ou,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return gu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new bu(vu,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new bu(e?yu:_u,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new bu(mu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Jl),ku=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:ru;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return ku(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:hi})},e}(xu),Su=37,Cu=38,zu=39,Tu=40,Eu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ou=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return nu(t)&&au(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Eu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Bt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Tu||o==Su||o==zu||o==Cu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Tu?s=-r:o==Su?a=-r:o==zu?a=r:s=r;var l=[a,s];Xo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:fi,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kl),Pu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ju=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:au,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Pu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Bt||t.type==qt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;Xl(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kl),Ru=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fu="trackpad",Mu="wheel",Au=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:iu;return i.condition_=o.onFocusOnly?Ql(eu,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Iu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Xt)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Xt&&(e=o.deltaY,ue&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=he),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Fu:Mu);var r=i.getView();if(this.mode_===Fu&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-De(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Xl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Kl),Du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Du(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Lr){var l=a.getViewport().getBoundingClientRect(),u=$l(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Jl),Gu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Gu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=$l(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Jl),Bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qu=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return Bu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return so(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return No},e.prototype.intersectsExtent=function(t){if(Oo(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||vo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=na(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Ur(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Xr(i,0,i.length,o,t,e,i)),this.changed()},e}(Jr);qu.prototype.transform;var Wu=qu;function Vu(t,e,i,o,n){Uu(t,e,i||0,o||t.length-1,n||Ku)}function Uu(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);Uu(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],d=i,h=o;for(Xu(t,i,e),n(t[o],p)>0&&Xu(t,i,o);d<h;){for(Xu(t,d,h),d++,h--;n(t[d],p)<0;)d++;for(;n(t[h],p)>0;)h--}0===n(t[i],p)?Xu(t,i,h):Xu(t,++h,o),h<=e&&(i=h+1),e<=h&&(o=h-1)}}function Xu(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function Ku(t,e){return t<e?-1:t>e?1:0}class Yu{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!rp(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;rp(t,s)&&(e.leaf?i.push(a):np(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!rp(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(rp(t,r)){if(e.leaf||np(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ap([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=Zu(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!np(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=ap(t.slice(e,i+1)),Hu(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=ap([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));sp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);sp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return Hu(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=ep(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),Ju(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=ap(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,Hu(i,this.toBBox),Hu(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=ap([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Hu(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=$u(t,0,a,this.toBBox),s=$u(t,a,i,this.toBBox),l=op(e,s),u=ep(e)+ep(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:Qu,n=t.leaf?this.compareMinY:tp;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=$u(t,0,e,n),a=$u(t,i-e,i,n);let s=ip(r)+ip(a);for(let l=e;l<i-e;l++){const e=t.children[l];Ju(r,t.leaf?n(e):e),s+=ip(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Ju(a,t.leaf?n(e):e),s+=ip(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)Ju(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():Hu(t[i],this.toBBox)}}function Zu(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function Hu(t,e){$u(t,0,t.children.length,e,t)}function $u(t,e,i,o,n){n||(n=ap(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];Ju(n,t.leaf?o(e):e)}return n}function Ju(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Qu(t,e){return t.minX-e.minX}function tp(t,e){return t.minY-e.minY}function ep(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ip(t){return t.maxX-t.minX+(t.maxY-t.minY)}function op(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function np(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function rp(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ap(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;Vu(t,a,e,i,n),r.push(e,a,a,i)}}var lp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),up="renderOrder",pp=function(t){function e(e){var i=this,o=e||{},n=Et({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return lp(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(up)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Yu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(up,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:sl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Ae("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(ii),dp={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},hp=[dp.FILL],cp=[dp.STROKE],fp=[dp.BEGIN_PATH],gp=[dp.CLOSE_PATH],mp=dp,vp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_p=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return yp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],io(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,d,h=t[e],c=t[e+1],f=this.tmpCoordinate_,g=!0;for(u=e+o;u<i;u+=o)f[0]=t[u],f[1]=t[u+1],(d=ro(l,f))!==p?(g&&(a[s++]=h,a[s++]=c,g=!1),a[s++]=f[0],a[s++]=f[1]):d===Ki?(a[s++]=f[0],a[s++]=f[1],g=!1):g=!0,h=f[0],c=f[1],p=d;return(n&&g||u===e+o)&&(a[s++]=h,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),d=this.coordinates.length;switch(u){case Lo:n=t.getOrientedFlatCoordinates(),s=[];var h=t.getEndss();l=0;for(var c=0,f=h.length;c<f;++c){var g=[];l=this.drawCustomCoordinates_(n,l,h[c],p,g),s.push(g)}this.instructions.push([mp.CUSTOM,d,s,t,i,ca]),this.hitDetectionInstructions.push([mp.CUSTOM,d,s,t,o||i,ca]);break;case Mo:case Do:a=[],n=u==Mo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([mp.CUSTOM,d,a,t,i,ha]),this.hitDetectionInstructions.push([mp.CUSTOM,d,a,t,o||i,ha]);break;case Io:case No:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([mp.CUSTOM,d,r,t,i,da]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i,da]);break;case Ao:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>d&&(this.instructions.push([mp.CUSTOM,d,r,t,i,da]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i,da]));break;case Ro:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([mp.CUSTOM,d,r,t,i]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[mp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[mp.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==mp.END_GEOMETRY?r=t:o==mp.BEGIN_GEOMETRY&&(i[2]=t,kt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=tl(o||"#000")}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=tl(n||"#000");var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var a=e.getLineDash();i.lineDash=a?a.slice():Wn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=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},e.prototype.createFill=function(t){var e=t.fillStyle,i=[mp.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[mp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!St(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[mp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=to(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Qi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(vp),bp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xp=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return bp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([mp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([mp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([mp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([mp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(_p),kp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return kp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[mp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Wn,0],fp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(cp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(cp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(cp),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(cp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(fp)},e}(_p),Sp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Sp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(fp),this.hitDetectionInstructions.push(fp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),h=[mp.MOVE_TO_LINE_TO,p,d];this.instructions.push(h),this.hitDetectionInstructions.push(h),a&&(this.instructions.push(gp),this.hitDetectionInstructions.push(gp)),e=u}return r&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),a&&(this.instructions.push(cp),this.hitDetectionInstructions.push(cp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[mp.CIRCLE,s];this.instructions.push(fp,l),this.hitDetectionInstructions.push(fp,l),void 0!==i.fillStyle&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),void 0!==i.strokeStyle&&(this.instructions.push(cp),this.hitDetectionInstructions.push(cp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=la(i[o],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(_p);function zp(t,e,i,o,n){var r,a,s,l,u,p,d,h,c,f=i,g=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(h=_-l,c=b-u,s=Math.sqrt(h*h+c*c),void 0!==p&&(v+=a,Math.acos((p*h+d*c)/(a*s))>t&&(v>m&&(m=v,f=y,g=r),v=0,y=r-n)),a=s,p=h,d=c),l=_,u=b}return(v+=s)>m?[y,r]:[f,g]}var Tp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ep={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Op={Circle:Cp,Default:_p,Image:xp,LineString:wp,Polygon:Cp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Tp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==hl||s!=Io&&s!=Do&&s!=Mo&&s!=Lo){var p=n.overflow?null:[];switch(s){case Ro:case Ao:l=t.getFlatCoordinates();break;case Io:l=t.getFlatMidpoint();break;case No:l=t.getCenter();break;case Do:l=t.getFlatMidpoints(),u=2;break;case Mo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Lo:var d=t.getFlatInteriorPoints();l=[];for(k=0,w=d.length;k<w;k+=3)n.overflow||p.push(d[k+2]/this.resolution),l.push(d[k],d[k+1]);if(0===l.length)return;u=2}if((P=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(P-a)/2!=l.length/u){var h=a/2;p=p.filter((function(t,e){var i=r[2*(h+e)]===l[e*u]&&r[2*(h+e)+1]===l[e*u+1];return i||--h,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Vn&&(n.scale[0]<0||n.scale[1]<0)){var f=n.padding[0],g=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(g=-g,v=-v),n.scale[1]<0&&(f=-f,m=-m),c=[f,g,m,v]}var y=this.pixelRatio;this.instructions.push([mp.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Vn?Vn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([mp.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!Oo(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Io)b=[l.length];else if(s==Do)b=t.getEnds();else if(s==Mo)b=t.getEnds().slice(0,1);else if(s==Lo){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,T=0,E=b.length;T<E;++T){if(null==S){var O=zp(n.maxAngle,l,C,b[T],u);C=O[0],z=O[1]}else z=b[T];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var P=r.length;C=b[T],this.drawChars_(a,P),a=P}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Ep[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,d=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([mp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,d*s,p,r,1]),this.hitDetectionInstructions.push([mp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,d,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=tl(r.getColor()||"#000")):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=s?s.slice():Wn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=tl(a.getColor()||"#000")}else n=null,this.textStrokeState_=n;i=this.textState_;var d=t.getFont()||"10px sans-serif";$n(d);var h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=d,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Vn,i.scale=void 0===h?[1,1]:h;var c=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:ee(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+ee(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(_p)},Pp=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Op[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),jp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rp=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return jp(e,t),e.prototype.getFeatures=function(t){return Qt()},e.prototype.prepareFrame=function(t){return Qt()},e.prototype.renderFrame=function(t,e){return Qt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Bs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Bs&&e!=qs&&t.addEventListener(Mt,this.boundHandleImageChange_),e==Gs&&(t.load(),e=t.getState()),e==Bs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Qe&&t.changed()},e}(Jt),Ip=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fp=function(t){function e(e){var i=t.call(this,e)||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 Ip(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===Se(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=me()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=zo(i),n=To(i),r=bo(i),a=_o(i);kn(e.coordinateToPixelTransform,o),kn(e.coordinateToPixelTransform,n),kn(e.coordinateToPixelTransform,r),kn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;kn(s,o),kn(s,n),kn(s,r),kn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new qn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Ke,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ye,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,d=-t[0]+a,h=-t[1];return Sn(this.tempTransform,s,l,u,p,-i,d,h)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=kn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!io(a,kn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(d){return"SecurityError"===d.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Rp),Mp="Circle",Ap="Default",Dp="Image",Lp="LineString",Gp="Polygon",Np="Text";function Bp(t,e,i,o,n,r,a,s,l,u,p,d){var h=t[e],c=t[e+1],f=0,g=0,m=0,v=0;function y(){f=h,g=c,h=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((h-f)*(h-f)+(c-g)*(c-g))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ve(f,h,_),x=Ve(g,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ve(f,h,_=0===m?0:(S-v)/m),T=Ve(g,c,_);if(d){var E=[b,x,z,T];Ur(E,0,4,2,d,E,E),C=E[0]>E[2]}else C=b>z;var O,P=Math.PI,j=[],R=k+o===e;if(m=0,v=w,h=t[e=k],c=t[e+1],R){y(),O=Math.atan2(c-g,h-f),C&&(O+=O>0?-P:P);var I=(z+b)/2,F=(T+x)/2;return j[0]=[I,F,(S-r)/2,O,n],j}for(var M=0,A=n.length;M<A;){y();var D=Math.atan2(c-g,h-f);if(C&&(D+=D>0?-P:P),void 0!==O){var L=D-O;if(L+=L>P?-2*P:L<-P?2*P:0,Math.abs(L)>a)return null}O=D;for(var G=M,N=0;M<A;++M){var B=s*l(u,n[C?A-M-1:M],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(M!==G){var q=C?n.substring(A-G,A-M):n.substring(G,M);I=Ve(f,h,_=0===m?0:(r+N/2-v)/m),F=Ve(g,c,_);j.push([I,F,N/2,D,q]),r+=N}}return j}var qp=[1/0,1/0,-1/0,-1/0],Wp=[],Vp=[],Up=[],Xp=[];function Kp(t){return t[3].declutterBox}var Yp=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Zp(t,e){return"start"!==e&&"end"!==e||Yp.test(t)||(e="start"===e?"left":"right"),Ep[e]}var Hp=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Zp(t,s.textAlign||"center"),d=o&&r.lineWidth?r.lineWidth:0,h=t.split("\n"),c=h.length,f=[],g=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=tr(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,h,f),m=Jn(s.font),v=g+d,y=[],_=(v+2)*u[0],b=(m*c+d)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",d),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(ce?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*d;if(o)for(k=0;k<c;++k)y.push("strokeText",[h[k],S+w*f[k],.5*(d+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[h[k],S+w*f[k],.5*(d+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,d,h,c,f,g){var m,v=i-(a*=d[0]),y=o-(s*=d[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*d[0]+c[1],k=c[0]+b*d[1]+c[2],w=v-c[3],S=y-c[0];return(f||0!==p)&&(Wp[0]=w,Xp[0]=w,Wp[1]=S,Vp[1]=S,Vp[0]=w+x,Up[0]=Vp[0],Up[1]=S+k,Xp[1]=Up[1]),0!==p?(kn(m=Sn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Wp),kn(m,Vp),kn(m,Up),kn(m,Xp),so(Math.min(Wp[0],Vp[0],Up[0],Xp[0]),Math.min(Wp[1],Vp[1],Up[1],Xp[1]),Math.max(Wp[0],Vp[0],Up[0],Xp[0]),Math.max(Wp[1],Vp[1],Up[1],Xp[1]),qp)):so(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),qp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:qp[0],minY:qp[1],maxX:qp[2],maxY:qp[3],value:g},canvasTransform:m,scale:d}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Wp,Vp,Up,Xp,r,a),ir(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=kn(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=Zp(t,n.textAlign||"center"),u=Ep[n.textBaseline||"middle"],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&St(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Vr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,d,h,c,f,g,m,v,y,_,b,x,k,w,S,C=0,z=o.length,T=0,E=0,O=0,P=null,j=null,R=this.coordinateCache_,I=this.viewRotation_,F=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},A=this.instructions!=o||this.overlaps?0:200;C<z;){var D=o[C];switch(D[0]){case mp.BEGIN_GEOMETRY:x=D[1],S=D[3],x.getGeometry()?void 0===a||Oo(a,S.getExtent())?++C:C=D[2]+1:C=D[2];break;case mp.BEGIN_PATH:E>A&&(this.fill_(t),E=0),O>A&&(t.stroke(),O=0),E||O||(t.beginPath(),h=NaN,c=NaN),++C;break;case mp.CIRCLE:var L=l[T=D[1]],G=l[T+1],N=l[T+2]-L,B=l[T+3]-G,q=Math.sqrt(N*N+B*B);t.moveTo(L+q,G),t.arc(L,G,q,0,2*Math.PI,!0),++C;break;case mp.CLOSE_PATH:t.closePath(),++C;break;case mp.CUSTOM:T=D[1],u=D[2];var W=D[3],V=D[4],U=6==D.length?D[5]:void 0;M.geometry=W,M.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,T,u,2,X):(X[0]=l[T],X[1]=l[T+1],X.length=2),V(X,M),++C;break;case mp.DRAW_IMAGE:T=D[1],u=D[2],m=D[3],p=D[4],d=D[5];var K=D[6],Y=D[7],Z=D[8],H=D[9],$=D[10],J=D[11],Q=D[12],tt=D[13],et=D[14];if(!m&&D.length>=19){v=D[18],y=D[19],_=D[20],b=D[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,D[3]=m;var ot=D[22];p=(it.anchorX-ot)*this.pixelRatio,D[4]=p;var nt=D[23];d=(it.anchorY-nt)*this.pixelRatio,D[5]=d,K=m.height,D[6]=K,tt=m.width,D[13]=tt}var rt=void 0;D.length>24&&(rt=D[24]);var at=void 0,st=void 0,lt=void 0;D.length>16?(at=D[15],st=D[16],lt=D[17]):(at=Vn,st=!1,lt=!1),$&&F?J+=I:$||F||(J-=I);for(var ut=0;T<u;T+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[T],l[T+1],tt,K,p,d,Z,H,J,Q,n,at,st||lt,x),Y,st?P:null,lt?j:null],dt=void 0,ht=void 0;if(s&&et){var ct=u-T;if(!et[ct]){et[ct]=pt;continue}if(dt=et[ct],delete et[ct],ht=Kp(dt),s.collides(ht))continue}s&&s.collides(Lt.declutterBox)||(dt&&(s&&s.insert(ht),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case mp.DRAW_CHARS:var ft=D[1],gt=D[2],mt=D[3],vt=D[4];b=D[5];var yt=D[6],_t=D[7],bt=D[8];_=D[9];var xt=D[10];v=D[11],y=D[12];var kt=[D[13],D[13]],wt=this.textStates[y],Ct=wt.font,zt=[wt.scale[0]*_t,wt.scale[1]*_t],Tt=void 0;Ct in this.widths_?Tt=this.widths_[Ct]:(Tt={},this.widths_[Ct]=Tt);var Et=gs(l,ft,gt,2),Ot=Math.abs(zt[0])*er(Ct,v,Tt);if(vt||Ot<=Et){var Pt=this.textStates[y].textAlign,jt=Bp(l,ft,gt,2,v,(Et-Ot)*Ep[Pt],yt,Math.abs(zt[0]),er,Ct,Tt,F?0:this.viewRotation_);t:if(jt){var Rt=[],It=void 0,Ft=void 0,Mt=void 0,At=void 0,Dt=void 0;if(_)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,"",_),p=Dt[2]+(zt[0]<0?-xt:xt),d=mt*At.height+2*(.5-mt)*xt*zt[1]/zt[0]-bt;var Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],kt,!1,Vn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}if(b)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,b,""),p=Dt[2],d=mt*At.height-bt;Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],kt,!1,Vn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}s&&s.load(Rt.map(Kp));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case mp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=D[1],S);if(Bt)return Bt}++C;break;case mp.FILL:A?E++:this.fill_(t),++C;break;case mp.MOVE_TO_LINE_TO:for(T=D[1],u=D[2],k=l[T],g=(w=l[T+1])+.5|0,(f=k+.5|0)===h&&g===c||(t.moveTo(k,w),h=f,c=g),T+=2;T<u;T+=2)f=(k=l[T])+.5|0,g=(w=l[T+1])+.5|0,T!=u-2&&f===h&&g===c||(t.lineTo(k,w),h=f,c=g);++C;break;case mp.SET_FILL_STYLE:P=D,this.alignFill_=D[2],E&&(this.fill_(t),E=0,O&&(t.stroke(),O=0)),t.fillStyle=D[1],++C;break;case mp.SET_STROKE_STYLE:j=D,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,D),++C;break;case mp.STROKE:A?O++:t.stroke(),++C;break;default:++C}}E&&this.fill_(t),O&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),$p=[Gp,Mp,Lp,Dp,Np,Ap],Jp=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new Hp(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=Sn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=me(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(fo(u=[1/0,1/0,-1/0,-1/0],t),Qi(u,e*(this.renderBuffer_+o),u));var d,h=function(t){if(void 0!==Qp[t])return Qp[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return Qp[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=h.length;s<l;s++)if(i[h[s]]>0){if(!r||d!==Dp&&d!==Np||-1!==r.indexOf(t)){var u=(h[s]-3)/4,c=o-u%a,f=o-(u/a|0),g=n(t,e,c*c+f*f);if(g)return g}p.clearRect(0,0,a,a);break}}var f,g,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(bt),f=_.length-1;f>=0;--f){var b=_[f].toString();for(m=this.executorsByZIndex_[b],g=$p.length-1;g>=0;--g)if(void 0!==(v=m[d=$p[g]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Vr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return jt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(bt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,d,h,c,f=r||$p;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var g=s[l].toString();for(h=this.executorsByZIndex_[g],p=0,d=f.length;p<d;++p){void 0!==(c=h[f[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),Qp={};var td=Jp,ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),id=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return ed(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var d=n[u]-this.imageAnchorX_,h=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=d+this.imageAnchorX_,f=h+this.imageAnchorY_;Sn(a,c,f,1,1,l,-c,-f),r.setTransform.apply(r,a),r.translate(c,f),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,h,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Sn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(Oo(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Vr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Ro:this.drawPoint(t);break;case Io:this.drawLineString(t);break;case Mo:this.drawPolygon(t);break;case Ao:this.drawMultiPoint(t);break;case Do:this.drawMultiLineString(t);break;case Lo:this.drawMultiPolygon(t);break;case Go:this.drawGeometryCollection(t);break;case No:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Oo(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Oo(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(St(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:tl(o||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),d=a||Wn;this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:1===this.pixelRatio_?d:d.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:tl(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:tl(i||"#000")}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:a||Wn,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:tl(n||"#000")}}else this.textStrokeState_=null;var d=t.getFont(),h=t.getOffsetX(),c=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==d?d:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==h?this.pixelRatio_*h:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(vp);function od(t,e,i,o,n,r,a){var s=me(.5*t[0],.5*t[1]);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new id(s,.5,n,null,a),p=i.length,d=Math.floor(16777215/p),h={},c=1;c<=p;++c){var f=i[c-1],g=f.getStyleFunction()||o;if(o){var m=g(f,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*d).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(f);if(x&&Oo(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var T=me(z[0],z[1],void 0,{alpha:!1}),E=T.canvas;T.fillStyle=v,T.fillRect(0,0,E.width,E.height),k.setImage(new Js({img:E,imgSize:z,anchor:C.getAnchor(),anchorXUnits:Fs,anchorYUnits:Fs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var O=k.getZIndex()||0;(R=h[O])||(R={},h[O]=R,R[Mo]=[],R[No]=[],R[Io]=[],R[Ro]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var P=Object.keys(h).map(Number).sort(bt),j=(c=0,P.length);c<j;++c){var R=h[P[c]];for(var I in R){var F=R[I];for(y=0,_=F.length;y<_;y+=2){u.setStyle(F[y+1]);for(var M=0,A=e.length;M<A;++M)u.setTransform(e[M]),u.drawGeometry(F[y])}}}return s.getImageData(0,0,l.width,l.height)}function nd(t,e,i){var o=[];if(i){var n=Math.floor(.5*Math.round(t[0])),r=Math.floor(.5*Math.round(t[1])),a=4*(De(n,0,i.width-1)+De(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var rd={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Bs)return;var l=t.getBuilder(i.getZIndex(),Dp);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Np);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Lp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Np);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Gp);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Bs)return;var l=t.getBuilder(i.getZIndex(),Dp);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Lp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Np);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Gp);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,rd[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Mp);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}}};function ad(t,e){return parseInt(ee(t),10)-parseInt(ee(e),10)}function sd(t,e){var i=ld(t,e);return i*i}function ld(t,e){return.5*t/e}function ud(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Bs||u==qs?l.unlistenImageChange(n):(u==Gs&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())pd(t,s,i,e);else{(0,rd[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function pd(t,e,i,o){if(e.getType()!=Go)t.getBuilder(i.getZIndex(),Ap).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)pd(t,n[r],i,o)}var dd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return dd(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),d=e.pixelRatio,h=e.viewHints,c=!(h[Er]||h[Or]),f=this.context,g=Math.round(e.size[0]*d),m=Math.round(e.size[1]*d),v=p.getWrapX()&&s.canWrapX(),y=v?Eo(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,d,g,m,b*y);t.execute(f,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){xn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),Cn(this.inversePixelTransform,this.pixelTransform);var n=zn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var d=t.viewState;d.projection;var h=!1,c=!0;if(o.extent&&this.clipping){var f=mn(o.extent);(h=(c=Oo(f,t.extent))&&!oo(f,t.extent))&&this.clipUnrotated(r,t,f)}c&&this.renderWorlds(s,t),h&&r.restore(),this.postRender(r,t);var g=Se(o.opacity),m=this.container;return g!==m.style.opacity&&(m.style.opacity=g),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];kn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=.5*i[0],d=.5*i[1];u.push(this.getRenderTransform(o,n,r,.5,p,d,0).slice());var h=l.getSource(),c=a.getExtent();if(h.getWrapX()&&a.canWrapX()&&!oo(c,s)){for(var f=s[0],g=Eo(c),m=0,v=void 0;f<c[0];)v=g*--m,u.push(this.getRenderTransform(o,n,r,.5,p,d,v).slice()),f+=g;for(m=0,f=s[2];f>c[2];)v=g*++m,u.push(this.getRenderTransform(o,n,r,.5,p,d,v).slice()),f-=g}this.hitDetectionImageData_=od(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(nd(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},d=function(t,e,i){var r=ee(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},h=[this.replayGroup_];return this.declutterExecutorGroup&&h.push(this.declutterExecutorGroup),h.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,d,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Er],n=t.viewHints[Or],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,d=t.pixelRatio,h=e.getRevision(),c=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=ad);var g=l.center.slice(),m=Qi(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!oo(_,t.extent)){var b=Eo(_),x=Math.max(Eo(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Ho(g,u);var k=function(t,e){var i=e.getExtent(),o=xo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Eo(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==f&&oo(this.wrappedRenderedExtent_,m))return St(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Pp(ld(p,d),m,p,d);this.getLayer().getDeclutter()&&(w=new Pp(ld(p,d),m,p,d));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var T=sd(p,d),E=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,T,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),O=gn(m),P=i.getFeaturesInExtent(O);f&&P.sort(f);for(C=0,z=P.length;C<z;++C)E(P[C]);this.renderedFeatures_=P;var j=S.finish(),R=new td(m,p,d,i.getOverlaps(),j,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new td(m,p,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=f,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=ud(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=ud(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Fp),cd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fd=function(t){function e(e){return t.call(this,e)||this}return cd(e,t),e.prototype.createRenderer=function(){return new hd(this)},e}(pp),gd=function(){function t(t){this.rbush_=new Yu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[ee(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[ee(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=ee(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[ee(e)];ho([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return jt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return so(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function vd(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var yd=function(t){function e(e){var i=t.call(this)||this;i.projection=tn(e.projection),i.attributions_=vd(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Qe,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return md(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Qt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=vd(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(ne),_d="addfeature",bd="changefeature",xd="clear",kd="removefeature",wd="featuresloadstart",Sd="featuresloadend",Cd="featuresloaderror";function zd(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Td(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==as&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==ss||o==ls?l=s.responseText:o==us?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==as&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Ed(t,e){return function(i,o,n,r,a){var s=this;Td(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||Tt)}}var Od=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Od(e,t),e}(vt),jd=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Qe,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=Tt,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Ae(i.format_,7),i.loader_=Ed(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:zd;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new gd:null,i.loadedExtentsRtree_=new gd,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new pi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Od(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=ee(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Pd(_d,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Kt(e,Mt,this.handleFeatureChange_,this),Kt(e,yt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Ae(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=ee(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=ee(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var d=i.length;n<d;n++)this.dispatchEvent(new Pd(_d,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(_d,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(kd,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ri,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ai,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(Zt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Pd(xd);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),jt(this.nullGeometryFeatures_)||wt(t,Pt(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||Ct;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=ee(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Pd(bd,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:ee(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&jt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return oo(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Pd(wd)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Pd(Sd,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Pd(Cd))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(ho(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=ee(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=ee(t);this.featureChangeKeys_[e].forEach(Zt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Pd(kd,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Ae(this.format_,7),this.url_=t,this.setLoader(Ed(t,this.format_))},e}(yd),Rd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Id="Point",Fd="LineString",Md="Polygon",Ad="Circle",Dd="drawstart",Ld="drawend",Gd="drawabort",Nd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Rd(e,t),e}(vt);var Bd=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=zt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case Ro:case Ao:return Id;case Io:case Do:return Fd;case Mo:case Lo:return Md;case No:return Ad;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Md?3:2,i.maxPoints_=i.mode_===Ad?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:Ct;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Ad)r=function(t,e,i){var o=e||new Wu([NaN,NaN]),n=fn(t[0]),r=Ko(n,fn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Id?a=_a:s===Fd?a=vs:s===Md&&(a=Ma),r=function(t,e,i){return e?s===Md?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new fd({source:new jd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=ll(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:nu,i.freehandCondition_,e.freehand?i.freehandCondition_=iu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ru,i.addChangeListener(Vl,i.updateState_),i}return Rd(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Lt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Id&&this.freehandCondition_(e);var i=e.type===mr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===mr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===mr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===mr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===mr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===mr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===mr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new gr(mr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Id||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===Id)e=!0;else if(n===Ad)e=2===this.sketchCoords_.length;else if(n===Fd)i=this.sketchCoords_.length>this.minPoints_;else if(n===Md){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),d=t[0]-p[0],h=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(d*d+h*h)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new os(new _a(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new os);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new vs(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Id?this.sketchCoords_=t.slice():this.mode_===Md?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new os(new vs(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new os,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Nd(Dd,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Id?i=this.sketchCoords_:this.mode_===Md?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Mo&&this.mode_!==Md)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Fd||r===Ad?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Md&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===Fd||o===Ad){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Mo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Md){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Fd?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Md&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Ao?t.setGeometry(new xs([e])):this.type_===Do?t.setGeometry(new _s([e])):this.type_===Lo&&t.setGeometry(new Ss([e])),this.dispatchEvent(new Nd(Ld,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Nd(Gd,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Fd||i===Ad)e=this.sketchCoords_;else{if(i!==Md)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new os(new _a(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Nd(Dd,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Jl),qd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Wd=[0,0,0,0],Vd=[],Ud="modifystart",Xd="modifyend",Kd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return qd(e,t),e}(vt);function Yd(t,e){return t.index-e.index}function Zd(t,e,i){var o=e.geometry;if(o.getType()===No){var n=o;if(1===e.index){null;var r=Ko(n.getCenter(),fn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=fn(t);return Vd[0]=fn(e.segment[0]),Vd[1]=fn(e.segment[1]),Zo(s,Vd)}function Hd(t,e,i){var o=e.geometry;if(o.getType()===No&&1===e.index){var n=o;return cn(n.getClosestPoint(fn(t)))}var r=fn(t);return Vd[0]=fn(e.segment[0]),Vd[1]=fn(e.segment[1]),cn(Vo(r,Vd))}var $d=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:lu,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==mr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:iu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new gd,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new fd({source:new jd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=ll(),function(t,e){return i[Ro]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new pi(n.source_.getFeatures()),n.source_.addEventListener(_d,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(kd,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ri,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ai,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return qd(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Mt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new pi;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Kd(Ud,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Mt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,geometry:e,depth:[a,o],index:u,segment:d};this.rBush_.insert(Ji(d),h)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(uo(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new os(new _a(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=mr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=mr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==mr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,d=void 0,h=s.segment,c=a[1];e.length<u.getStride();)e.push(h[c][e.length]);switch(u.getType()){case Ro:d=e,h[0]=e,h[1]=e;break;case Ao:(d=u.getCoordinates())[s.index]=e,h[0]=e,h[1]=e;break;case Io:(d=u.getCoordinates())[s.index+c]=e,h[c]=e;break;case Do:case Mo:(d=u.getCoordinates())[p[0]][s.index+c]=e,h[c]=e;break;case Lo:(d=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,h[c]=e;break;case No:if(h[0]=e,h[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=Yo(fn(u.getCenter()),fn(e));u.setRadius(f),this.changingFeature_=!1}}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Ji([r]),s=this.rBush_.getInExtent(a),l={};s.sort(Yd);for(var u=0,p=s.length;u<p;++u){var d=s[u],h=d.segment,c=ee(d.geometry),f=d.depth;if(f&&(c+="-"+f.join("-")),l[c]||(l[c]=new Array(2)),d.geometry.getType()!==No||1!==d.index)if(!Uo(h[0],r)||l[c][0])if(!Uo(h[1],r)||l[c][1])ee(h)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(d);else{if((d.geometry.getType()===Io||d.geometry.getType()===Do)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([d,1]),l[c][1]=d}else this.dragSegments_.push([d,0]),l[c][0]=d;else Uo(Hd(e,d,o),r)&&!l[c][0]&&(this.dragSegments_.push([d,0]),l[c][0]=d)}n.length&&this.willModifyFeatures_(t,[n]);for(var g=n.length-1;g>=0;--g)this.insertVertex_(n[g],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===No){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(uo(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Ji(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Kd(Xd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Ro&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=gn(Qi(mn(uo(a,Wd)),e.getView().getResolution()*this.pixelTolerance_,Wd));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return Zd(a,t,s)-Zd(a,e,s)}))[0],d=p.segment,h=Hd(a,p,s),c=e.getPixelFromCoordinate(h),f=Yo(t,c);if(n||f<=this.pixelTolerance_){var g={};if(g[ee(d)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-a[0],this.delta_[1]=h[1]-a[1]),p.geometry.getType()===No&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(d[0]),v=e.getPixelFromCoordinate(d[1]),y=Ko(c,m),_=Ko(c,v);f=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>_?d[1]:d[0]),this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);var b={};b[ee(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Uo(d[0],w[0])&&Uo(d[1],w[1])||Uo(d[0],w[1])&&Uo(d[1],w[0])))break;var S=ee(o[x].geometry);S in b||(b[S]=!0,g[ee(w)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Do:case Mo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Lo:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Io:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Ji(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Ji(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=mr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Kd(Xd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,d=this.dragSegments_,h={},c=!1;for(n=d.length-1;n>=0;--n)p=ee((u=(i=d[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in h||(h[p]={}),0===i[1]?(h[p].right=u,h[p].index=u.index):1==i[1]&&(h[p].left=u,h[p].index=u.index+1);for(p in h){switch(l=h[p].right,a=h[p].left,(s=(r=h[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Do:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Io:e.length>2&&(e.splice(r,1),c=!0);break;case Lo:t=t[u.depth[1]];case Mo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var f=[];if(void 0!==a&&(this.rBush_.remove(a),f.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==a&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:f};this.rBush_.insert(Ji(g.segment),g)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||St(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(Jl),Jd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Qd(t){return t.feature?t.feature:t.element?t.element:void 0}var th=[],eh=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=Ct),n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new gd,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Jd(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=ee(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Kt(t,Mt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Qd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Qd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=ee(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Pt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=ee(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Zt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Zt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Kt(this.features_,ri,this.handleFeatureAdd_,this),Kt(this.features_,ai,this.handleFeatureRemove_,this)):this.source_&&o.push(Kt(this.source_,_d,this.handleFeatureAdd_,this),Kt(this.source_,kd,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Ji([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==No})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=fn(e),p=1/0,d=0;d<n.length;++d){var h=n[d];th[0]=fn(h.segment[0]),th[1]=fn(h.segment[1]);var c=Zo(u,th);c<p&&(l=h,p=c)}var f=l.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Ko(t,g),y=Ko(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===No;if(_){var b=l.feature.getGeometry();null,a=cn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else th[0]=fn(f[0]),th[1]=fn(f[1]),a=cn(Vo(u,th));if(Yo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Ko(s,g),y=Ko(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Da(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,segment:d};this.rBush_.insert(Ji(d),h)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ji(l),u)}},e}(Jl);function ih(t){var e=t||{},i=new pi,o=new Ru(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new hu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Zl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new pu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Lu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Nu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Ou),i.push(new ju({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Au({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new wu({duration:e.zoomDuration})),i}var oh=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=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.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.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 nh(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new oh(t,e,i,o)}var rh=oh,ah=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sh=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new rh(0,0,0,0),i}return ah(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==wr||i==Cr||i==Sr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Sr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(wr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),d=p.getRevision(),h=p.getTileGridForProjection(n),c=h.getZForResolution(r,p.zDirection),f=h.getResolution(c),g=t.extent,m=i.extent&&mn(i.extent);m&&(g=Co(g,mn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=f*y/2/v,k=f*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=h.getTileRangeForExtentAndZ(g,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),T=this.tmpExtent,E=this.tmpTileRange_;this.newTiles_=!1;for(var O=S.minX;O<=S.maxX;++O)for(var P=S.minY;P<=S.maxY;++P){var j=this.getTile(c,O,P,t);if(this.isDrawableTile(j)){var R=ee(this);if(j.getState()==wr){C[c][j.tileCoord.toString()]=j;var I=j.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0)}if(1===j.getAlpha(R,t.time))continue}var F=h.getTileCoordChildTileRange(j.tileCoord,E,T),M=!1;F&&(M=z(c+1,F)),M||h.forEachTileCoordParentTileRange(j.tileCoord,z,E,T)}var A=f/r;Sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var D=zn(this.pixelTransform);this.useContainer(e,D,i.opacity);var L=this.context,G=L.canvas;Cn(this.inversePixelTransform,this.pixelTransform),Sn(this.tempTransform,y/2,_/2,A,A,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),Et(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,q,W=Object.keys(C).map(Number);W.sort(bt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):W=W.reverse();for(var V=W.length-1;V>=0;--V){var U=W[V],X=p.getTilePixelSize(U,l,n),K=h.getResolution(U)/f,Y=X[0]*K*A,Z=X[1]*K*A,H=h.getTileCoordForCoordAndZ(zo(w),U),$=h.getTileCoordExtent(H),J=kn(this.tempTransform,[v*($[0]-w[0])/f,v*(w[3]-$[3])/f]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(j=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(O=Math.round(J[0]-ot*Y)),lt=at-(P=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==j.getAlpha(ee(this),t.time)))if(N){L.save(),q=[O,P,O+st,P,O+st,P+lt,O,P+lt];for(var pt=0,dt=N.length;pt<dt;++pt)if(c!==U&&U<B[pt]){var ht=N[pt];L.beginPath(),L.moveTo(q[0],q[1]),L.lineTo(q[2],q[3]),L.lineTo(q[4],q[5]),L.lineTo(q[6],q[7]),L.moveTo(ht[6],ht[7]),L.lineTo(ht[4],ht[5]),L.lineTo(ht[2],ht[3]),L.lineTo(ht[0],ht[1]),L.clip()}N.push(q),B.push(U)}else L.clearRect(O,P,st,lt);this.drawTileImage(j,t,O,P,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,p,j)}}this.renderedRevision=d,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!ho(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,h,l,n,g,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),D!==G.style.transform&&(G.style.transform=D);var ct=Se(i.opacity),ft=this.container;return ct!==ft.style.opacity&&(ft.style.opacity=ct),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=ee(this),p=s?t.getAlpha(u,e.time):1,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),d&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=ee(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=ee(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=ee(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,d,h,c,f,g,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(g=i.getMinZoom();g<=a;++g)for(d=i.getTileRangeForExtentAndZ(r,g,d),h=i.getResolution(g),c=d.minX;c<=d.maxX;++c)for(f=d.minY;f<=d.maxY;++f)a-g<=s?(++y,(p=e.getTile(g,c,f,o,n)).getState()==xr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),h])),void 0!==l&&l(p)):e.useTile(g,c,f,n);e.updateCacheSize(y,n)},e}(Fp);sh.prototype.getLayer;var lh=sh,uh="image",ph="hybrid",dh="vector",hh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ch={image:[Gp,Mp,Lp,Dp,Np],hybrid:[Gp,Lp],vector:[]},fh={hybrid:[Dp,Np,Ap],vector:[Gp,Mp,Lp,Dp,Np,Ap]},gh=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return hh(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==wr&&n!==Sr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),d=n.viewHints,h=!(d[Er]||d[Or]);return!h&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(h||Date.now()-n.time<8)&&u.getRenderMode()!==dh&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===dh?ee(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),d=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),h=l.getSourceTiles(e,i,t),c=ee(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var f=function(i,n){var f=h[i];if(f.getState()!=wr)return"continue";var m=f.tileCoord,v=p.getTileCoordExtent(m),y=Co(d,v),_=Qi(y,o.getRenderBuffer()*a,g.tmpExtent),b=ho(v,y)?null:_;s.dirty=!1;var x=new Pp(0,_,a,e),k=u?new Pp(0,y,a,e):void 0,w=sd(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=f.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,T=C.length;z<T;++z){var E=C[z];b&&!Oo(b,E.getGeometry().getExtent())||S.call(g,E)}var O=x.finish(),P=o.getRenderMode()!==dh&&u&&1===h.length?null:y,j=new td(P,a,e,l.getOverlaps(),O,o.getRenderBuffer());if(t.executorGroups[c].push(j),k){var R=new td(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},g=this,m=0,v=h.length;m<v;++m)f(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Ji([t]);Qi(u,r*i,u);for(var p,d={},h=function(t,e,i){var r=t.getId();void 0===r&&(r=ee(t));var a=d[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return d[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return d[r]=!0,o(t,s,e);n.push(d[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,f=function(o,n){var d=c[o];if(!Oo(l.getTileCoordExtent(d.wrappedTileCoord),u))return"continue";var f=ee(s),g=[d.executorGroups[f]],m=d.declutterExecutorGroups[f];m&&g.push(m),g.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,h,n))return!0}}))},g=0,m=c.length;!p&&g<m;++g)f(g);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=ee(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),d=kn(this.renderedPixelToCoordinateTransform_,t.slice()),h=p.getTileCoordForCoordAndResolution(d,u),c=0,f=this.renderedTiles.length;c<f;++c)if(h.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===wr){var g=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!oo(l,g)&&Ho(d,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=zo(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(d[0]-m[0])/u,(m[1]-d[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Va(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=od(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,.5,.5*b[0],.5*b[1],0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(nd(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[Er]||o[Or]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[ee(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,h=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(d,this.tmpExtent)[0]-h[0];return bn(wn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Er]||o[Or]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=fh[a],p=e.viewState.rotation,d=this.renderedTiles,h=[],c=[],f=d.length-1;f>=0;--f)for(var g=d[f],m=this.getTileRenderTransform(g,e),v=g.executorGroups[ee(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=g.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=h.length;S<C;++S){var z=h[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),h.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=ud(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=ud(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===dh)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[ee(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,d=l.getTileGridForProjection(p),h=d.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*h,f=d.getResolution(s),g=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);g.canvas.width=m[0],g.canvas.height=m[1];var v=u/c;if(1!==v){var y=_n(this.tmpTransform_);wn(y,v,v),g.setTransform.apply(g,y)}var _=d.getTileCoordExtent(a,this.tmpExtent),b=c/f,x=_n(this.tmpTransform_);wn(x,b,-b),function(t,e,i){bn(t,xn(yn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(g,v,x,0,!0,ch[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(lh),mh="preload",vh="useInterimTilesOnError",yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_h=function(t){function e(e){var i=this,o=e||{},n=Et({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===uh&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||ph;return Ae(r==ph||r==dh,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return yh(e,t),e.prototype.createRenderer=function(){return new gh(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(mh)},e.prototype.getUseInterimTilesOnError=function(){return this.get(vh)},e.prototype.setPreload=function(t){this.set(mh,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(vh,t)},e}(pp),bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xh=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return bh(e,t),e.prototype.changed=function(){this.dispatchEvent(Mt)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==wr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==wr){t.interimTile=null;break}t.getState()==kr?e=t:t.getState()==xr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Sr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Qt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:di(o/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Ft),kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wh=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return kh(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==xr&&(this.setState(kr),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Sr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(wr)},e.prototype.setLoader=function(t){this.loader_=t},e}(xh),Sh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return Ae(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Ae(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Ae(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Ch(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function zh(t,e,i){return t+"/"+e+"/"+i}function Th(t){return zh(t[0],t[1],t[2])}function Eh(t){return t.split("/").map(Number)}var Oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ph=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Eh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Th(e.tileCoord)),e.release())}.bind(this))}},e}(Sh),jh="tileloadstart",Rh="tileloadend",Ih="tileloaderror",Fh=[0,0,0],Mh=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Ae((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||bt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Ae(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=zo(s)),Ae(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Ae(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Ae(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new rh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?nh(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return nh(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return nh(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?nh(s,s,l,l,i):nh(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Va(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return so(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Fh;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),nh(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Va(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Va(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return so(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Va(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,d=Math.floor((t-s[0])/i+u),h=Math.floor((s[1]-e)/i+p),c=a*d/l[0],f=a*h/l[1];return o?(c=Math.ceil(c)-1,f=Math.ceil(f)-1):(c=Math.floor(c),f=Math.floor(f)),Ch(r,c,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Va(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),d=Math.floor((r[1]-e)/a+u),h=p/s[0],c=d/s[1];return o?(h=Math.ceil(h)-1,c=Math.ceil(c)-1):(h=Math.floor(h),c=Math.floor(c)),Ch(i,h,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return De(xt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Ah(t){var e=t.getDefaultTileGrid();return e||(e=Gh(t),t.setDefaultTileGrid(e)),e}function Dh(t){var e=t||{},i=e.extent||tn("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Lh(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Mh(o)}function Lh(t,e,i,o){for(var n=void 0!==e?e:42,r=So(t),a=Eo(t),s=Va(void 0!==i?i:256),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),d=0;d<u;++d)p[d]=l/Math.pow(2,d);return p}function Gh(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Vi,r=Lh(t,e,i);return new Mh({extent:t,origin:ko(t,n),resolutions:r,tileSize:i})}(Nh(t),e,i,o)}function Nh(t){var e=(t=tn(t)).getExtent();if(!e){var i=180*ki[wi.DEGREES]/t.getMetersPerUnit();e=so(-i,-i,i,i)}return e}var Bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qh=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Va(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Ph(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Bh(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=zh(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===wr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Qt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ah(t)},e.prototype.getTileCacheForProjection=function(t){return Ae(an(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Va(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Nh(i);if(io(r,n))return e;var a=Eo(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(yd),Wh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Bh(e,t),e}(vt),Vh=qh;function Uh(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Ae(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function Xh(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Uh(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=We(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var Kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yh=function(t){function e(i){var o=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 o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return Kh(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=ee(i),n=i.getState();n==kr?(this.tileLoadingKeys_[o]=!0,e=jh):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Sr?Ih:n==wr?Rh:void 0),null!=e&&this.dispatchEvent(new Wh(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Xh(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=zh(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(Vh),Zh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hh=[],$h=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return Zh(e,t),e.prototype.getContext=function(t){var e=ee(t);return e in this.context_||(this.context_[e]=me(1,1,Hh)),this.context_[e]},e.prototype.hasContext=function(t){return ee(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=ee(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)Hh.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(xh),Jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qh=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Nh(o),r=e.tileGrid||Dh({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:tc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Ph(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:wh,i.tileGrids_={},i}return Jh(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=Eh(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===wr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(Oo(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var d=0,h=p.length;d<h;++d){var c=p[d],f=c.getGeometry();Oo(t,f.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=zh((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===xr){i.setState(kr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Qi(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&Co(a,p,a);var d=u.getZForResolution(l,1);u.forEachTileCoord(a,d,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?xr:Cr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<wr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===wr||e===Sr){var n=a.getKey();n in i.errorTileKeys?a.getState()===wr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Sr?i.errorTileKeys[n]=!0:a.removeEventListener(Mt,l),0===i.loadingSourceTiles&&i.setState(jt(i.errorTileKeys)?wr:Sr)}};a.addEventListener(Mt,l),i.loadingSourceTiles++}s===xr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Sr}))?Sr:wr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=zh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(n);if(u&&p){var h=d.getTileCoordExtent(u);Qi(h,-d.getResolution(t),h),Oo(p,h)||(u=null)}var c=!0;if(null!==u){var f=this.tileGrid,g=d.getResolution(t),m=f.getZForResolution(g,1),v=d.getTileCoordExtent(u);Qi(v,-g,v),f.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new $h(l,c?Cr:xr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Gh(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Va(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Yh);function tc(t,e){t.setLoader((function(i,o,n){Td(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var ec=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ic=function(t){function e(e){return(e=Et({},e)).controls||(e.controls=es()),e.interactions||(e.interactions=ih({onFocusOnly:!0})),t.call(this,e)||this}return ec(e,t),e.prototype.createRenderer=function(){return new nr(this)},e}(Xa),oc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var nc,rc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return oc(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=wr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Sr,this.unlistenImage_(),this.image_=((t=me(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=wr:this.state=Cr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Sr&&(this.state=xr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==xr&&(this.state=kr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(xh),ac=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=ln(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Eo(o)==Eo(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Eo(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Eo(this.targetProj_.getExtent()):null;var l=zo(i),u=To(i),p=bo(i),d=_o(i),h=this.transformInv_(l),c=this.transformInv_(u),f=this.transformInv_(p),g=this.transformInv_(d),m=10+(r?Math.max(0,Math.ceil(Ge(yo(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,d,h,c,f,g,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Ji([n,r,a,s]),p=this.sourceWorldWidth_?Eo(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,h=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Eo(Ji([t,e,i,o]))/this.targetWorldWidth_>.25||c;!h&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Oo(u,this.maxSourceExtent_)){var f=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!c){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g),v=void 0;if(h)v=(We(n[0],d)+We(a[0],d))/2-We(m[0],d);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,o,n,a,s),0==(14&f)&&this.addTriangle_(t,i,e,n,a,r),f&&(0==(13&f)&&this.addTriangle_(e,o,t,r,s,n),0==(7&f)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;fo(t,n[0]),fo(t,n[1]),fo(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),sc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function lc(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function uc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function pc(t,e,i,o){var n=un(i,e,t),r=en(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||io(l,n)){var u=en(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function dc(t,e,i,o,n,r,a,s,l,u,p,d){var h=me(Math.round(i*t),Math.round(i*e));if(Et(h,d),0===l.length)return h.canvas;function c(t){return Math.round(t*i)/i}h.scale(i,i),h.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){co(f,t.extent)}));var g=Eo(f),m=So(f),v=me(Math.round(i*g/o),Math.round(i*m/o));Et(v,d);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),r=Eo(t.extent),a=So(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=zo(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],g=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var d=new Array(e),h=e-1;h>=0;h--){d[h]=t[h][e]/t[h][h];for(var c=h-1;c>=0;c--)t[c][e]-=t[c][h]*d[h]}return d}([[p-=z,g-=T,0,0,k-b],[m-=z,y-=T,0,0,S-b],[0,0,p,g,w-x],[0,0,m,y,C-x]]);if(E){if(h.save(),h.beginPath(),function(){if(void 0===nc){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 e=t.getImageData(0,0,3,3).data;nc=uc(e,0)||uc(e,4)||uc(e,8)}return nc}()||d===sc){h.moveTo(k,w);for(var O=b-k,P=x-w,j=0;j<4;j++)h.lineTo(k+c((j+1)*O/4),w+c(j*P/3)),3!=j&&h.lineTo(k+c((j+1)*O/4),w+c((j+1)*P/3));h.lineTo(S,C)}else h.moveTo(k,w),h.lineTo(b,x),h.lineTo(S,C);h.clip(),h.transform(E[0],E[2],E[1],E[3],b,x),h.translate(f[0]-z,f[3]-T),h.scale(o/i,-o/i),h.drawImage(v.canvas,0,0),h.restore()}})),p&&(h.save(),h.globalCompositeOperation="source-over",h.strokeStyle="black",h.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;h.beginPath(),h.moveTo(s,l),h.lineTo(n,a),h.lineTo(u,p),h.closePath(),h.stroke()})),h.restore()),h.canvas}var hc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cc=function(t){function e(e,i,o,n,r,a,s,l,u,p,d,h){var c=t.call(this,r,xr)||this;c.renderEdges_=void 0!==d&&d,c.contextOptions_=h,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var f=n.getTileCoordExtent(c.wrappedTileCoord_),g=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=g?Co(f,g):f;if(0===yo(v))return c.state=Cr,c;var y=e.getExtent();y&&(m=m?Co(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=xo(i),r=pc(t,e,n,o);return(!isFinite(r)||r<=0)&&vo(i,(function(i){return r=pc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Cr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new ac(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Cr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=De(k[1],m[1],m[3]),k[3]=De(k[3],m[1],m[3])):k=Co(k,m)),yo(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Cr)}else c.state=Cr;return c}return hc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==wr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Sr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=dc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=wr}this.changed()},e.prototype.load=function(){if(this.state==xr){this.state=kr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==xr||n==kr){t++;var r=Kt(e,Mt,(function(i){var o=e.getState();o!=wr&&o!=Sr&&o!=Cr||(Zt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==xr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Zt),this.sourcesListenerKeys_=null},e}(xh),fc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function gc(t,e){t.getImage().src=e}var mc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:gc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:rc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?sc:void 0,i.renderReprojectionEdges_=!1,i}return fc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!an(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!an(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!an(e,t)){var i=ee(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ah(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||an(e,t))return this.tileCache;var i=ee(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Ph(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?xr:Cr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Mt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!an(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Th(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var d=this.getTileGridForProjection(r),h=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),f=new cc(r,d,n,h,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=p,l?(f.interimTile=l,f.refreshInterimChain(),a.replace(u,f)):a.set(u,f),f}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=zh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==xr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=tn(t);if(i){var o=ee(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(Yh),vc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yc=function(t){function e(e){var i=this,o=e||{},n=Et({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return vc(e,t),e.prototype.getPreload=function(){return this.get(mh)},e.prototype.setPreload=function(t){this.set(mh,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(vh)},e.prototype.setUseInterimTilesOnError=function(t){this.set(vh,t)},e}(ii),_c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bc=function(t){function e(e){return t.call(this,e)||this}return _c(e,t),e.prototype.createRenderer=function(){return new lh(this)},e}(yc),xc={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Suported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector 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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`. 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://<Tileset ID>`."},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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`."}},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",ios:"10.0.0",android:"10.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:'An 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. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},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",ios:"10.0.0",android:"10.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. SDF images are not supported in formatted text and will be ignored.","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",{"symbol-placement":["point"]}],"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 would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols 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. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"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_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},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. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",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 valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",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<number>`, 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 a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that 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",android:"8.4.0",ios:"5.4.0",macos:"0.15.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`](#types-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`](#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. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. 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:"Returns 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:'Returns 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:"Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",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:"Returns 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:'Returns 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:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns 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:"Returns 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:"Returns 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",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns 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",android:"8.4.0",ios:"5.5.0",macos:"0.15.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"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",android:"7.0.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-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. `queryRenderedFeatures` on heatmap layers will return points within this radius.","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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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."}}},kc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function wc(t){var e={exports:{}};return t(e,e.exports),e.exports}function Sc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
35
+ read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,d=i?n-1:0,h=i?-1:1,c=t[e+d];for(d+=h,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+d],d+=h,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+d],d+=h,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,d=p>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,f=o?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=p?(s=0,a=p):a+d>=1?(s=(e*l-1)*Math.pow(2,n),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=f,a/=256,u-=8);t[i+c-f]|=128*g}},ml=yl,vl=gl;function yl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}yl.Varint=0,yl.Fixed64=1,yl.Bytes=2,yl.Fixed32=5;var _l="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function bl(t){return t.type===yl.Bytes?t.readVarint()+t.pos:t.pos+1}function xl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function kl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function wl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function zl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ol(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function jl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Rl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Il(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}yl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Rl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Rl(this.buf,this.pos)+4294967296*Rl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Rl(this.buf,this.pos)+4294967296*Fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=vl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=vl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return xl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return xl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[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,e=this.pos;return this.pos=t,t-e>=12&&_l?function(t,e,i){return _l.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==yl.Bytes)return t.push(this.readVarint(e));var i=bl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==yl.Bytes)return t.push(this.readSVarint());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==yl.Bytes)return t.push(this.readBoolean());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==yl.Bytes)return t.push(this.readFloat());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==yl.Bytes)return t.push(this.readDouble());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==yl.Bytes)return t.push(this.readFixed32());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==yl.Bytes)return t.push(this.readSFixed32());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==yl.Bytes)return t.push(this.readFixed64());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==yl.Bytes)return t.push(this.readSFixed64());var e=bl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===yl.Varint)for(;this.buf[this.pos++]>127;);else if(e===yl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===yl.Fixed32)this.pos+=4;else{if(e!==yl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Il(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Il(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Il(this.buf,-1&t,this.pos),Il(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Il(this.buf,-1&t,this.pos),Il(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,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,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(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 e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&kl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),vl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),vl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&kl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,yl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ol,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,jl,e)},writeBytesField:function(t,e){this.writeTag(t,yl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,yl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,yl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,yl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,yl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,yl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,yl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,yl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,yl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,yl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ml=[1,0,0,1,0,0],Al=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Ro?uo(this.flatCoordinates_):po(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=xo(this.getExtent());this.flatInteriorPoints_=wa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ks(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Sa(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=cs(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=cs(t,e,r,2,.5);wt(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=tn(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=So(i)/So(e);Sn(Ml,i[0],i[3],o,-o,0,0,0),Vr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ml,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Al.prototype.getEndss=Al.prototype.getEnds,Al.prototype.getFlatCoordinates=Al.prototype.getOrientedFlatCoordinates;var Dl=Al,Ll=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Gl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Nl,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Nl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>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;e.values.push(o)}}function Bl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function ql(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Bl,n,o),n}var Wl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new Si({code:"",units:wi.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Dl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Ll(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var d=t.readVarint();r=7&d,a=d>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Ae(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Ro:Ao:2===t?i=1===e?Io:Do:3===t&&(i=Mo);return i}(n,l.length);if(this.featureClass_===Dl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Mo){for(var d=[],h=0,c=0,f=0,g=l.length;f<g;++f){var m=l[f];if(Oa(s,h,m,2)){if(0===d.length)continue;d[d.length-1].push(l[c])}else d.push(l.slice(c,f+1));c=f+1,h=m}p=d.length>1?new Ss(s,Nr,d):new Ma(s,Nr,l)}else p=u===Ro?new _a(s,Nr):u===Io?new vs(s,Nr):u===Mo?new Ma(s,Nr,l):u===Ao?new xs(s,Nr):u===Do?new _s(s,Nr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=rs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return as},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=tn(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new ml(t),a=r.readFields(Gl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var d=0,h=u.length;d<h;++d){var c=ql(r,u,d);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(ns),Vl="active",Ul=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Xl(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:hi})}}var Kl=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Ul(e,t),e.prototype.getActive=function(){return this.get(Vl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Vl,t)},e.prototype.setMap=function(t){this.map_=t},e}(ne),Yl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return Yl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==mr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Xl(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Kl),$l=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Hl(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var Jl=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return $l(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==mr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==mr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==mr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==mr.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===mr.POINTERDOWN||e===mr.POINTERDRAG||e===mr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==mr.POINTERUP?delete this.trackedPointers_[i]:(t.type==mr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Pt(this.trackedPointers_)}},e}(Kl);function Ql(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var tu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},eu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},iu=Ct,ou=function(t){var e=t.originalEvent;return 0==e.button&&!(pe&&de&&e.ctrlKey)},nu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ru=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},au=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},su=function(t){var e=t.originalEvent;return Ae(void 0!==e,56),"mouse"==e.pointerType},lu=function(t){var e=t.originalEvent;return Ae(void 0!==e,56),e.isPrimary&&0===e.button},uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pu=function(t){function e(e){var i=t.call(this,{stopDown:zt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:Ql(nu,lu);return i.condition_=o.onFocusOnly?Ql(eu,n):n,i.noKinetic_=!1,i}return uu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=Hl(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Xo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:hi})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Jl),du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hu=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:zt})||this).condition_=o.condition?o.condition:tu,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return du(e,t),e.prototype.handleDragEvent=function(t){if(su(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Lr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!su(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!su(t)&&(!(!ou(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Jl),cu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fu=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return cu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ma([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(_t),gu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mu="boxstart",vu="boxdrag",yu="boxend",_u="boxcancel",bu=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return gu(e,t),e}(vt),xu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new fu(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:ou,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return gu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new bu(vu,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new bu(e?yu:_u,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new bu(mu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Jl),ku=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:ru;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return ku(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:hi})},e}(xu),Su=37,Cu=38,zu=39,Tu=40,Eu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ou=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return nu(t)&&au(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Eu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Bt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Tu||o==Su||o==zu||o==Cu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Tu?s=-r:o==Su?a=-r:o==zu?a=r:s=r;var l=[a,s];Xo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:fi,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kl),Pu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ju=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:au,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Pu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Bt||t.type==qt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;Xl(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kl),Ru=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fu="trackpad",Mu="wheel",Au=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:iu;return i.condition_=o.onFocusOnly?Ql(eu,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Iu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Xt)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Xt&&(e=o.deltaY,ue&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=he),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Fu:Mu);var r=i.getView();if(this.mode_===Fu&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-De(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Xl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Kl),Du=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Du(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Lr){var l=a.getViewport().getBoundingClientRect(),u=Hl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Jl),Gu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Gu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=Hl(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Jl),Bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qu=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return Bu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return so(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return No},e.prototype.intersectsExtent=function(t){if(Oo(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||vo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=na(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Ur(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Xr(i,0,i.length,o,t,e,i)),this.changed()},e}(Jr);qu.prototype.transform;var Wu=qu;function Vu(t,e,i,o,n){Uu(t,e,i||0,o||t.length-1,n||Ku)}function Uu(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);Uu(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],d=i,h=o;for(Xu(t,i,e),n(t[o],p)>0&&Xu(t,i,o);d<h;){for(Xu(t,d,h),d++,h--;n(t[d],p)<0;)d++;for(;n(t[h],p)>0;)h--}0===n(t[i],p)?Xu(t,i,h):Xu(t,++h,o),h<=e&&(i=h+1),e<=h&&(o=h-1)}}function Xu(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function Ku(t,e){return t<e?-1:t>e?1:0}class Yu{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!rp(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;rp(t,s)&&(e.leaf?i.push(a):np(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!rp(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(rp(t,r)){if(e.leaf||np(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ap([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=Zu(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!np(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=ap(t.slice(e,i+1)),$u(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=ap([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));sp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);sp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return $u(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=ep(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),Ju(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=ap(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,$u(i,this.toBBox),$u(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=ap([t,e]),this.data.height=t.height+1,this.data.leaf=!1,$u(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=Hu(t,0,a,this.toBBox),s=Hu(t,a,i,this.toBBox),l=op(e,s),u=ep(e)+ep(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:Qu,n=t.leaf?this.compareMinY:tp;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=Hu(t,0,e,n),a=Hu(t,i-e,i,n);let s=ip(r)+ip(a);for(let l=e;l<i-e;l++){const e=t.children[l];Ju(r,t.leaf?n(e):e),s+=ip(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Ju(a,t.leaf?n(e):e),s+=ip(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)Ju(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():$u(t[i],this.toBBox)}}function Zu(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function $u(t,e){Hu(t,0,t.children.length,e,t)}function Hu(t,e,i,o,n){n||(n=ap(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];Ju(n,t.leaf?o(e):e)}return n}function Ju(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Qu(t,e){return t.minX-e.minX}function tp(t,e){return t.minY-e.minY}function ep(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ip(t){return t.maxX-t.minX+(t.maxY-t.minY)}function op(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function np(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function rp(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ap(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;Vu(t,a,e,i,n),r.push(e,a,a,i)}}var lp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),up="renderOrder",pp=function(t){function e(e){var i=this,o=e||{},n=Et({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return lp(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(up)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Yu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(up,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:sl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Ae("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(ii),dp={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},hp=[dp.FILL],cp=[dp.STROKE],fp=[dp.BEGIN_PATH],gp=[dp.CLOSE_PATH],mp=dp,vp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_p=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return yp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],io(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,d,h=t[e],c=t[e+1],f=this.tmpCoordinate_,g=!0;for(u=e+o;u<i;u+=o)f[0]=t[u],f[1]=t[u+1],(d=ro(l,f))!==p?(g&&(a[s++]=h,a[s++]=c,g=!1),a[s++]=f[0],a[s++]=f[1]):d===Ki?(a[s++]=f[0],a[s++]=f[1],g=!1):g=!0,h=f[0],c=f[1],p=d;return(n&&g||u===e+o)&&(a[s++]=h,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),d=this.coordinates.length;switch(u){case Lo:n=t.getOrientedFlatCoordinates(),s=[];var h=t.getEndss();l=0;for(var c=0,f=h.length;c<f;++c){var g=[];l=this.drawCustomCoordinates_(n,l,h[c],p,g),s.push(g)}this.instructions.push([mp.CUSTOM,d,s,t,i,ca]),this.hitDetectionInstructions.push([mp.CUSTOM,d,s,t,o||i,ca]);break;case Mo:case Do:a=[],n=u==Mo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([mp.CUSTOM,d,a,t,i,ha]),this.hitDetectionInstructions.push([mp.CUSTOM,d,a,t,o||i,ha]);break;case Io:case No:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([mp.CUSTOM,d,r,t,i,da]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i,da]);break;case Ao:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>d&&(this.instructions.push([mp.CUSTOM,d,r,t,i,da]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i,da]));break;case Ro:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([mp.CUSTOM,d,r,t,i]),this.hitDetectionInstructions.push([mp.CUSTOM,d,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[mp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[mp.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==mp.END_GEOMETRY?r=t:o==mp.BEGIN_GEOMETRY&&(i[2]=t,kt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=tl(o||"#000")}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=tl(n||"#000");var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var a=e.getLineDash();i.lineDash=a?a.slice():Wn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=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},e.prototype.createFill=function(t){var e=t.fillStyle,i=[mp.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[mp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!St(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[mp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=to(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Qi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(vp),bp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xp=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return bp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([mp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([mp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([mp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([mp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(_p),kp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return kp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[mp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Wn,0],fp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(cp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(cp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(cp),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(cp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(fp)},e}(_p),Sp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Sp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(fp),this.hitDetectionInstructions.push(fp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),h=[mp.MOVE_TO_LINE_TO,p,d];this.instructions.push(h),this.hitDetectionInstructions.push(h),a&&(this.instructions.push(gp),this.hitDetectionInstructions.push(gp)),e=u}return r&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),a&&(this.instructions.push(cp),this.hitDetectionInstructions.push(cp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[mp.CIRCLE,s];this.instructions.push(fp,l),this.hitDetectionInstructions.push(fp,l),void 0!==i.fillStyle&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),void 0!==i.strokeStyle&&(this.instructions.push(cp),this.hitDetectionInstructions.push(cp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([mp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([mp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=la(i[o],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(_p);function zp(t,e,i,o,n){var r,a,s,l,u,p,d,h,c,f=i,g=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(h=_-l,c=b-u,s=Math.sqrt(h*h+c*c),void 0!==p&&(v+=a,Math.acos((p*h+d*c)/(a*s))>t&&(v>m&&(m=v,f=y,g=r),v=0,y=r-n)),a=s,p=h,d=c),l=_,u=b}return(v+=s)>m?[y,r]:[f,g]}var Tp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ep={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Op={Circle:Cp,Default:_p,Image:xp,LineString:wp,Polygon:Cp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Tp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==hl||s!=Io&&s!=Do&&s!=Mo&&s!=Lo){var p=n.overflow?null:[];switch(s){case Ro:case Ao:l=t.getFlatCoordinates();break;case Io:l=t.getFlatMidpoint();break;case No:l=t.getCenter();break;case Do:l=t.getFlatMidpoints(),u=2;break;case Mo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Lo:var d=t.getFlatInteriorPoints();l=[];for(k=0,w=d.length;k<w;k+=3)n.overflow||p.push(d[k+2]/this.resolution),l.push(d[k],d[k+1]);if(0===l.length)return;u=2}if((P=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(P-a)/2!=l.length/u){var h=a/2;p=p.filter((function(t,e){var i=r[2*(h+e)]===l[e*u]&&r[2*(h+e)+1]===l[e*u+1];return i||--h,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Vn&&(n.scale[0]<0||n.scale[1]<0)){var f=n.padding[0],g=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(g=-g,v=-v),n.scale[1]<0&&(f=-f,m=-m),c=[f,g,m,v]}var y=this.pixelRatio;this.instructions.push([mp.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Vn?Vn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([mp.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!Oo(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Io)b=[l.length];else if(s==Do)b=t.getEnds();else if(s==Mo)b=t.getEnds().slice(0,1);else if(s==Lo){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,T=0,E=b.length;T<E;++T){if(null==S){var O=zp(n.maxAngle,l,C,b[T],u);C=O[0],z=O[1]}else z=b[T];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var P=r.length;C=b[T],this.drawChars_(a,P),a=P}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Ep[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,d=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([mp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,d*s,p,r,1]),this.hitDetectionInstructions.push([mp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,d,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=tl(r.getColor()||"#000")):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=s?s.slice():Wn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=tl(a.getColor()||"#000")}else n=null,this.textStrokeState_=n;i=this.textState_;var d=t.getFont()||"10px sans-serif";Hn(d);var h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=d,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Vn,i.scale=void 0===h?[1,1]:h;var c=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:ee(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+ee(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(_p)},Pp=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Op[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),jp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rp=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return jp(e,t),e.prototype.getFeatures=function(t){return Qt()},e.prototype.prepareFrame=function(t){return Qt()},e.prototype.renderFrame=function(t,e){return Qt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Bs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Bs&&e!=qs&&t.addEventListener(Mt,this.boundHandleImageChange_),e==Gs&&(t.load(),e=t.getState()),e==Bs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Qe&&t.changed()},e}(Jt),Ip=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fp=function(t){function e(e){var i=t.call(this,e)||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 Ip(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===Se(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=me()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=zo(i),n=To(i),r=bo(i),a=_o(i);kn(e.coordinateToPixelTransform,o),kn(e.coordinateToPixelTransform,n),kn(e.coordinateToPixelTransform,r),kn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;kn(s,o),kn(s,n),kn(s,r),kn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new qn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Ke,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ye,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,d=-t[0]+a,h=-t[1];return Sn(this.tempTransform,s,l,u,p,-i,d,h)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=kn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!io(a,kn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(d){return"SecurityError"===d.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Rp),Mp="Circle",Ap="Default",Dp="Image",Lp="LineString",Gp="Polygon",Np="Text";function Bp(t,e,i,o,n,r,a,s,l,u,p,d){var h=t[e],c=t[e+1],f=0,g=0,m=0,v=0;function y(){f=h,g=c,h=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((h-f)*(h-f)+(c-g)*(c-g))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ve(f,h,_),x=Ve(g,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ve(f,h,_=0===m?0:(S-v)/m),T=Ve(g,c,_);if(d){var E=[b,x,z,T];Ur(E,0,4,2,d,E,E),C=E[0]>E[2]}else C=b>z;var O,P=Math.PI,j=[],R=k+o===e;if(m=0,v=w,h=t[e=k],c=t[e+1],R){y(),O=Math.atan2(c-g,h-f),C&&(O+=O>0?-P:P);var I=(z+b)/2,F=(T+x)/2;return j[0]=[I,F,(S-r)/2,O,n],j}for(var M=0,A=n.length;M<A;){y();var D=Math.atan2(c-g,h-f);if(C&&(D+=D>0?-P:P),void 0!==O){var L=D-O;if(L+=L>P?-2*P:L<-P?2*P:0,Math.abs(L)>a)return null}O=D;for(var G=M,N=0;M<A;++M){var B=s*l(u,n[C?A-M-1:M],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(M!==G){var q=C?n.substring(A-G,A-M):n.substring(G,M);I=Ve(f,h,_=0===m?0:(r+N/2-v)/m),F=Ve(g,c,_);j.push([I,F,N/2,D,q]),r+=N}}return j}var qp=[1/0,1/0,-1/0,-1/0],Wp=[],Vp=[],Up=[],Xp=[];function Kp(t){return t[3].declutterBox}var Yp=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Zp(t,e){return"start"!==e&&"end"!==e||Yp.test(t)||(e="start"===e?"left":"right"),Ep[e]}var $p=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Zp(t,s.textAlign||"center"),d=o&&r.lineWidth?r.lineWidth:0,h=t.split("\n"),c=h.length,f=[],g=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=tr(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,h,f),m=Jn(s.font),v=g+d,y=[],_=(v+2)*u[0],b=(m*c+d)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",d),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(ce?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*d;if(o)for(k=0;k<c;++k)y.push("strokeText",[h[k],S+w*f[k],.5*(d+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[h[k],S+w*f[k],.5*(d+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,d,h,c,f,g){var m,v=i-(a*=d[0]),y=o-(s*=d[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*d[0]+c[1],k=c[0]+b*d[1]+c[2],w=v-c[3],S=y-c[0];return(f||0!==p)&&(Wp[0]=w,Xp[0]=w,Wp[1]=S,Vp[1]=S,Vp[0]=w+x,Up[0]=Vp[0],Up[1]=S+k,Xp[1]=Up[1]),0!==p?(kn(m=Sn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Wp),kn(m,Vp),kn(m,Up),kn(m,Xp),so(Math.min(Wp[0],Vp[0],Up[0],Xp[0]),Math.min(Wp[1],Vp[1],Up[1],Xp[1]),Math.max(Wp[0],Vp[0],Up[0],Xp[0]),Math.max(Wp[1],Vp[1],Up[1],Xp[1]),qp)):so(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),qp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:qp[0],minY:qp[1],maxX:qp[2],maxY:qp[3],value:g},canvasTransform:m,scale:d}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Wp,Vp,Up,Xp,r,a),ir(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=kn(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=Zp(t,n.textAlign||"center"),u=Ep[n.textBaseline||"middle"],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&St(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Vr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,d,h,c,f,g,m,v,y,_,b,x,k,w,S,C=0,z=o.length,T=0,E=0,O=0,P=null,j=null,R=this.coordinateCache_,I=this.viewRotation_,F=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},A=this.instructions!=o||this.overlaps?0:200;C<z;){var D=o[C];switch(D[0]){case mp.BEGIN_GEOMETRY:x=D[1],S=D[3],x.getGeometry()?void 0===a||Oo(a,S.getExtent())?++C:C=D[2]+1:C=D[2];break;case mp.BEGIN_PATH:E>A&&(this.fill_(t),E=0),O>A&&(t.stroke(),O=0),E||O||(t.beginPath(),h=NaN,c=NaN),++C;break;case mp.CIRCLE:var L=l[T=D[1]],G=l[T+1],N=l[T+2]-L,B=l[T+3]-G,q=Math.sqrt(N*N+B*B);t.moveTo(L+q,G),t.arc(L,G,q,0,2*Math.PI,!0),++C;break;case mp.CLOSE_PATH:t.closePath(),++C;break;case mp.CUSTOM:T=D[1],u=D[2];var W=D[3],V=D[4],U=6==D.length?D[5]:void 0;M.geometry=W,M.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,T,u,2,X):(X[0]=l[T],X[1]=l[T+1],X.length=2),V(X,M),++C;break;case mp.DRAW_IMAGE:T=D[1],u=D[2],m=D[3],p=D[4],d=D[5];var K=D[6],Y=D[7],Z=D[8],$=D[9],H=D[10],J=D[11],Q=D[12],tt=D[13],et=D[14];if(!m&&D.length>=19){v=D[18],y=D[19],_=D[20],b=D[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,D[3]=m;var ot=D[22];p=(it.anchorX-ot)*this.pixelRatio,D[4]=p;var nt=D[23];d=(it.anchorY-nt)*this.pixelRatio,D[5]=d,K=m.height,D[6]=K,tt=m.width,D[13]=tt}var rt=void 0;D.length>24&&(rt=D[24]);var at=void 0,st=void 0,lt=void 0;D.length>16?(at=D[15],st=D[16],lt=D[17]):(at=Vn,st=!1,lt=!1),H&&F?J+=I:H||F||(J-=I);for(var ut=0;T<u;T+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[T],l[T+1],tt,K,p,d,Z,$,J,Q,n,at,st||lt,x),Y,st?P:null,lt?j:null],dt=void 0,ht=void 0;if(s&&et){var ct=u-T;if(!et[ct]){et[ct]=pt;continue}if(dt=et[ct],delete et[ct],ht=Kp(dt),s.collides(ht))continue}s&&s.collides(Lt.declutterBox)||(dt&&(s&&s.insert(ht),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case mp.DRAW_CHARS:var ft=D[1],gt=D[2],mt=D[3],vt=D[4];b=D[5];var yt=D[6],_t=D[7],bt=D[8];_=D[9];var xt=D[10];v=D[11],y=D[12];var kt=[D[13],D[13]],wt=this.textStates[y],Ct=wt.font,zt=[wt.scale[0]*_t,wt.scale[1]*_t],Tt=void 0;Ct in this.widths_?Tt=this.widths_[Ct]:(Tt={},this.widths_[Ct]=Tt);var Et=gs(l,ft,gt,2),Ot=Math.abs(zt[0])*er(Ct,v,Tt);if(vt||Ot<=Et){var Pt=this.textStates[y].textAlign,jt=Bp(l,ft,gt,2,v,(Et-Ot)*Ep[Pt],yt,Math.abs(zt[0]),er,Ct,Tt,F?0:this.viewRotation_);t:if(jt){var Rt=[],It=void 0,Ft=void 0,Mt=void 0,At=void 0,Dt=void 0;if(_)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,"",_),p=Dt[2]+(zt[0]<0?-xt:xt),d=mt*At.height+2*(.5-mt)*xt*zt[1]/zt[0]-bt;var Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],kt,!1,Vn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}if(b)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,b,""),p=Dt[2],d=mt*At.height-bt;Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],kt,!1,Vn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}s&&s.load(Rt.map(Kp));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case mp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=D[1],S);if(Bt)return Bt}++C;break;case mp.FILL:A?E++:this.fill_(t),++C;break;case mp.MOVE_TO_LINE_TO:for(T=D[1],u=D[2],k=l[T],g=(w=l[T+1])+.5|0,(f=k+.5|0)===h&&g===c||(t.moveTo(k,w),h=f,c=g),T+=2;T<u;T+=2)f=(k=l[T])+.5|0,g=(w=l[T+1])+.5|0,T!=u-2&&f===h&&g===c||(t.lineTo(k,w),h=f,c=g);++C;break;case mp.SET_FILL_STYLE:P=D,this.alignFill_=D[2],E&&(this.fill_(t),E=0,O&&(t.stroke(),O=0)),t.fillStyle=D[1],++C;break;case mp.SET_STROKE_STYLE:j=D,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,D),++C;break;case mp.STROKE:A?O++:t.stroke(),++C;break;default:++C}}E&&this.fill_(t),O&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),Hp=[Gp,Mp,Lp,Dp,Np,Ap],Jp=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new $p(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=Sn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=me(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(fo(u=[1/0,1/0,-1/0,-1/0],t),Qi(u,e*(this.renderBuffer_+o),u));var d,h=function(t){if(void 0!==Qp[t])return Qp[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return Qp[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=h.length;s<l;s++)if(i[h[s]]>0){if(!r||d!==Dp&&d!==Np||-1!==r.indexOf(t)){var u=(h[s]-3)/4,c=o-u%a,f=o-(u/a|0),g=n(t,e,c*c+f*f);if(g)return g}p.clearRect(0,0,a,a);break}}var f,g,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(bt),f=_.length-1;f>=0;--f){var b=_[f].toString();for(m=this.executorsByZIndex_[b],g=Hp.length-1;g>=0;--g)if(void 0!==(v=m[d=Hp[g]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Vr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return jt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(bt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,d,h,c,f=r||Hp;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var g=s[l].toString();for(h=this.executorsByZIndex_[g],p=0,d=f.length;p<d;++p){void 0!==(c=h[f[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),Qp={};var td=Jp,ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),id=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return ed(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var d=n[u]-this.imageAnchorX_,h=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=d+this.imageAnchorX_,f=h+this.imageAnchorY_;Sn(a,c,f,1,1,l,-c,-f),r.setTransform.apply(r,a),r.translate(c,f),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,h,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Sn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(Oo(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Vr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Ro:this.drawPoint(t);break;case Io:this.drawLineString(t);break;case Mo:this.drawPolygon(t);break;case Ao:this.drawMultiPoint(t);break;case Do:this.drawMultiLineString(t);break;case Lo:this.drawMultiPolygon(t);break;case Go:this.drawGeometryCollection(t);break;case No:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Oo(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Oo(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oo(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(St(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:tl(o||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),d=a||Wn;this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:1===this.pixelRatio_?d:d.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:tl(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:tl(i||"#000")}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:a||Wn,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:tl(n||"#000")}}else this.textStrokeState_=null;var d=t.getFont(),h=t.getOffsetX(),c=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==d?d:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==h?this.pixelRatio_*h:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(vp);function od(t,e,i,o,n,r,a){var s=me(.5*t[0],.5*t[1]);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new id(s,.5,n,null,a),p=i.length,d=Math.floor(16777215/p),h={},c=1;c<=p;++c){var f=i[c-1],g=f.getStyleFunction()||o;if(o){var m=g(f,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*d).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(f);if(x&&Oo(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var T=me(z[0],z[1],void 0,{alpha:!1}),E=T.canvas;T.fillStyle=v,T.fillRect(0,0,E.width,E.height),k.setImage(new Js({img:E,imgSize:z,anchor:C.getAnchor(),anchorXUnits:Fs,anchorYUnits:Fs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var O=k.getZIndex()||0;(R=h[O])||(R={},h[O]=R,R[Mo]=[],R[No]=[],R[Io]=[],R[Ro]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var P=Object.keys(h).map(Number).sort(bt),j=(c=0,P.length);c<j;++c){var R=h[P[c]];for(var I in R){var F=R[I];for(y=0,_=F.length;y<_;y+=2){u.setStyle(F[y+1]);for(var M=0,A=e.length;M<A;++M)u.setTransform(e[M]),u.drawGeometry(F[y])}}}return s.getImageData(0,0,l.width,l.height)}function nd(t,e,i){var o=[];if(i){var n=Math.floor(.5*Math.round(t[0])),r=Math.floor(.5*Math.round(t[1])),a=4*(De(n,0,i.width-1)+De(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var rd={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Bs)return;var l=t.getBuilder(i.getZIndex(),Dp);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Np);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Lp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Np);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Gp);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Bs)return;var l=t.getBuilder(i.getZIndex(),Dp);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Lp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Np);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Gp);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,rd[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Mp);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Np);u.setTextStyle(l),u.drawText(e,o)}}};function ad(t,e){return parseInt(ee(t),10)-parseInt(ee(e),10)}function sd(t,e){var i=ld(t,e);return i*i}function ld(t,e){return.5*t/e}function ud(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Bs||u==qs?l.unlistenImageChange(n):(u==Gs&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())pd(t,s,i,e);else{(0,rd[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function pd(t,e,i,o){if(e.getType()!=Go)t.getBuilder(i.getZIndex(),Ap).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)pd(t,n[r],i,o)}var dd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return dd(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),d=e.pixelRatio,h=e.viewHints,c=!(h[Er]||h[Or]),f=this.context,g=Math.round(e.size[0]*d),m=Math.round(e.size[1]*d),v=p.getWrapX()&&s.canWrapX(),y=v?Eo(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,d,g,m,b*y);t.execute(f,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){xn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),Cn(this.inversePixelTransform,this.pixelTransform);var n=zn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var d=t.viewState;d.projection;var h=!1,c=!0;if(o.extent&&this.clipping){var f=mn(o.extent);(h=(c=Oo(f,t.extent))&&!oo(f,t.extent))&&this.clipUnrotated(r,t,f)}c&&this.renderWorlds(s,t),h&&r.restore(),this.postRender(r,t);var g=Se(o.opacity),m=this.container;return g!==m.style.opacity&&(m.style.opacity=g),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];kn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=.5*i[0],d=.5*i[1];u.push(this.getRenderTransform(o,n,r,.5,p,d,0).slice());var h=l.getSource(),c=a.getExtent();if(h.getWrapX()&&a.canWrapX()&&!oo(c,s)){for(var f=s[0],g=Eo(c),m=0,v=void 0;f<c[0];)v=g*--m,u.push(this.getRenderTransform(o,n,r,.5,p,d,v).slice()),f+=g;for(m=0,f=s[2];f>c[2];)v=g*++m,u.push(this.getRenderTransform(o,n,r,.5,p,d,v).slice()),f-=g}this.hitDetectionImageData_=od(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(nd(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},d=function(t,e,i){var r=ee(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},h=[this.replayGroup_];return this.declutterExecutorGroup&&h.push(this.declutterExecutorGroup),h.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,d,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Er],n=t.viewHints[Or],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,d=t.pixelRatio,h=e.getRevision(),c=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=ad);var g=l.center.slice(),m=Qi(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!oo(_,t.extent)){var b=Eo(_),x=Math.max(Eo(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,$o(g,u);var k=function(t,e){var i=e.getExtent(),o=xo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Eo(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==f&&oo(this.wrappedRenderedExtent_,m))return St(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Pp(ld(p,d),m,p,d);this.getLayer().getDeclutter()&&(w=new Pp(ld(p,d),m,p,d));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var T=sd(p,d),E=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,T,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),O=gn(m),P=i.getFeaturesInExtent(O);f&&P.sort(f);for(C=0,z=P.length;C<z;++C)E(P[C]);this.renderedFeatures_=P;var j=S.finish(),R=new td(m,p,d,i.getOverlaps(),j,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new td(m,p,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=f,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=ud(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=ud(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Fp),cd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fd=function(t){function e(e){return t.call(this,e)||this}return cd(e,t),e.prototype.createRenderer=function(){return new hd(this)},e}(pp),gd=function(){function t(t){this.rbush_=new Yu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[ee(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[ee(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=ee(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[ee(e)];ho([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return jt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return so(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function vd(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var yd=function(t){function e(e){var i=t.call(this)||this;i.projection=tn(e.projection),i.attributions_=vd(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Qe,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return md(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Qt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=vd(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(ne),_d="addfeature",bd="changefeature",xd="clear",kd="removefeature",wd="featuresloadstart",Sd="featuresloadend",Cd="featuresloaderror";function zd(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Td(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==as&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==ss||o==ls?l=s.responseText:o==us?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==as&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Ed(t,e){return function(i,o,n,r,a){var s=this;Td(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||Tt)}}var Od=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Od(e,t),e}(vt),jd=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Qe,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=Tt,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Ae(i.format_,7),i.loader_=Ed(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:zd;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new gd:null,i.loadedExtentsRtree_=new gd,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new pi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Od(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=ee(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Pd(_d,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Kt(e,Mt,this.handleFeatureChange_,this),Kt(e,yt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Ae(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=ee(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=ee(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var d=i.length;n<d;n++)this.dispatchEvent(new Pd(_d,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(_d,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(kd,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ri,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ai,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(Zt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Pd(xd);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),jt(this.nullGeometryFeatures_)||wt(t,Pt(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||Ct;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=ee(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Pd(bd,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:ee(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&jt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return oo(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Pd(wd)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Pd(Sd,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Pd(Cd))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(ho(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=ee(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=ee(t);this.featureChangeKeys_[e].forEach(Zt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Pd(kd,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Ae(this.format_,7),this.url_=t,this.setLoader(Ed(t,this.format_))},e}(yd),Rd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Id="Point",Fd="LineString",Md="Polygon",Ad="Circle",Dd="drawstart",Ld="drawend",Gd="drawabort",Nd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Rd(e,t),e}(vt);var Bd=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=zt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case Ro:case Ao:return Id;case Io:case Do:return Fd;case Mo:case Lo:return Md;case No:return Ad;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Md?3:2,i.maxPoints_=i.mode_===Ad?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:Ct;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Ad)r=function(t,e,i){var o=e||new Wu([NaN,NaN]),n=fn(t[0]),r=Ko(n,fn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Id?a=_a:s===Fd?a=vs:s===Md&&(a=Ma),r=function(t,e,i){return e?s===Md?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new fd({source:new jd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=ll(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:nu,i.freehandCondition_,e.freehand?i.freehandCondition_=iu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ru,i.addChangeListener(Vl,i.updateState_),i}return Rd(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===Lt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Id&&this.freehandCondition_(e);var i=e.type===mr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===mr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===mr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===mr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===mr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===mr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===mr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new gr(mr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Id||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===Id)e=!0;else if(n===Ad)e=2===this.sketchCoords_.length;else if(n===Fd)i=this.sketchCoords_.length>this.minPoints_;else if(n===Md){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),d=t[0]-p[0],h=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(d*d+h*h)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new os(new _a(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new os);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new vs(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Id?this.sketchCoords_=t.slice():this.mode_===Md?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new os(new vs(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new os,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Nd(Dd,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Id?i=this.sketchCoords_:this.mode_===Md?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Mo&&this.mode_!==Md)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Fd||r===Ad?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Md&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===Fd||o===Ad){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Mo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Md){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Fd?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Md&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Ao?t.setGeometry(new xs([e])):this.type_===Do?t.setGeometry(new _s([e])):this.type_===Lo&&t.setGeometry(new Ss([e])),this.dispatchEvent(new Nd(Ld,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Nd(Gd,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Fd||i===Ad)e=this.sketchCoords_;else{if(i!==Md)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new os(new _a(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Nd(Dd,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Jl),qd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Wd=[0,0,0,0],Vd=[],Ud="modifystart",Xd="modifyend",Kd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return qd(e,t),e}(vt);function Yd(t,e){return t.index-e.index}function Zd(t,e,i){var o=e.geometry;if(o.getType()===No){var n=o;if(1===e.index){null;var r=Ko(n.getCenter(),fn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=fn(t);return Vd[0]=fn(e.segment[0]),Vd[1]=fn(e.segment[1]),Zo(s,Vd)}function $d(t,e,i){var o=e.geometry;if(o.getType()===No&&1===e.index){var n=o;return cn(n.getClosestPoint(fn(t)))}var r=fn(t);return Vd[0]=fn(e.segment[0]),Vd[1]=fn(e.segment[1]),cn(Vo(r,Vd))}var Hd=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:lu,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==mr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:iu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new gd,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new fd({source:new jd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=ll(),function(t,e){return i[Ro]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new pi(n.source_.getFeatures()),n.source_.addEventListener(_d,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(kd,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ri,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ai,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return qd(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Mt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new pi;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Kd(Ud,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(Mt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,geometry:e,depth:[a,o],index:u,segment:d};this.rBush_.insert(Ji(d),h)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(uo(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new os(new _a(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=mr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=mr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==mr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,d=void 0,h=s.segment,c=a[1];e.length<u.getStride();)e.push(h[c][e.length]);switch(u.getType()){case Ro:d=e,h[0]=e,h[1]=e;break;case Ao:(d=u.getCoordinates())[s.index]=e,h[0]=e,h[1]=e;break;case Io:(d=u.getCoordinates())[s.index+c]=e,h[c]=e;break;case Do:case Mo:(d=u.getCoordinates())[p[0]][s.index+c]=e,h[c]=e;break;case Lo:(d=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,h[c]=e;break;case No:if(h[0]=e,h[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=Yo(fn(u.getCenter()),fn(e));u.setRadius(f),this.changingFeature_=!1}}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Ji([r]),s=this.rBush_.getInExtent(a),l={};s.sort(Yd);for(var u=0,p=s.length;u<p;++u){var d=s[u],h=d.segment,c=ee(d.geometry),f=d.depth;if(f&&(c+="-"+f.join("-")),l[c]||(l[c]=new Array(2)),d.geometry.getType()!==No||1!==d.index)if(!Uo(h[0],r)||l[c][0])if(!Uo(h[1],r)||l[c][1])ee(h)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(d);else{if((d.geometry.getType()===Io||d.geometry.getType()===Do)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([d,1]),l[c][1]=d}else this.dragSegments_.push([d,0]),l[c][0]=d;else Uo($d(e,d,o),r)&&!l[c][0]&&(this.dragSegments_.push([d,0]),l[c][0]=d)}n.length&&this.willModifyFeatures_(t,[n]);for(var g=n.length-1;g>=0;--g)this.insertVertex_(n[g],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===No){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(uo(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Ji(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Kd(Xd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Ro&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=gn(Qi(mn(uo(a,Wd)),e.getView().getResolution()*this.pixelTolerance_,Wd));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return Zd(a,t,s)-Zd(a,e,s)}))[0],d=p.segment,h=$d(a,p,s),c=e.getPixelFromCoordinate(h),f=Yo(t,c);if(n||f<=this.pixelTolerance_){var g={};if(g[ee(d)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-a[0],this.delta_[1]=h[1]-a[1]),p.geometry.getType()===No&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(d[0]),v=e.getPixelFromCoordinate(d[1]),y=Ko(c,m),_=Ko(c,v);f=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>_?d[1]:d[0]),this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);var b={};b[ee(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Uo(d[0],w[0])&&Uo(d[1],w[1])||Uo(d[0],w[1])&&Uo(d[1],w[0])))break;var S=ee(o[x].geometry);S in b||(b[S]=!0,g[ee(w)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Do:case Mo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Lo:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Io:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Ji(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Ji(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=mr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Kd(Xd,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,d=this.dragSegments_,h={},c=!1;for(n=d.length-1;n>=0;--n)p=ee((u=(i=d[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in h||(h[p]={}),0===i[1]?(h[p].right=u,h[p].index=u.index):1==i[1]&&(h[p].left=u,h[p].index=u.index+1);for(p in h){switch(l=h[p].right,a=h[p].left,(s=(r=h[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Do:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Io:e.length>2&&(e.splice(r,1),c=!0);break;case Lo:t=t[u.depth[1]];case Mo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var f=[];if(void 0!==a&&(this.rBush_.remove(a),f.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==a&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:f};this.rBush_.insert(Ji(g.segment),g)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||St(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(Jl),Jd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Qd(t){return t.feature?t.feature:t.element?t.element:void 0}var th=[],eh=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=Ct),n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new gd,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Jd(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=ee(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Kt(t,Mt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Qd(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Qd(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=ee(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Pt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=ee(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Zt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Zt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Kt(this.features_,ri,this.handleFeatureAdd_,this),Kt(this.features_,ai,this.handleFeatureRemove_,this)):this.source_&&o.push(Kt(this.source_,_d,this.handleFeatureAdd_,this),Kt(this.source_,kd,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Ji([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==No})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=fn(e),p=1/0,d=0;d<n.length;++d){var h=n[d];th[0]=fn(h.segment[0]),th[1]=fn(h.segment[1]);var c=Zo(u,th);c<p&&(l=h,p=c)}var f=l.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Ko(t,g),y=Ko(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===No;if(_){var b=l.feature.getGeometry();null,a=cn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else th[0]=fn(f[0]),th[1]=fn(f[1]),a=cn(Vo(u,th));if(Yo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Ko(s,g),y=Ko(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Da(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Ji(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ji(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,segment:d};this.rBush_.insert(Ji(d),h)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Ji(l),u)}},e}(Jl);function ih(t){var e=t||{},i=new pi,o=new Ru(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new hu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Zl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new pu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Lu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Nu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Ou),i.push(new ju({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Au({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new wu({duration:e.zoomDuration})),i}var oh=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=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.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.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 nh(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new oh(t,e,i,o)}var rh=oh,ah=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sh=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new rh(0,0,0,0),i}return ah(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==wr||i==Cr||i==Sr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Sr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(wr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),d=p.getRevision(),h=p.getTileGridForProjection(n),c=h.getZForResolution(r,p.zDirection),f=h.getResolution(c),g=t.extent,m=i.extent&&mn(i.extent);m&&(g=Co(g,mn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=f*y/2/v,k=f*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=h.getTileRangeForExtentAndZ(g,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),T=this.tmpExtent,E=this.tmpTileRange_;this.newTiles_=!1;for(var O=S.minX;O<=S.maxX;++O)for(var P=S.minY;P<=S.maxY;++P){var j=this.getTile(c,O,P,t);if(this.isDrawableTile(j)){var R=ee(this);if(j.getState()==wr){C[c][j.tileCoord.toString()]=j;var I=j.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0)}if(1===j.getAlpha(R,t.time))continue}var F=h.getTileCoordChildTileRange(j.tileCoord,E,T),M=!1;F&&(M=z(c+1,F)),M||h.forEachTileCoordParentTileRange(j.tileCoord,z,E,T)}var A=f/r;Sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var D=zn(this.pixelTransform);this.useContainer(e,D,i.opacity);var L=this.context,G=L.canvas;Cn(this.inversePixelTransform,this.pixelTransform),Sn(this.tempTransform,y/2,_/2,A,A,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),Et(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,q,W=Object.keys(C).map(Number);W.sort(bt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):W=W.reverse();for(var V=W.length-1;V>=0;--V){var U=W[V],X=p.getTilePixelSize(U,l,n),K=h.getResolution(U)/f,Y=X[0]*K*A,Z=X[1]*K*A,$=h.getTileCoordForCoordAndZ(zo(w),U),H=h.getTileCoordExtent($),J=kn(this.tempTransform,[v*(H[0]-w[0])/f,v*(w[3]-H[3])/f]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(j=tt[et]).tileCoord,ot=$[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=$[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(O=Math.round(J[0]-ot*Y)),lt=at-(P=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==j.getAlpha(ee(this),t.time)))if(N){L.save(),q=[O,P,O+st,P,O+st,P+lt,O,P+lt];for(var pt=0,dt=N.length;pt<dt;++pt)if(c!==U&&U<B[pt]){var ht=N[pt];L.beginPath(),L.moveTo(q[0],q[1]),L.lineTo(q[2],q[3]),L.lineTo(q[4],q[5]),L.lineTo(q[6],q[7]),L.moveTo(ht[6],ht[7]),L.lineTo(ht[4],ht[5]),L.lineTo(ht[2],ht[3]),L.lineTo(ht[0],ht[1]),L.clip()}N.push(q),B.push(U)}else L.clearRect(O,P,st,lt);this.drawTileImage(j,t,O,P,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,p,j)}}this.renderedRevision=d,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!ho(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,h,l,n,g,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),D!==G.style.transform&&(G.style.transform=D);var ct=Se(i.opacity),ft=this.container;return ct!==ft.style.opacity&&(ft.style.opacity=ct),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=ee(this),p=s?t.getAlpha(u,e.time):1,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),d&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=ee(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=ee(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=ee(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,d,h,c,f,g,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(g=i.getMinZoom();g<=a;++g)for(d=i.getTileRangeForExtentAndZ(r,g,d),h=i.getResolution(g),c=d.minX;c<=d.maxX;++c)for(f=d.minY;f<=d.maxY;++f)a-g<=s?(++y,(p=e.getTile(g,c,f,o,n)).getState()==xr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),h])),void 0!==l&&l(p)):e.useTile(g,c,f,n);e.updateCacheSize(y,n)},e}(Fp);sh.prototype.getLayer;var lh=sh,uh="image",ph="hybrid",dh="vector",hh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ch={image:[Gp,Mp,Lp,Dp,Np],hybrid:[Gp,Lp],vector:[]},fh={hybrid:[Dp,Np,Ap],vector:[Gp,Mp,Lp,Dp,Np,Ap]},gh=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return hh(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==wr&&n!==Sr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),d=n.viewHints,h=!(d[Er]||d[Or]);return!h&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(h||Date.now()-n.time<8)&&u.getRenderMode()!==dh&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===dh?ee(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),d=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),h=l.getSourceTiles(e,i,t),c=ee(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var f=function(i,n){var f=h[i];if(f.getState()!=wr)return"continue";var m=f.tileCoord,v=p.getTileCoordExtent(m),y=Co(d,v),_=Qi(y,o.getRenderBuffer()*a,g.tmpExtent),b=ho(v,y)?null:_;s.dirty=!1;var x=new Pp(0,_,a,e),k=u?new Pp(0,y,a,e):void 0,w=sd(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=f.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,T=C.length;z<T;++z){var E=C[z];b&&!Oo(b,E.getGeometry().getExtent())||S.call(g,E)}var O=x.finish(),P=o.getRenderMode()!==dh&&u&&1===h.length?null:y,j=new td(P,a,e,l.getOverlaps(),O,o.getRenderBuffer());if(t.executorGroups[c].push(j),k){var R=new td(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},g=this,m=0,v=h.length;m<v;++m)f(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Ji([t]);Qi(u,r*i,u);for(var p,d={},h=function(t,e,i){var r=t.getId();void 0===r&&(r=ee(t));var a=d[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return d[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return d[r]=!0,o(t,s,e);n.push(d[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,f=function(o,n){var d=c[o];if(!Oo(l.getTileCoordExtent(d.wrappedTileCoord),u))return"continue";var f=ee(s),g=[d.executorGroups[f]],m=d.declutterExecutorGroups[f];m&&g.push(m),g.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,h,n))return!0}}))},g=0,m=c.length;!p&&g<m;++g)f(g);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=ee(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),d=kn(this.renderedPixelToCoordinateTransform_,t.slice()),h=p.getTileCoordForCoordAndResolution(d,u),c=0,f=this.renderedTiles.length;c<f;++c)if(h.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===wr){var g=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!oo(l,g)&&$o(d,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=zo(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(d[0]-m[0])/u,(m[1]-d[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Va(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=od(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,.5,.5*b[0],.5*b[1],0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(nd(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[Er]||o[Or]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[ee(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,h=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(d,this.tmpExtent)[0]-h[0];return bn(wn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Er]||o[Or]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=fh[a],p=e.viewState.rotation,d=this.renderedTiles,h=[],c=[],f=d.length-1;f>=0;--f)for(var g=d[f],m=this.getTileRenderTransform(g,e),v=g.executorGroups[ee(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=g.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=h.length;S<C;++S){var z=h[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),h.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=ud(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=ud(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===dh)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[ee(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,d=l.getTileGridForProjection(p),h=d.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*h,f=d.getResolution(s),g=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);g.canvas.width=m[0],g.canvas.height=m[1];var v=u/c;if(1!==v){var y=_n(this.tmpTransform_);wn(y,v,v),g.setTransform.apply(g,y)}var _=d.getTileCoordExtent(a,this.tmpExtent),b=c/f,x=_n(this.tmpTransform_);wn(x,b,-b),function(t,e,i){bn(t,xn(yn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(g,v,x,0,!0,ch[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(lh),mh="preload",vh="useInterimTilesOnError",yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_h=function(t){function e(e){var i=this,o=e||{},n=Et({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===uh&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||ph;return Ae(r==ph||r==dh,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return yh(e,t),e.prototype.createRenderer=function(){return new gh(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(mh)},e.prototype.getUseInterimTilesOnError=function(){return this.get(vh)},e.prototype.setPreload=function(t){this.set(mh,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(vh,t)},e}(pp),bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xh=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return bh(e,t),e.prototype.changed=function(){this.dispatchEvent(Mt)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==wr)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==wr){t.interimTile=null;break}t.getState()==kr?e=t:t.getState()==xr?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Sr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Qt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:di(o/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Ft),kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wh=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return kh(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==xr&&(this.setState(kr),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Sr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(wr)},e.prototype.setLoader=function(t){this.loader_=t},e}(xh),Sh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return Ae(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Ae(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Ae(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Ch(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function zh(t,e,i){return t+"/"+e+"/"+i}function Th(t){return zh(t[0],t[1],t[2])}function Eh(t){return t.split("/").map(Number)}var Oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ph=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Eh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Th(e.tileCoord)),e.release())}.bind(this))}},e}(Sh),jh="tileloadstart",Rh="tileloadend",Ih="tileloaderror",Fh=[0,0,0],Mh=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Ae((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||bt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Ae(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=zo(s)),Ae(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Ae(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Ae(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new rh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?nh(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return nh(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return nh(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?nh(s,s,l,l,i):nh(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Va(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return so(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Fh;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),nh(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Va(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Va(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return so(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Va(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,d=Math.floor((t-s[0])/i+u),h=Math.floor((s[1]-e)/i+p),c=a*d/l[0],f=a*h/l[1];return o?(c=Math.ceil(c)-1,f=Math.ceil(f)-1):(c=Math.floor(c),f=Math.floor(f)),Ch(r,c,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Va(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),d=Math.floor((r[1]-e)/a+u),h=p/s[0],c=d/s[1];return o?(h=Math.ceil(h)-1,c=Math.ceil(c)-1):(h=Math.floor(h),c=Math.floor(c)),Ch(i,h,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return De(xt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Ah(t){var e=t.getDefaultTileGrid();return e||(e=Gh(t),t.setDefaultTileGrid(e)),e}function Dh(t){var e=t||{},i=e.extent||tn("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Lh(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Mh(o)}function Lh(t,e,i,o){for(var n=void 0!==e?e:42,r=So(t),a=Eo(t),s=Va(void 0!==i?i:256),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),d=0;d<u;++d)p[d]=l/Math.pow(2,d);return p}function Gh(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Vi,r=Lh(t,e,i);return new Mh({extent:t,origin:ko(t,n),resolutions:r,tileSize:i})}(Nh(t),e,i,o)}function Nh(t){var e=(t=tn(t)).getExtent();if(!e){var i=180*ki[wi.DEGREES]/t.getMetersPerUnit();e=so(-i,-i,i,i)}return e}var Bh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qh=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Va(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Ph(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Bh(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=zh(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===wr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Qt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ah(t)},e.prototype.getTileCacheForProjection=function(t){return Ae(an(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Va(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Nh(i);if(io(r,n))return e;var a=Eo(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(yd),Wh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Bh(e,t),e}(vt),Vh=qh;function Uh(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Ae(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function Xh(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Uh(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=We(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var Kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yh=function(t){function e(i){var o=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 o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return Kh(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=ee(i),n=i.getState();n==kr?(this.tileLoadingKeys_[o]=!0,e=jh):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Sr?Ih:n==wr?Rh:void 0),null!=e&&this.dispatchEvent(new Wh(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Xh(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=zh(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(Vh),Zh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$h=[],Hh=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return Zh(e,t),e.prototype.getContext=function(t){var e=ee(t);return e in this.context_||(this.context_[e]=me(1,1,$h)),this.context_[e]},e.prototype.hasContext=function(t){return ee(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=ee(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)$h.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(xh),Jh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qh=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Nh(o),r=e.tileGrid||Dh({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:tc,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Ph(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:wh,i.tileGrids_={},i}return Jh(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=Eh(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===wr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(Oo(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var d=0,h=p.length;d<h;++d){var c=p[d],f=c.getGeometry();Oo(t,f.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=zh((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===xr){i.setState(kr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Qi(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&Co(a,p,a);var d=u.getZForResolution(l,1);u.forEachTileCoord(a,d,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?xr:Cr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<wr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===wr||e===Sr){var n=a.getKey();n in i.errorTileKeys?a.getState()===wr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Sr?i.errorTileKeys[n]=!0:a.removeEventListener(Mt,l),0===i.loadingSourceTiles&&i.setState(jt(i.errorTileKeys)?wr:Sr)}};a.addEventListener(Mt,l),i.loadingSourceTiles++}s===xr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Sr}))?Sr:wr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=zh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(n);if(u&&p){var h=d.getTileCoordExtent(u);Qi(h,-d.getResolution(t),h),Oo(p,h)||(u=null)}var c=!0;if(null!==u){var f=this.tileGrid,g=d.getResolution(t),m=f.getZForResolution(g,1),v=d.getTileCoordExtent(u);Qi(v,-g,v),f.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new Hh(l,c?Cr:xr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Gh(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Va(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Yh);function tc(t,e){t.setLoader((function(i,o,n){Td(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var ec=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ic=function(t){function e(e){return(e=Et({},e)).controls||(e.controls=es()),e.interactions||(e.interactions=ih({onFocusOnly:!0})),t.call(this,e)||this}return ec(e,t),e.prototype.createRenderer=function(){return new nr(this)},e}(Xa),oc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var nc,rc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return oc(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=wr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Sr,this.unlistenImage_(),this.image_=((t=me(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=wr:this.state=Cr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Sr&&(this.state=xr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==xr&&(this.state=kr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ks(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(xh),ac=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=ln(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Eo(o)==Eo(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Eo(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Eo(this.targetProj_.getExtent()):null;var l=zo(i),u=To(i),p=bo(i),d=_o(i),h=this.transformInv_(l),c=this.transformInv_(u),f=this.transformInv_(p),g=this.transformInv_(d),m=10+(r?Math.max(0,Math.ceil(Ge(yo(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,d,h,c,f,g,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Ji([n,r,a,s]),p=this.sourceWorldWidth_?Eo(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,h=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Eo(Ji([t,e,i,o]))/this.targetWorldWidth_>.25||c;!h&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Oo(u,this.maxSourceExtent_)){var f=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!c){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g),v=void 0;if(h)v=(We(n[0],d)+We(a[0],d))/2-We(m[0],d);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,o,n,a,s),0==(14&f)&&this.addTriangle_(t,i,e,n,a,r),f&&(0==(13&f)&&this.addTriangle_(e,o,t,r,s,n),0==(7&f)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;fo(t,n[0]),fo(t,n[1]),fo(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),sc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function lc(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function uc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function pc(t,e,i,o){var n=un(i,e,t),r=en(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||io(l,n)){var u=en(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function dc(t,e,i,o,n,r,a,s,l,u,p,d){var h=me(Math.round(i*t),Math.round(i*e));if(Et(h,d),0===l.length)return h.canvas;function c(t){return Math.round(t*i)/i}h.scale(i,i),h.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){co(f,t.extent)}));var g=Eo(f),m=So(f),v=me(Math.round(i*g/o),Math.round(i*m/o));Et(v,d);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),r=Eo(t.extent),a=So(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=zo(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],g=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var d=new Array(e),h=e-1;h>=0;h--){d[h]=t[h][e]/t[h][h];for(var c=h-1;c>=0;c--)t[c][e]-=t[c][h]*d[h]}return d}([[p-=z,g-=T,0,0,k-b],[m-=z,y-=T,0,0,S-b],[0,0,p,g,w-x],[0,0,m,y,C-x]]);if(E){if(h.save(),h.beginPath(),function(){if(void 0===nc){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 e=t.getImageData(0,0,3,3).data;nc=uc(e,0)||uc(e,4)||uc(e,8)}return nc}()||d===sc){h.moveTo(k,w);for(var O=b-k,P=x-w,j=0;j<4;j++)h.lineTo(k+c((j+1)*O/4),w+c(j*P/3)),3!=j&&h.lineTo(k+c((j+1)*O/4),w+c((j+1)*P/3));h.lineTo(S,C)}else h.moveTo(k,w),h.lineTo(b,x),h.lineTo(S,C);h.clip(),h.transform(E[0],E[2],E[1],E[3],b,x),h.translate(f[0]-z,f[3]-T),h.scale(o/i,-o/i),h.drawImage(v.canvas,0,0),h.restore()}})),p&&(h.save(),h.globalCompositeOperation="source-over",h.strokeStyle="black",h.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;h.beginPath(),h.moveTo(s,l),h.lineTo(n,a),h.lineTo(u,p),h.closePath(),h.stroke()})),h.restore()),h.canvas}var hc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cc=function(t){function e(e,i,o,n,r,a,s,l,u,p,d,h){var c=t.call(this,r,xr)||this;c.renderEdges_=void 0!==d&&d,c.contextOptions_=h,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var f=n.getTileCoordExtent(c.wrappedTileCoord_),g=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=g?Co(f,g):f;if(0===yo(v))return c.state=Cr,c;var y=e.getExtent();y&&(m=m?Co(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=xo(i),r=pc(t,e,n,o);return(!isFinite(r)||r<=0)&&vo(i,(function(i){return r=pc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Cr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new ac(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Cr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=De(k[1],m[1],m[3]),k[3]=De(k[3],m[1],m[3])):k=Co(k,m)),yo(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Cr)}else c.state=Cr;return c}return hc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==wr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Sr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=dc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=wr}this.changed()},e.prototype.load=function(){if(this.state==xr){this.state=kr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==xr||n==kr){t++;var r=Kt(e,Mt,(function(i){var o=e.getState();o!=wr&&o!=Sr&&o!=Cr||(Zt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==xr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Zt),this.sourcesListenerKeys_=null},e}(xh),fc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function gc(t,e){t.getImage().src=e}var mc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:gc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:rc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?sc:void 0,i.renderReprojectionEdges_=!1,i}return fc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!an(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!an(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!an(e,t)){var i=ee(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ah(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||an(e,t))return this.tileCache;var i=ee(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Ph(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?xr:Cr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Mt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!an(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Th(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var d=this.getTileGridForProjection(r),h=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),f=new cc(r,d,n,h,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=p,l?(f.interimTile=l,f.refreshInterimChain(),a.replace(u,f)):a.set(u,f),f}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=zh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==xr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=tn(t);if(i){var o=ee(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(Yh),vc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yc=function(t){function e(e){var i=this,o=e||{},n=Et({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return vc(e,t),e.prototype.getPreload=function(){return this.get(mh)},e.prototype.setPreload=function(t){this.set(mh,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(vh)},e.prototype.setUseInterimTilesOnError=function(t){this.set(vh,t)},e}(ii),_c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bc=function(t){function e(e){return t.call(this,e)||this}return _c(e,t),e.prototype.createRenderer=function(){return new lh(this)},e}(yc),xc={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Suported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector 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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`. 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://<Tileset ID>`."},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://<Tileset ID>`."},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 `{<sourceLayer>: <propertyName>}`."}},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",ios:"10.0.0",android:"10.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:'An 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. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},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",ios:"10.0.0",android:"10.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. SDF images are not supported in formatted text and will be ignored.","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",{"symbol-placement":["point"]}],"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 would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols 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. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"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_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},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. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",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 valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",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<number>`, 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 a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that 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",android:"8.4.0",ios:"5.4.0",macos:"0.15.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`](#types-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`](#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. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. 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:"Returns 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:'Returns 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:"Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",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:"Returns 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:'Returns 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:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns 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:"Returns 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:"Returns 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",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns 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",android:"8.4.0",ios:"5.5.0",macos:"0.15.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"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",android:"7.0.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-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. `queryRenderedFeatures` on heatmap layers will return points within this radius.","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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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",ios:"10.0.0",android:"10.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."}}},kc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function wc(t){var e={exports:{}};return t(e,e.exports),e.exports}function Sc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
36
36
  /*! https://mths.be/punycode v1.3.2 by @mathias */
37
- wc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="object"==typeof kc&&kc;r.global!==r&&r.window!==r&&r.self!==r||(i=r);var a,s,l=2147483647,u=36,p=/^xn--/,d=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function m(t){throw RangeError(c[t])}function v(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function y(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+v((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function b(t){return v(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function k(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=u)t=f(t/35);return f(o+36*t/(t+38))}function w(t){var e,i,o,n,r,a,s,p,d,h,c,g=[],v=t.length,y=0,_=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&m("not-basic"),g.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<v;){for(r=y,a=1,s=u;n>=v&&m("invalid-input"),((p=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:u)>=u||p>f((l-y)/a))&&m("overflow"),y+=p*a,!(p<(d=s<=x?1:s>=x+26?26:s-x));s+=u)a>f(l/(h=u-d))&&m("overflow"),a*=h;x=k(y-r,e=g.length+1,0==r),f(y/e)>l-_&&m("overflow"),_+=f(y/e),y%=e,g.splice(y++,0,_)}return b(g)}function S(t){var e,i,o,n,r,a,s,p,d,h,c,v,y,b,w,S=[];for(v=(t=_(t)).length,e=128,i=0,r=72,a=0;a<v;++a)(c=t[a])<128&&S.push(g(c));for(o=n=S.length,n&&S.push("-");o<v;){for(s=l,a=0;a<v;++a)(c=t[a])>=e&&c<s&&(s=c);for(s-e>f((l-i)/(y=o+1))&&m("overflow"),i+=(s-e)*y,e=s,a=0;a<v;++a)if((c=t[a])<e&&++i>l&&m("overflow"),c==e){for(p=i,d=u;!(p<(h=d<=r?1:d>=r+26?26:d-r));d+=u)w=p-h,b=u-h,S.push(g(x(h+w%b,0))),p=f(w/b);S.push(g(x(p,0))),r=k(i,y,o==n),i=0,++o}++i,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:w,encode:S,toASCII:function(t){return y(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return y(t,(function(t){return p.test(t)?w(t.slice(4).toLowerCase()):t}))}},o&&n)if(t.exports==o)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);else i.punycode=a}(kc)}));var Cc=function(t,e,i,o){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var r=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,p,d,h,c=t[l].replace(r,"%20"),f=c.indexOf(i);f>=0?(u=c.substr(0,f),p=c.substr(f+1)):(u=c,p=""),d=decodeURIComponent(u),h=decodeURIComponent(p),Sc(n,d)?Array.isArray(n[d])?n[d].push(h):n[d]=[n[d],h]:n[d]=h}return n},zc=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Tc=function(t,e,i,o){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(o){var n=encodeURIComponent(zc(o))+i;return Array.isArray(t[o])?t[o].map((function(t){return n+encodeURIComponent(zc(t))})).join(e):n+encodeURIComponent(zc(t[o]))})).join(e):o?encodeURIComponent(zc(o))+i+encodeURIComponent(zc(t)):""};wc((function(t,e){e.decode=e.parse=Cc,e.encode=e.stringify=Tc}));class Ec extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Oc{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,o]of e)this.bindings[i]=o}concat(t){return new Oc(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Pc={kind:"null"},jc={kind:"number"},Rc={kind:"string"},Ic={kind:"boolean"},Fc={kind:"color"},Mc={kind:"object"},Ac={kind:"value"},Dc={kind:"collator"},Lc={kind:"formatted"},Gc={kind:"resolvedImage"};function Nc(t,e){return{kind:"array",itemType:t,N:e}}function Bc(t){if("array"===t.kind){const e=Bc(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const qc=[Pc,jc,Rc,Ic,Fc,Lc,Mc,Nc(Ac),Gc];function Wc(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Wc(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of qc)if(!Wc(t,e))return null}return`Expected ${Bc(t)} but found ${Bc(e)} instead.`}function Vc(t,e){return e.some((e=>e.kind===t.kind))}function Uc(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Xc=wc((function(t,e){var i={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 o(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function r(t){return"%"===t[t.length-1]?o(parseFloat(t)/100*255):o(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var p=n.substr(0,l),d=n.substr(l+1,u-(l+1)).split(","),h=1;switch(p){case"rgba":if(4!==d.length)return null;h=a(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=a(d.pop());case"hsl":if(3!==d.length)return null;var c=(parseFloat(d[0])%360+360)%360/360,f=a(d[1]),g=a(d[2]),m=g<=.5?g*(f+1):g+f-g*f,v=2*g-m;return[o(255*s(v,m,c+1/3)),o(255*s(v,m,c)),o(255*s(v,m,c-1/3)),h];default:return null}}return null}}catch(l){}}));class Kc{constructor(t,e,i,o=1){this.r=t,this.g=e,this.b=i,this.a=o}static parse(t){if(!t)return;if(t instanceof Kc)return t;if("string"!=typeof t)return;const e=Xc.parseCSSColor(t);return e?new Kc(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,o]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${o})`}toArray(){const{r:t,g:e,b:i,a:o}=this;return 0===o?[0,0,0,0]:[255*t/o,255*e/o,255*i/o,o]}}Kc.black=new Kc(0,0,0,1),Kc.white=new Kc(1,1,1,1),Kc.transparent=new Kc(0,0,0,0),Kc.red=new Kc(1,0,0,1),Kc.blue=new Kc(0,0,1,1);class Yc{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Zc{constructor(t,e,i,o,n){this.text=t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n}}class Hc{constructor(t){this.sections=t}static fromString(t){return new Hc([new Zc(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Hc?t:Hc.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class $c{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new $c({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Jc(t,e,i,o){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[t,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`}function Qc(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 Kc)return!0;if(t instanceof Yc)return!0;if(t instanceof Hc)return!0;if(t instanceof $c)return!0;if(Array.isArray(t)){for(const e of t)if(!Qc(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Qc(t[e]))return!1;return!0}return!1}function tf(t){if(null===t)return Pc;if("string"==typeof t)return Rc;if("boolean"==typeof t)return Ic;if("number"==typeof t)return jc;if(t instanceof Kc)return Fc;if(t instanceof Yc)return Dc;if(t instanceof Hc)return Lc;if(t instanceof $c)return Gc;if(Array.isArray(t)){const e=t.length;let i;for(const o of t){const t=tf(o);if(i){if(i===t)continue;i=Ac;break}i=t}return Nc(i||Ac,e)}return Mc}function ef(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Kc||t instanceof Hc||t instanceof $c?t.toString():JSON.stringify(t)}class of{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Qc(t[1]))return e.error("invalid value");const i=t[1];let o=tf(i);const n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new of(o,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Kc?["rgba"].concat(this.value.toArray()):this.value instanceof Hc?this.value.serialize():this.value}}class nf{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const rf={string:Rc,number:jc,boolean:Ic,object:Mc};class af{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,o=1;const n=t[0];if("array"===n){let n,r;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in rf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=rf[i],o++}else n=Ac;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);r=t[2],o++}i=Nc(n,r)}else i=rf[n];const r=[];for(;o<t.length;o++){const i=e.parse(t[o],o,Ac);if(!i)return null;r.push(i)}return new af(i,r)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Wc(this.type,tf(i)))return i;if(e===this.args.length-1)throw new nf(`Expected value to be of type ${Bc(this.type)}, but found ${Bc(tf(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((t=>t.serialize())))}}class sf{constructor(t){this.type=Lc,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const o=[];let n=!1;for(let r=1;r<=t.length-1;++r){const i=t[r];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,jc),!t))return null;let r=null;if(i["text-font"]&&(r=e.parse(i["text-font"],1,Nc(Rc)),!r))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,Fc),!a))return null;const s=o[o.length-1];s.scale=t,s.font=r,s.textColor=a}else{const i=e.parse(t[r],1,Ac);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:i,scale:null,font:null,textColor:null})}}return new sf(o)}evaluate(t){return new Hc(this.sections.map((e=>{const i=e.content.evaluate(t);return tf(i)===Gc?new Zc("",i,null,null,null):new Zc(ef(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class lf{constructor(t){this.type=Gc,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Rc);return i?new lf(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=$c.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const uf={"to-boolean":Ic,"to-color":Fc,"to-number":jc,"to-string":Rc};class pf{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const o=uf[i],n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],r,Ac);if(!i)return null;n.push(i)}return new pf(o,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const o of this.args){if(e=o.evaluate(t),i=null,e instanceof Kc)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Jc(e[0],e[1],e[2],e[3]),!i))return new Kc(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new nf(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const o=Number(e);if(!isNaN(o))return o}throw new nf(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Hc.fromString(ef(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?$c.fromString(ef(this.args[0].evaluate(t))):ef(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new sf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new lf(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const df=["Unknown","Point","LineString","Polygon"];class hf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?df[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:o}=this.featureTileCoord,n=i*e-t[0],r=o*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*r}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Kc.parse(t)),e}}class cf{constructor(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],o=cf.definitions[i];if(!o)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(o)?o[0]:o.type,r=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,a=r.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[l,u]of a){s=new Af(e.registry,e.path,null,e.scope);const o=[];let r=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(l)?l[e-1]:l.type,a=s.parse(i,1+o.length,n);if(!a){r=!0;break}o.push(a)}if(!r)if(Array.isArray(l)&&l.length!==o.length)s.error(`Expected ${l.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=o[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new cf(i,n,u,o)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:r).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(Bc).join(", ")})`:`(${Bc(e.type)}...)`;var e})).join(" | "),o=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+o.length);if(!i)return null;o.push(Bc(i.type))}e.error(`Expected arguments of type ${i}, but found (${o.join(", ")}) instead.`)}return null}static register(t,e){cf.definitions=e;for(const i in e)t[i]=cf}}class ff{constructor(t,e,i){this.type=Dc,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Ic);if(!o)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Ic);if(!n)return null;let r=null;return i.locale&&(r=e.parse(i.locale,1,Rc),!r)?null:new ff(o,n,r)}evaluate(t){return new Yc(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function gf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function mf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function vf(t,e){const i=(180+t[0])/360;const o=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const r=Math.pow(2,e.z);return[Math.round(i*r*8192),Math.round(o*r*8192)]}function yf(t,e,i){const o=t[0]-e[0],n=t[1]-e[1],r=t[0]-i[0],a=t[1]-i[1];return o*a-r*n==0&&o*r<=0&&n*a<=0}function _f(t,e){let i=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(yf(t,s[e],s[e+1]))return!1;o=t,n=s[e],r=s[e+1],n[1]>o[1]!=r[1]>o[1]&&o[0]<(r[0]-n[0])*(o[1]-n[1])/(r[1]-n[1])+n[0]&&(i=!i)}}var o,n,r;return i}function bf(t,e){for(let i=0;i<e.length;i++)if(_f(t,e[i]))return!0;return!1}function xf(t,e,i,o){const n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,d=a*u-l*s;return p>0&&d<0||p<0&&d>0}function kf(t,e,i,o){const n=[e[0]-t[0],e[1]-t[1]],r=[o[0]-i[0],o[1]-i[1]];return 0!=(a=r)[0]*(s=n)[1]-a[1]*s[0]&&!(!xf(t,e,i,o)||!xf(i,o,t,e));var a,s}function wf(t,e,i){for(const o of i)for(let i=0;i<o.length-1;++i)if(kf(t,e,o[i],o[i+1]))return!0;return!1}function Sf(t,e){for(let i=0;i<t.length;++i)if(!_f(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(wf(t[i],t[i+1],e))return!1;return!0}function Cf(t,e){for(let i=0;i<e.length;i++)if(Sf(t,e[i]))return!0;return!1}function zf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=[];for(let o=0;o<t[n].length;o++){const a=vf(t[n][o],i);gf(e,a),r.push(a)}o.push(r)}return o}function Tf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=zf(t[n],e,i);o.push(r)}return o}function Ef(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){const e=.5*o;let n=t[0]-i[0]>e?-o:i[0]-t[0]>e?o:0;0===n&&(n=t[0]-i[2]>e?-o:i[2]-t[0]>e?o:0),t[0]+=n}gf(e,t)}function Of(t,e,i,o){const n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];for(const s of t)for(const t of s){const o=[t.x+r[0],t.y+r[1]];Ef(o,e,i,n),a.push(o)}return a}function Pf(t,e,i,o){const n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];for(const l of t){const t=[];for(const i of l){const o=[i.x+r[0],i.y+r[1]];gf(e,o),t.push(o)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const o of t)Ef(o,e,i,n)}var s;return a}class jf{constructor(t,e){this.type=Ic,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Qc(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new jf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new jf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new jf(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=zf(e.coordinates,o,n),a=Of(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!_f(t,r))return!1}if("MultiPolygon"===e.type){const r=Tf(e.coordinates,o,n),a=Of(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!bf(t,r))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=zf(e.coordinates,o,n),a=Pf(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!Sf(t,r))return!1}if("MultiPolygon"===e.type){const r=Tf(e.coordinates,o,n),a=Pf(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!Cf(t,r))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Rf(t){if(t instanceof cf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof jf)return!1;let e=!0;return t.eachChild((t=>{e&&!Rf(t)&&(e=!1)})),e}function If(t){if(t instanceof cf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!If(t)&&(e=!1)})),e}function Ff(t,e){if(t instanceof cf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Ff(t,e)&&(i=!1)})),i}class Mf{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Mf(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Af{constructor(t,e=[],i,o=new Oc,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=o,this.errors=n,this.expectedType=i}parse(t,e,i,o,n={}){return e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new af(e,[t]):"coerce"===i?new pf(e,[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", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,o=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(t,o))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof of)&&"resolvedImage"!==n.type.kind&&Df(n)){const t=new hf;try{n=new of(n.type,n.evaluate(t))}catch(o){return this.error(o.message),null}}return n}return this.error(`Unknown expression "${n}". 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.`)}concat(t,e,i){const o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Af(this.registry,o,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Ec(i,t))}checkSubtype(t,e){const i=Wc(t,e);return i&&this.error(i),i}}function Df(t){if(t instanceof Mf)return Df(t.boundExpression);if(t instanceof cf&&"error"===t.name)return!1;if(t instanceof ff)return!1;if(t instanceof jf)return!1;const e=t instanceof pf||t instanceof af;let i=!0;return t.eachChild((t=>{i=e?i&&Df(t):i&&t instanceof of})),!!i&&(Rf(t)&&Ff(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Lf(t,e){const i=t.length-1;let o,n,r=0,a=i,s=0;for(;r<=a;)if(s=Math.floor((r+a)/2),o=t[s],n=t[s+1],o<=e){if(s===i||e<n)return s;r=s+1}else{if(!(o>e))throw new nf("Input is not a number.");a=s-1}return 0}class Gf{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[o,n]of i)this.labels.push(o),this.outputs.push(n)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,jc);if(!i)return null;const o=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r<t.length;r+=2){const i=1===r?-1/0:t[r],a=t[r+1],s=r,l=r+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,n);if(!u)return null;n=n||u.type,o.push([i,u])}return new Gf(n,i,o)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);return i[Lf(e,o)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Nf=Bf;function Bf(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function qf(t,e,i){return t*(1-i)+e*i}Bf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Bf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Bf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Bf.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Bf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Wf=Object.freeze({__proto__:null,number:qf,color:function(t,e,i){return new Kc(qf(t.r,e.r,i),qf(t.g,e.g,i),qf(t.b,e.b,i),qf(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,o)=>qf(t,e[o],i)))}});const Vf=4/29,Uf=6/29,Xf=3*Uf*Uf,Kf=Math.PI/180,Yf=180/Math.PI;function Zf(t){return t>.008856451679035631?Math.pow(t,1/3):t/Xf+Vf}function Hf(t){return t>Uf?t*t*t:Xf*(t-Vf)}function $f(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qf(t){const e=Jf(t.r),i=Jf(t.g),o=Jf(t.b),n=Zf((.4124564*e+.3575761*i+.1804375*o)/.95047),r=Zf((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-Zf((.0193339*e+.119192*i+.9503041*o)/1.08883)),alpha:t.a}}function tg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*Hf(e),i=.95047*Hf(i),o=1.08883*Hf(o),new Kc($f(3.2404542*i-1.5371385*e-.4985314*o),$f(-.969266*i+1.8760108*e+.041556*o),$f(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function eg(t,e,i){const o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}const ig={forward:Qf,reverse:tg,interpolate:function(t,e,i){return{l:qf(t.l,e.l,i),a:qf(t.a,e.a,i),b:qf(t.b,e.b,i),alpha:qf(t.alpha,e.alpha,i)}}},og={forward:function(t){const{l:e,a:i,b:o}=Qf(t),n=Math.atan2(o,i)*Yf;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Kf,i=t.c;return tg({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:eg(t.h,e.h,i),c:qf(t.c,e.c,i),l:qf(t.l,e.l,i),alpha:qf(t.alpha,e.alpha,i)}}};class ng{constructor(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(const[r,a]of n)this.labels.push(r),this.outputs.push(a)}static interpolationFactor(t,e,i,o){let n=0;if("exponential"===t.name)n=rg(e,t.base,i,o);else if("linear"===t.name)n=rg(e,1,i,o);else if("cubic-bezier"===t.name){const r=t.controlPoints;n=new Nf(r[0],r[1],r[2],r[3]).solve(rg(e,1,i,o))}return n}static parse(t,e){let[i,o,n,...r]=t;if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const t=o[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:t}}else{if("cubic-bezier"!==o[0])return e.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const t=o.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,jc),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=Fc:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<r.length;l+=2){const t=r[l],i=r[l+1],o=l+3,n=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(a.length&&a[a.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(i,n,s);if(!u)return null;s=s||u.type,a.push([t,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new ng(s,i,o,n,a):e.error(`Type ${Bc(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);const r=Lf(e,o),a=e[r],s=e[r+1],l=ng.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Wf[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?og.reverse(og.interpolate(og.forward(u),og.forward(p),l)):ig.reverse(ig.interpolate(ig.forward(u),ig.forward(p),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function rg(t,e,i,o){const n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}class ag{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const o=e.expectedType;o&&"value"!==o.kind&&(i=o);const n=[];for(const a of t.slice(1)){const t=e.parse(a,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}const r=o&&n.some((t=>Wc(o,t.type)));return new ag(r?Ac:i,n)}evaluate(t){let e,i=null,o=0;for(const n of this.args)if(o++,i=n.evaluate(t),i&&i instanceof $c&&!i.available&&(e||(e=i.name),i=null,o===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class sg{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n<t.length-1;n+=2){const o=t[n];if("string"!=typeof o)return e.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const r=e.parse(t[n+1],n+1);if(!r)return null;i.push([o,r])}const o=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return o?new sg(i,o):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class lg{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jc),o=e.parse(t[2],2,Nc(e.expectedType||Ac));if(!i||!o)return null;const n=o.type;return new lg(n.itemType,i,o)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new nf(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new nf(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new nf(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ug{constructor(t,e){this.type=Ic,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,Ac);return i&&o?Vc(i.type,[Ic,Rc,jc,Pc,Ac])?new ug(i,o):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Uc(e,["boolean","string","number","null"]))throw new nf(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(tf(e))} instead.`);if(!Uc(i,["string","array"]))throw new nf(`Expected second argument to be of type array or string, but found ${Bc(tf(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class pg{constructor(t,e,i){this.type=jc,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,Ac);if(!i||!o)return null;if(!Vc(i.type,[Ic,Rc,jc,Pc,Ac]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,jc);return n?new pg(i,o,n):null}return new pg(i,o)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Uc(e,["boolean","string","number","null"]))throw new nf(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(tf(e))} instead.`);if(!Uc(i,["string","array"]))throw new nf(`Expected second argument to be of type array or string, but found ${Bc(tf(i))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class dg{constructor(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);const n={},r=[];for(let l=2;l<t.length-1;l+=2){let a=t[l];const s=t[l+1];Array.isArray(a)||(a=[a]);const u=e.concat(l);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,tf(t)))return null}else i=tf(t);if(void 0!==n[String(t)])return u.error("Branch labels must be unique.");n[String(t)]=r.length}const p=e.parse(s,l,o);if(!p)return null;o=o||p.type,r.push(p)}const a=e.parse(t[1],1,Ac);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,o);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new dg(i,o,a,n,r,s):null}evaluate(t){const e=this.input.evaluate(t);return(tf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],o={};for(const r of e){const t=o[this.cases[r]];void 0===t?(o[this.cases[r]]=i.length,i.push([this.cases[r],[r]])):i[t][1].push(r)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[r,a]of i)1===a.length?t.push(n(a[0])):t.push(a.map(n)),t.push(this.outputs[r].serialize());return t.push(this.otherwise.serialize()),t}}class hg{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const o=[];for(let r=1;r<t.length-1;r+=2){const n=e.parse(t[r],r,Ic);if(!n)return null;const a=e.parse(t[r+1],r+1,i);if(!a)return null;o.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);return n?new hg(i,o,n):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class cg{constructor(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,jc);if(!i||!o)return null;if(!Vc(i.type,[Nc(Ac),Rc,Ac]))return e.error(`Expected first argument to be of type array or string, but found ${Bc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,jc);return n?new cg(i.type,i,o,n):null}return new cg(i.type,i,o)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Uc(e,["string","array"]))throw new nf(`Expected first argument to be of type array or string, but found ${Bc(tf(e))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function fg(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function gg(t,e,i,o){return 0===o.compare(e,i)}function mg(t,e,i){const o="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Ic,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let r=e.parse(t[1],1,Ac);if(!r)return null;if(!fg(i,r.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Bc(r.type)}'.`);let a=e.parse(t[2],2,Ac);if(!a)return null;if(!fg(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Bc(a.type)}'.`);if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${Bc(r.type)}' and '${Bc(a.type)}'.`);o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new af(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new af(r.type,[a])));let s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,Dc),!s)return null}return new n(r,a,s)}evaluate(n){const r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){const e=tf(r),i=tf(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new nf(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const t=tf(r),i=tf(a);if("string"!==t.kind||"string"!==i.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const vg=mg("==",(function(t,e,i){return e===i}),gg),yg=mg("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!gg(0,e,i,o)})),_g=mg("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),bg=mg(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),xg=mg("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),kg=mg(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0}));class wg{constructor(t,e,i,o,n){this.type=Rc,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,jc);if(!i)return null;const o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");let n=null;if(o.locale&&(n=e.parse(o.locale,1,Rc),!n))return null;let r=null;if(o.currency&&(r=e.parse(o.currency,1,Rc),!r))return null;let a=null;if(o["min-fraction-digits"]&&(a=e.parse(o["min-fraction-digits"],1,jc),!a))return null;let s=null;return o["max-fraction-digits"]&&(s=e.parse(o["max-fraction-digits"],1,jc),!s)?null:new wg(i,n,r,a,s)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Sg{constructor(t){this.type=jc,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${Bc(i.type)} instead.`):new Sg(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new nf(`Expected value to be of type string or array, but found ${Bc(tf(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Cg={"==":vg,"!=":yg,">":bg,"<":_g,">=":kg,"<=":xg,array:af,at:lg,boolean:af,case:hg,coalesce:ag,collator:ff,format:sf,image:lf,in:ug,"index-of":pg,interpolate:ng,"interpolate-hcl":ng,"interpolate-lab":ng,length:Sg,let:sg,literal:of,match:dg,number:af,"number-format":wg,object:af,slice:cg,step:Gf,string:af,"to-boolean":pf,"to-color":pf,"to-number":pf,"to-string":pf,var:Mf,within:jf};function zg(t,[e,i,o,n]){e=e.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);const r=n?n.evaluate(t):1,a=Jc(e,i,o,r);if(a)throw new nf(a);return new Kc(e/255*r,i/255*r,o/255*r,r)}function Tg(t,e){return t in e}function Eg(t,e){const i=e[t];return void 0===i?null:i}function Og(t){return{type:t}}function Pg(t){return{result:"success",value:t}}function jg(t){return{result:"error",value:t}}function Rg(t){return!!t.expression&&t.expression.interpolated}function Ig(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}cf.register(Cg,{error:[{kind:"error"},[Rc],(t,[e])=>{throw new nf(e.evaluate(t))}],typeof:[Rc,[Ac],(t,[e])=>Bc(tf(e.evaluate(t)))],"to-rgba":[Nc(jc,4),[Fc],(t,[e])=>e.evaluate(t).toArray()],rgb:[Fc,[jc,jc,jc],zg],rgba:[Fc,[jc,jc,jc,jc],zg],has:{type:Ic,overloads:[[[Rc],(t,[e])=>Tg(e.evaluate(t),t.properties())],[[Rc,Mc],(t,[e,i])=>Tg(e.evaluate(t),i.evaluate(t))]]},get:{type:Ac,overloads:[[[Rc],(t,[e])=>Eg(e.evaluate(t),t.properties())],[[Rc,Mc],(t,[e,i])=>Eg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Ac,[Rc],(t,[e])=>Eg(e.evaluate(t),t.featureState||{})],properties:[Mc,[],t=>t.properties()],"geometry-type":[Rc,[],t=>t.geometryType()],id:[Ac,[],t=>t.id()],zoom:[jc,[],t=>t.globals.zoom],pitch:[jc,[],t=>t.globals.pitch||0],"distance-from-center":[jc,[],t=>t.distanceFromCenter()],"heatmap-density":[jc,[],t=>t.globals.heatmapDensity||0],"line-progress":[jc,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[jc,[],t=>t.globals.skyRadialProgress||0],accumulated:[Ac,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[jc,Og(jc),(t,e)=>{let i=0;for(const o of e)i+=o.evaluate(t);return i}],"*":[jc,Og(jc),(t,e)=>{let i=1;for(const o of e)i*=o.evaluate(t);return i}],"-":{type:jc,overloads:[[[jc,jc],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[jc],(t,[e])=>-e.evaluate(t)]]},"/":[jc,[jc,jc],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[jc,[jc,jc],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[jc,[],()=>Math.LN2],pi:[jc,[],()=>Math.PI],e:[jc,[],()=>Math.E],"^":[jc,[jc,jc],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[jc,[jc],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))],log2:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[jc,[jc],(t,[e])=>Math.sin(e.evaluate(t))],cos:[jc,[jc],(t,[e])=>Math.cos(e.evaluate(t))],tan:[jc,[jc],(t,[e])=>Math.tan(e.evaluate(t))],asin:[jc,[jc],(t,[e])=>Math.asin(e.evaluate(t))],acos:[jc,[jc],(t,[e])=>Math.acos(e.evaluate(t))],atan:[jc,[jc],(t,[e])=>Math.atan(e.evaluate(t))],min:[jc,Og(jc),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[jc,Og(jc),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[jc,[jc],(t,[e])=>Math.abs(e.evaluate(t))],round:[jc,[jc],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[jc,[jc],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[jc,[jc],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Ic,[Rc,Ac],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Ic,[Ac],(t,[e])=>t.id()===e.value],"filter-type-==":[Ic,[Rc],(t,[e])=>t.geometryType()===e.value],"filter-<":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[Ic,[Ac],(t,[e])=>e.value in t.properties()],"filter-has-id":[Ic,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Ic,[Nc(Rc)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Ic,[Nc(Ac)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Ic,[Rc,Nc(Ac)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Ic,[Rc,Nc(Ac)],(t,[e,i])=>function(t,e,i,o){for(;i<=o;){const n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ic,overloads:[[[Ic,Ic],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Og(Ic),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Ic,overloads:[[[Ic,Ic],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Og(Ic),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Ic,[Ic],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Ic,[Rc],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Rc,[Rc],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Rc,[Rc],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Rc,Og(Ac),(t,e)=>e.map((e=>ef(e.evaluate(t)))).join("")],"resolved-locale":[Rc,[Dc],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Fg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new hf,this._defaultValue=e?"color"===(i=e).type&&Ig(i.default)?new Kc(0,0,0,0):"color"===i.type?Kc.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new nf(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,"undefined"!=typeof console&&console.warn(l.message)),this._defaultValue}}}function Mg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Cg}function Ag(t,e){const i=new Af(Cg,[],e?function(t){const e={color:Fc,string:Rc,number:jc,enum:Rc,boolean:Ic,formatted:Lc,resolvedImage:Gc};if("array"===t.type)return Nc(e[t.value]||Ac,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Pg(new Fg(o,e)):jg(i.errors)}class Dg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!If(e.expression)}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}}class Lg{constructor(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!If(e.expression),this.interpolationType=o}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}interpolationFactor(t,e,i){return this.interpolationType?ng.interpolationFactor(this.interpolationType,t,e,i):0}}function Gg(t,e){if("error"===(t=Ag(t,e)).result)return t;const i=t.value.expression,o=Rf(i);if(!o&&("data-driven"!==(n=e)["property-type"]&&"cross-faded-data-driven"!==n["property-type"]))return jg([new Ec("","data expressions not supported")]);var n;const r=Ff(i,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return jg([new Ec("","zoom expressions not supported")]);const a=Ng(i);if(!a&&!r)return jg([new Ec("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ec)return jg([a]);if(a instanceof ng&&!Rg(e))return jg([new Ec("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Pg(new Dg(o?"constant":"source",t.value));const s=a instanceof ng?a.interpolation:void 0;return Pg(new Lg(o?"camera":"composite",t.value,a.labels,s))}function Ng(t){let e=null;if(t instanceof sg)e=Ng(t.result);else if(t instanceof ag){for(const i of t.args)if(e=Ng(i),e)break}else(t instanceof Gf||t instanceof ng)&&t.input instanceof cf&&"zoom"===t.input.name&&(e=t);return e instanceof Ec||t.eachChild((t=>{const i=Ng(t);i instanceof Ec?e=i:!e&&i?e=new Ec("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ec("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Bg(t){return"object"==typeof t?["literal",t]:t}function qg(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Wg(t,e){const i=Bg((o=t.default,n=e.default,void 0!==o?o:void 0!==n?n:void 0));var o,n;return void 0===i&&"resolvedImage"===e.type?"":i}function Vg(t,e,i){const o=Kg(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){const o=["case"];for(const t of i)o.push(["==",n,t[0]],t[1]);return o.push(Wg(t,e)),o}if("categorical"===o){const o=["match",n];for(const t of i)Xg(o,t[0],t[1],!1);return o.push(Wg(t,e)),o}if("interval"===o){const e=["step",["number",n]];for(const t of i)Xg(e,t[0],t[1],!0);return Ug(e),void 0===t.default?e:["case",["==",["typeof",n],"number"],e,Bg(t.default)]}if("exponential"===o){const e=void 0!==t.base?t.base:1,o=[qg(t),1===e?["linear"]:["exponential",e],["number",n]];for(const t of i)Xg(o,t[0],t[1],!1);return void 0===t.default?o:["case",["==",["typeof",n],"number"],o,Bg(t.default)]}throw new Error(`Unknown property function type ${o}`)}function Ug(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Xg(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function Kg(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Yg(t){const e=["concat"],i=/{([^{}]+)}/g;let o=0;for(let n=i.exec(t);null!==n;n=i.exec(t)){const r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}function Zg(t){if(Array.isArray(t))return t.map(Zg);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Zg(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Hg(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=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(const e of t.slice(1))if(!Hg(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function $g(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Hg(t)||(t=nm(t));const i=t;let o=!0;try{o=function(t){if(!tm(t))return t;let e=Zg(t);return Qg(e),e=Jg(e),e}(i)}catch(u){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const n=xc[`filter_${e}`],r=Ag(o,n);let a=null;if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,i)=>r.value.evaluate(t,e,{},i);let s=null,l=null;if(o!==i){const t=Ag(i,n);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(e,i,o,n,r)=>t.value.evaluate(e,i,{},o,void 0,void 0,n,r),l=!Rf(t.value.expression)}a=a;return{filter:a,dynamicFilter:s||void 0,needGeometry:om(o),needFeature:!!l}}function Jg(t){if(!Array.isArray(t))return t;const e=function(t){if(em.has(t[0]))for(let e=1;e<t.length;e++){if(tm(t[e]))return!0}return t}(t);return!0===e?e:e.map((t=>Jg(t)))}function Qg(t){let e=!1;const i=[];if("case"===t[0]){for(let o=1;o<t.length-1;o+=2)e=e||tm(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||tm(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||tm(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let o=1;o<t.length;o++)Qg(t[o])}function tm(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let i=1;i<t.length;i++){if(tm(t[i]))return!0}return!1}const em=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function im(t,e){return t<e?-1:t>e?1:0}function om(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(om(t[e]))return!0;return!1}function nm(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?rm(t[1],t[2],"=="):"!="===e?lm(rm(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?rm(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(nm))):"all"===e?["all"].concat(t.slice(1).map(nm)):"none"===e?["all"].concat(t.slice(1).map(nm).map(lm)):"in"===e?am(t[1],t.slice(2)):"!in"===e?lm(am(t[1],t.slice(2))):"has"===e?sm(t[1]):"!has"===e?lm(sm(t[1])):"within"!==e||t}function rm(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function am(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(im)]]:["filter-in-small",t,["literal",e]]}}function sm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function lm(t){return["!",t]}var um=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function pm(t,e){const i={};for(const o in t)"ref"!==o&&(i[o]=t[o]);return um.forEach((t=>{t in e&&(i[t]=e[t])})),i}wc((function(t,e){var i=function(){var t=function(t,e,i,o){for(i=i||{},o=t.length;o--;i[t[o]]=e);return i},e=[1,12],i=[1,13],o=[1,9],n=[1,10],r=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],p=[22,24],d={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,o,n,r,a){var s=r.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=r[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=r[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[r[s-2],r[s]];break;case 16:this.$={},this.$[r[s][0]]=r[s][1];break;case 17:this.$=r[s-2],r[s-2][r[s][0]]=r[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[r[s]];break;case 21:this.$=r[s-2],r[s-2].push(r[s])}},table:[{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(p,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(p,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],o=[null],n=[],r=this.table,a="",s=0,l=0,u=2,p=1,d=n.slice.call(arguments,1),h=Object.create(this.lexer),c={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(c.yy[f]=this.yy[f]);h.setInput(t,c.yy),c.yy.lexer=h,c.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var g=h.yylloc;n.push(g);var m=h.options&&h.options.ranges;function v(){var t;return"number"!=typeof(t=h.lex()||p)&&(t=e.symbols_[t]||t),t}"function"==typeof c.yy.parseError?this.parseError=c.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,_,b,x,k,w,S,C,z={};;){if(_=i[i.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null==y&&(y=v()),b=r[_]&&r[_][y]),void 0===b||!b.length||!b[0]){var T="";for(k in C=[],r[_])this.terminals_[k]&&k>u&&C.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(s+1)+":\n"+h.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==p?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:g,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(b[0]){case 1:i.push(y),o.push(h.yytext),n.push(h.yylloc),i.push(b[1]),y=null,l=h.yyleng,a=h.yytext,s=h.yylineno,g=h.yylloc;break;case 2:if(w=this.productions_[b[1]][1],z.$=o[o.length-w],z._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},m&&(z._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),void 0!==(x=this.performAction.apply(z,[a,l,s,c.yy,b[1],o,n].concat(d))))return x;w&&(i=i.slice(0,-1*w*2),o=o.slice(0,-1*w),n=n.slice(0,-1*w)),i.push(this.productions_[b[1]][0]),o.push(z.$),n.push(z._$),S=r[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}},h={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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 e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var o=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 n=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===o.length?this.yylloc.first_column:0)+o[o.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),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(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,o,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(o=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.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,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,o=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[o]))&&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,e,i,o){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.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 c(){this.yy={}}return d.lexer=h,c.prototype=d,d.Parser=c,new c}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const dm=Mg,hm=Gg,cm=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const o=["color"===e.type?"to-color":e.type,i,Bg(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}}(t,e);const o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((t=>!n&&e.tokens&&"string"==typeof t[1]?[t[0],Yg(t[1])]:[t[0],Bg(t[1])])),o?function(t,e,i){const o={},n={},r=[];for(let a=0;a<i.length;a++){const e=i[a],s=e[0].zoom;void 0===o[s]&&(o[s]={zoom:s,type:t.type,property:t.property,default:t.default},n[s]=[],r.push(s)),n[s].push([e[0].value,e[1]])}if("exponential"===Kg({},e)){const i=[qg(t),["linear"],["zoom"]];for(const t of r){Xg(i,t,Vg(o[t],e,n[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of r){Xg(t,i,Vg(o[i],e,n[i]),!0)}return Ug(t),t}}(t,e,i):r?function(t,e,i,o=["zoom"]){const n=Kg(t,e);let r,a=!1;if("interval"===n)r=["step",o],a=!0;else{if("exponential"!==n)throw new Error(`Unknown zoom function type "${n}"`);{const e=void 0!==t.base?t.base:1;r=[qg(t),1===e?["linear"]:["exponential",e],o]}}for(const s of i)Xg(r,s[0],s[1],a);return Ug(r),r}(t,e,i):Vg(t,e,i)},fm=Ig;var gm=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mm=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Dh({extent:Nh(o),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:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,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 gm(e,t),e}(mc),vm=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ym='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',_m=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[ym];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return vm(e,t),e}(mm);const bm=Array.isArray;function xm(t,e){if(1===arguments.length)return e=>xm(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!bm(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const km=new jd({features:[],wrapX:!1}),wm=new fd({source:km,style:new pl({image:new nl({radius:3,fill:new Rs({color:"grey"})})})});function Sm(t,e){return xm(2,t&&t.getSource().getFeaturesInExtent(e).filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})).flatMap((t=>t.flatCoordinates_))).forEach(((t,e)=>{km.addFeature(new os({geometry:new _a(t),i:e}))}))}const Cm={color:"#ff0000",width:3},zm=new Qs(Cm),Tm=new Qs(l(s({},Cm),{lineDash:[2,8]})),Em=new Rs({color:"rgba(255, 0, 0, 0.1)"}),Om=new il({stroke:new Qs({color:"red",width:2}),points:4,radius1:15,radius2:1}),Pm=new nl({radius:6,fill:new Rs({color:"#ff0000"})}),jm=new pl({image:new il({fill:new Rs({color:"#fff"}),stroke:new Qs({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ma){const t=e.getCoordinates()[0];return new xs(t)}}}),Rm=new jd,Im=new fd({source:Rm,style:[new pl({fill:Em,stroke:zm}),jm]});const Fm=new eh({source:km,pixelTolerance:15});
37
+ wc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="object"==typeof kc&&kc;r.global!==r&&r.window!==r&&r.self!==r||(i=r);var a,s,l=2147483647,u=36,p=/^xn--/,d=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function m(t){throw RangeError(c[t])}function v(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function y(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+v((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function b(t){return v(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function k(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=u)t=f(t/35);return f(o+36*t/(t+38))}function w(t){var e,i,o,n,r,a,s,p,d,h,c,g=[],v=t.length,y=0,_=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&m("not-basic"),g.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<v;){for(r=y,a=1,s=u;n>=v&&m("invalid-input"),((p=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:u)>=u||p>f((l-y)/a))&&m("overflow"),y+=p*a,!(p<(d=s<=x?1:s>=x+26?26:s-x));s+=u)a>f(l/(h=u-d))&&m("overflow"),a*=h;x=k(y-r,e=g.length+1,0==r),f(y/e)>l-_&&m("overflow"),_+=f(y/e),y%=e,g.splice(y++,0,_)}return b(g)}function S(t){var e,i,o,n,r,a,s,p,d,h,c,v,y,b,w,S=[];for(v=(t=_(t)).length,e=128,i=0,r=72,a=0;a<v;++a)(c=t[a])<128&&S.push(g(c));for(o=n=S.length,n&&S.push("-");o<v;){for(s=l,a=0;a<v;++a)(c=t[a])>=e&&c<s&&(s=c);for(s-e>f((l-i)/(y=o+1))&&m("overflow"),i+=(s-e)*y,e=s,a=0;a<v;++a)if((c=t[a])<e&&++i>l&&m("overflow"),c==e){for(p=i,d=u;!(p<(h=d<=r?1:d>=r+26?26:d-r));d+=u)w=p-h,b=u-h,S.push(g(x(h+w%b,0))),p=f(w/b);S.push(g(x(p,0))),r=k(i,y,o==n),i=0,++o}++i,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:w,encode:S,toASCII:function(t){return y(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return y(t,(function(t){return p.test(t)?w(t.slice(4).toLowerCase()):t}))}},o&&n)if(t.exports==o)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);else i.punycode=a}(kc)}));var Cc=function(t,e,i,o){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var r=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,p,d,h,c=t[l].replace(r,"%20"),f=c.indexOf(i);f>=0?(u=c.substr(0,f),p=c.substr(f+1)):(u=c,p=""),d=decodeURIComponent(u),h=decodeURIComponent(p),Sc(n,d)?Array.isArray(n[d])?n[d].push(h):n[d]=[n[d],h]:n[d]=h}return n},zc=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Tc=function(t,e,i,o){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(o){var n=encodeURIComponent(zc(o))+i;return Array.isArray(t[o])?t[o].map((function(t){return n+encodeURIComponent(zc(t))})).join(e):n+encodeURIComponent(zc(t[o]))})).join(e):o?encodeURIComponent(zc(o))+i+encodeURIComponent(zc(t)):""};wc((function(t,e){e.decode=e.parse=Cc,e.encode=e.stringify=Tc}));class Ec extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Oc{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,o]of e)this.bindings[i]=o}concat(t){return new Oc(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Pc={kind:"null"},jc={kind:"number"},Rc={kind:"string"},Ic={kind:"boolean"},Fc={kind:"color"},Mc={kind:"object"},Ac={kind:"value"},Dc={kind:"collator"},Lc={kind:"formatted"},Gc={kind:"resolvedImage"};function Nc(t,e){return{kind:"array",itemType:t,N:e}}function Bc(t){if("array"===t.kind){const e=Bc(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const qc=[Pc,jc,Rc,Ic,Fc,Lc,Mc,Nc(Ac),Gc];function Wc(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Wc(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of qc)if(!Wc(t,e))return null}return`Expected ${Bc(t)} but found ${Bc(e)} instead.`}function Vc(t,e){return e.some((e=>e.kind===t.kind))}function Uc(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Xc=wc((function(t,e){var i={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 o(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function r(t){return"%"===t[t.length-1]?o(parseFloat(t)/100*255):o(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var p=n.substr(0,l),d=n.substr(l+1,u-(l+1)).split(","),h=1;switch(p){case"rgba":if(4!==d.length)return null;h=a(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=a(d.pop());case"hsl":if(3!==d.length)return null;var c=(parseFloat(d[0])%360+360)%360/360,f=a(d[1]),g=a(d[2]),m=g<=.5?g*(f+1):g+f-g*f,v=2*g-m;return[o(255*s(v,m,c+1/3)),o(255*s(v,m,c)),o(255*s(v,m,c-1/3)),h];default:return null}}return null}}catch(l){}}));class Kc{constructor(t,e,i,o=1){this.r=t,this.g=e,this.b=i,this.a=o}static parse(t){if(!t)return;if(t instanceof Kc)return t;if("string"!=typeof t)return;const e=Xc.parseCSSColor(t);return e?new Kc(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,o]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${o})`}toArray(){const{r:t,g:e,b:i,a:o}=this;return 0===o?[0,0,0,0]:[255*t/o,255*e/o,255*i/o,o]}}Kc.black=new Kc(0,0,0,1),Kc.white=new Kc(1,1,1,1),Kc.transparent=new Kc(0,0,0,0),Kc.red=new Kc(1,0,0,1),Kc.blue=new Kc(0,0,1,1);class Yc{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Zc{constructor(t,e,i,o,n){this.text=t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n}}class $c{constructor(t){this.sections=t}static fromString(t){return new $c([new Zc(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof $c?t:$c.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Hc{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Hc({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Jc(t,e,i,o){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[t,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`}function Qc(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 Kc)return!0;if(t instanceof Yc)return!0;if(t instanceof $c)return!0;if(t instanceof Hc)return!0;if(Array.isArray(t)){for(const e of t)if(!Qc(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Qc(t[e]))return!1;return!0}return!1}function tf(t){if(null===t)return Pc;if("string"==typeof t)return Rc;if("boolean"==typeof t)return Ic;if("number"==typeof t)return jc;if(t instanceof Kc)return Fc;if(t instanceof Yc)return Dc;if(t instanceof $c)return Lc;if(t instanceof Hc)return Gc;if(Array.isArray(t)){const e=t.length;let i;for(const o of t){const t=tf(o);if(i){if(i===t)continue;i=Ac;break}i=t}return Nc(i||Ac,e)}return Mc}function ef(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Kc||t instanceof $c||t instanceof Hc?t.toString():JSON.stringify(t)}class of{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Qc(t[1]))return e.error("invalid value");const i=t[1];let o=tf(i);const n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new of(o,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Kc?["rgba"].concat(this.value.toArray()):this.value instanceof $c?this.value.serialize():this.value}}class nf{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const rf={string:Rc,number:jc,boolean:Ic,object:Mc};class af{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,o=1;const n=t[0];if("array"===n){let n,r;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in rf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=rf[i],o++}else n=Ac;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);r=t[2],o++}i=Nc(n,r)}else i=rf[n];const r=[];for(;o<t.length;o++){const i=e.parse(t[o],o,Ac);if(!i)return null;r.push(i)}return new af(i,r)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Wc(this.type,tf(i)))return i;if(e===this.args.length-1)throw new nf(`Expected value to be of type ${Bc(this.type)}, but found ${Bc(tf(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((t=>t.serialize())))}}class sf{constructor(t){this.type=Lc,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const o=[];let n=!1;for(let r=1;r<=t.length-1;++r){const i=t[r];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,jc),!t))return null;let r=null;if(i["text-font"]&&(r=e.parse(i["text-font"],1,Nc(Rc)),!r))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,Fc),!a))return null;const s=o[o.length-1];s.scale=t,s.font=r,s.textColor=a}else{const i=e.parse(t[r],1,Ac);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:i,scale:null,font:null,textColor:null})}}return new sf(o)}evaluate(t){return new $c(this.sections.map((e=>{const i=e.content.evaluate(t);return tf(i)===Gc?new Zc("",i,null,null,null):new Zc(ef(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class lf{constructor(t){this.type=Gc,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Rc);return i?new lf(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Hc.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const uf={"to-boolean":Ic,"to-color":Fc,"to-number":jc,"to-string":Rc};class pf{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const o=uf[i],n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],r,Ac);if(!i)return null;n.push(i)}return new pf(o,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const o of this.args){if(e=o.evaluate(t),i=null,e instanceof Kc)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Jc(e[0],e[1],e[2],e[3]),!i))return new Kc(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new nf(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const o=Number(e);if(!isNaN(o))return o}throw new nf(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?$c.fromString(ef(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Hc.fromString(ef(this.args[0].evaluate(t))):ef(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new sf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new lf(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const df=["Unknown","Point","LineString","Polygon"];class hf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?df[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:o}=this.featureTileCoord,n=i*e-t[0],r=o*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*r}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Kc.parse(t)),e}}class cf{constructor(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],o=cf.definitions[i];if(!o)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(o)?o[0]:o.type,r=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,a=r.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[l,u]of a){s=new Af(e.registry,e.path,null,e.scope);const o=[];let r=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(l)?l[e-1]:l.type,a=s.parse(i,1+o.length,n);if(!a){r=!0;break}o.push(a)}if(!r)if(Array.isArray(l)&&l.length!==o.length)s.error(`Expected ${l.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=o[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new cf(i,n,u,o)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:r).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(Bc).join(", ")})`:`(${Bc(e.type)}...)`;var e})).join(" | "),o=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+o.length);if(!i)return null;o.push(Bc(i.type))}e.error(`Expected arguments of type ${i}, but found (${o.join(", ")}) instead.`)}return null}static register(t,e){cf.definitions=e;for(const i in e)t[i]=cf}}class ff{constructor(t,e,i){this.type=Dc,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Ic);if(!o)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Ic);if(!n)return null;let r=null;return i.locale&&(r=e.parse(i.locale,1,Rc),!r)?null:new ff(o,n,r)}evaluate(t){return new Yc(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function gf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function mf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function vf(t,e){const i=(180+t[0])/360;const o=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const r=Math.pow(2,e.z);return[Math.round(i*r*8192),Math.round(o*r*8192)]}function yf(t,e,i){const o=t[0]-e[0],n=t[1]-e[1],r=t[0]-i[0],a=t[1]-i[1];return o*a-r*n==0&&o*r<=0&&n*a<=0}function _f(t,e){let i=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(yf(t,s[e],s[e+1]))return!1;o=t,n=s[e],r=s[e+1],n[1]>o[1]!=r[1]>o[1]&&o[0]<(r[0]-n[0])*(o[1]-n[1])/(r[1]-n[1])+n[0]&&(i=!i)}}var o,n,r;return i}function bf(t,e){for(let i=0;i<e.length;i++)if(_f(t,e[i]))return!0;return!1}function xf(t,e,i,o){const n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,d=a*u-l*s;return p>0&&d<0||p<0&&d>0}function kf(t,e,i,o){const n=[e[0]-t[0],e[1]-t[1]],r=[o[0]-i[0],o[1]-i[1]];return 0!=(a=r)[0]*(s=n)[1]-a[1]*s[0]&&!(!xf(t,e,i,o)||!xf(i,o,t,e));var a,s}function wf(t,e,i){for(const o of i)for(let i=0;i<o.length-1;++i)if(kf(t,e,o[i],o[i+1]))return!0;return!1}function Sf(t,e){for(let i=0;i<t.length;++i)if(!_f(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(wf(t[i],t[i+1],e))return!1;return!0}function Cf(t,e){for(let i=0;i<e.length;i++)if(Sf(t,e[i]))return!0;return!1}function zf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=[];for(let o=0;o<t[n].length;o++){const a=vf(t[n][o],i);gf(e,a),r.push(a)}o.push(r)}return o}function Tf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=zf(t[n],e,i);o.push(r)}return o}function Ef(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){const e=.5*o;let n=t[0]-i[0]>e?-o:i[0]-t[0]>e?o:0;0===n&&(n=t[0]-i[2]>e?-o:i[2]-t[0]>e?o:0),t[0]+=n}gf(e,t)}function Of(t,e,i,o){const n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];for(const s of t)for(const t of s){const o=[t.x+r[0],t.y+r[1]];Ef(o,e,i,n),a.push(o)}return a}function Pf(t,e,i,o){const n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];for(const l of t){const t=[];for(const i of l){const o=[i.x+r[0],i.y+r[1]];gf(e,o),t.push(o)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const o of t)Ef(o,e,i,n)}var s;return a}class jf{constructor(t,e){this.type=Ic,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Qc(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new jf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new jf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new jf(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=zf(e.coordinates,o,n),a=Of(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!_f(t,r))return!1}if("MultiPolygon"===e.type){const r=Tf(e.coordinates,o,n),a=Of(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!bf(t,r))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=zf(e.coordinates,o,n),a=Pf(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!Sf(t,r))return!1}if("MultiPolygon"===e.type){const r=Tf(e.coordinates,o,n),a=Pf(t.geometry(),i,o,n);if(!mf(i,o))return!1;for(const t of a)if(!Cf(t,r))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Rf(t){if(t instanceof cf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof jf)return!1;let e=!0;return t.eachChild((t=>{e&&!Rf(t)&&(e=!1)})),e}function If(t){if(t instanceof cf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!If(t)&&(e=!1)})),e}function Ff(t,e){if(t instanceof cf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Ff(t,e)&&(i=!1)})),i}class Mf{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Mf(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Af{constructor(t,e=[],i,o=new Oc,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=o,this.errors=n,this.expectedType=i}parse(t,e,i,o,n={}){return e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new af(e,[t]):"coerce"===i?new pf(e,[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", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,o=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(t,o))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof of)&&"resolvedImage"!==n.type.kind&&Df(n)){const t=new hf;try{n=new of(n.type,n.evaluate(t))}catch(o){return this.error(o.message),null}}return n}return this.error(`Unknown expression "${n}". 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.`)}concat(t,e,i){const o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Af(this.registry,o,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Ec(i,t))}checkSubtype(t,e){const i=Wc(t,e);return i&&this.error(i),i}}function Df(t){if(t instanceof Mf)return Df(t.boundExpression);if(t instanceof cf&&"error"===t.name)return!1;if(t instanceof ff)return!1;if(t instanceof jf)return!1;const e=t instanceof pf||t instanceof af;let i=!0;return t.eachChild((t=>{i=e?i&&Df(t):i&&t instanceof of})),!!i&&(Rf(t)&&Ff(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Lf(t,e){const i=t.length-1;let o,n,r=0,a=i,s=0;for(;r<=a;)if(s=Math.floor((r+a)/2),o=t[s],n=t[s+1],o<=e){if(s===i||e<n)return s;r=s+1}else{if(!(o>e))throw new nf("Input is not a number.");a=s-1}return 0}class Gf{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[o,n]of i)this.labels.push(o),this.outputs.push(n)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,jc);if(!i)return null;const o=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r<t.length;r+=2){const i=1===r?-1/0:t[r],a=t[r+1],s=r,l=r+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,n);if(!u)return null;n=n||u.type,o.push([i,u])}return new Gf(n,i,o)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);return i[Lf(e,o)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Nf=Bf;function Bf(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function qf(t,e,i){return t*(1-i)+e*i}Bf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Bf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Bf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Bf.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Bf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Wf=Object.freeze({__proto__:null,number:qf,color:function(t,e,i){return new Kc(qf(t.r,e.r,i),qf(t.g,e.g,i),qf(t.b,e.b,i),qf(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,o)=>qf(t,e[o],i)))}});const Vf=4/29,Uf=6/29,Xf=3*Uf*Uf,Kf=Math.PI/180,Yf=180/Math.PI;function Zf(t){return t>.008856451679035631?Math.pow(t,1/3):t/Xf+Vf}function $f(t){return t>Uf?t*t*t:Xf*(t-Vf)}function Hf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qf(t){const e=Jf(t.r),i=Jf(t.g),o=Jf(t.b),n=Zf((.4124564*e+.3575761*i+.1804375*o)/.95047),r=Zf((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-Zf((.0193339*e+.119192*i+.9503041*o)/1.08883)),alpha:t.a}}function tg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*$f(e),i=.95047*$f(i),o=1.08883*$f(o),new Kc(Hf(3.2404542*i-1.5371385*e-.4985314*o),Hf(-.969266*i+1.8760108*e+.041556*o),Hf(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function eg(t,e,i){const o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}const ig={forward:Qf,reverse:tg,interpolate:function(t,e,i){return{l:qf(t.l,e.l,i),a:qf(t.a,e.a,i),b:qf(t.b,e.b,i),alpha:qf(t.alpha,e.alpha,i)}}},og={forward:function(t){const{l:e,a:i,b:o}=Qf(t),n=Math.atan2(o,i)*Yf;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Kf,i=t.c;return tg({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:eg(t.h,e.h,i),c:qf(t.c,e.c,i),l:qf(t.l,e.l,i),alpha:qf(t.alpha,e.alpha,i)}}};class ng{constructor(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(const[r,a]of n)this.labels.push(r),this.outputs.push(a)}static interpolationFactor(t,e,i,o){let n=0;if("exponential"===t.name)n=rg(e,t.base,i,o);else if("linear"===t.name)n=rg(e,1,i,o);else if("cubic-bezier"===t.name){const r=t.controlPoints;n=new Nf(r[0],r[1],r[2],r[3]).solve(rg(e,1,i,o))}return n}static parse(t,e){let[i,o,n,...r]=t;if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const t=o[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:t}}else{if("cubic-bezier"!==o[0])return e.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const t=o.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,jc),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=Fc:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<r.length;l+=2){const t=r[l],i=r[l+1],o=l+3,n=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(a.length&&a[a.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(i,n,s);if(!u)return null;s=s||u.type,a.push([t,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new ng(s,i,o,n,a):e.error(`Type ${Bc(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);const r=Lf(e,o),a=e[r],s=e[r+1],l=ng.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Wf[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?og.reverse(og.interpolate(og.forward(u),og.forward(p),l)):ig.reverse(ig.interpolate(ig.forward(u),ig.forward(p),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function rg(t,e,i,o){const n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}class ag{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const o=e.expectedType;o&&"value"!==o.kind&&(i=o);const n=[];for(const a of t.slice(1)){const t=e.parse(a,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}const r=o&&n.some((t=>Wc(o,t.type)));return new ag(r?Ac:i,n)}evaluate(t){let e,i=null,o=0;for(const n of this.args)if(o++,i=n.evaluate(t),i&&i instanceof Hc&&!i.available&&(e||(e=i.name),i=null,o===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class sg{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n<t.length-1;n+=2){const o=t[n];if("string"!=typeof o)return e.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const r=e.parse(t[n+1],n+1);if(!r)return null;i.push([o,r])}const o=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return o?new sg(i,o):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class lg{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jc),o=e.parse(t[2],2,Nc(e.expectedType||Ac));if(!i||!o)return null;const n=o.type;return new lg(n.itemType,i,o)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new nf(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new nf(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new nf(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ug{constructor(t,e){this.type=Ic,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,Ac);return i&&o?Vc(i.type,[Ic,Rc,jc,Pc,Ac])?new ug(i,o):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Uc(e,["boolean","string","number","null"]))throw new nf(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(tf(e))} instead.`);if(!Uc(i,["string","array"]))throw new nf(`Expected second argument to be of type array or string, but found ${Bc(tf(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class pg{constructor(t,e,i){this.type=jc,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,Ac);if(!i||!o)return null;if(!Vc(i.type,[Ic,Rc,jc,Pc,Ac]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,jc);return n?new pg(i,o,n):null}return new pg(i,o)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Uc(e,["boolean","string","number","null"]))throw new nf(`Expected first argument to be of type boolean, string, number or null, but found ${Bc(tf(e))} instead.`);if(!Uc(i,["string","array"]))throw new nf(`Expected second argument to be of type array or string, but found ${Bc(tf(i))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class dg{constructor(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);const n={},r=[];for(let l=2;l<t.length-1;l+=2){let a=t[l];const s=t[l+1];Array.isArray(a)||(a=[a]);const u=e.concat(l);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,tf(t)))return null}else i=tf(t);if(void 0!==n[String(t)])return u.error("Branch labels must be unique.");n[String(t)]=r.length}const p=e.parse(s,l,o);if(!p)return null;o=o||p.type,r.push(p)}const a=e.parse(t[1],1,Ac);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,o);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new dg(i,o,a,n,r,s):null}evaluate(t){const e=this.input.evaluate(t);return(tf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],o={};for(const r of e){const t=o[this.cases[r]];void 0===t?(o[this.cases[r]]=i.length,i.push([this.cases[r],[r]])):i[t][1].push(r)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[r,a]of i)1===a.length?t.push(n(a[0])):t.push(a.map(n)),t.push(this.outputs[r].serialize());return t.push(this.otherwise.serialize()),t}}class hg{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const o=[];for(let r=1;r<t.length-1;r+=2){const n=e.parse(t[r],r,Ic);if(!n)return null;const a=e.parse(t[r+1],r+1,i);if(!a)return null;o.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);return n?new hg(i,o,n):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class cg{constructor(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ac),o=e.parse(t[2],2,jc);if(!i||!o)return null;if(!Vc(i.type,[Nc(Ac),Rc,Ac]))return e.error(`Expected first argument to be of type array or string, but found ${Bc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,jc);return n?new cg(i.type,i,o,n):null}return new cg(i.type,i,o)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Uc(e,["string","array"]))throw new nf(`Expected first argument to be of type array or string, but found ${Bc(tf(e))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function fg(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function gg(t,e,i,o){return 0===o.compare(e,i)}function mg(t,e,i){const o="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Ic,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let r=e.parse(t[1],1,Ac);if(!r)return null;if(!fg(i,r.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Bc(r.type)}'.`);let a=e.parse(t[2],2,Ac);if(!a)return null;if(!fg(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Bc(a.type)}'.`);if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${Bc(r.type)}' and '${Bc(a.type)}'.`);o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new af(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new af(r.type,[a])));let s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,Dc),!s)return null}return new n(r,a,s)}evaluate(n){const r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){const e=tf(r),i=tf(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new nf(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const t=tf(r),i=tf(a);if("string"!==t.kind||"string"!==i.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const vg=mg("==",(function(t,e,i){return e===i}),gg),yg=mg("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!gg(0,e,i,o)})),_g=mg("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),bg=mg(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),xg=mg("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),kg=mg(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0}));class wg{constructor(t,e,i,o,n){this.type=Rc,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,jc);if(!i)return null;const o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");let n=null;if(o.locale&&(n=e.parse(o.locale,1,Rc),!n))return null;let r=null;if(o.currency&&(r=e.parse(o.currency,1,Rc),!r))return null;let a=null;if(o["min-fraction-digits"]&&(a=e.parse(o["min-fraction-digits"],1,jc),!a))return null;let s=null;return o["max-fraction-digits"]&&(s=e.parse(o["max-fraction-digits"],1,jc),!s)?null:new wg(i,n,r,a,s)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Sg{constructor(t){this.type=jc,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${Bc(i.type)} instead.`):new Sg(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new nf(`Expected value to be of type string or array, but found ${Bc(tf(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Cg={"==":vg,"!=":yg,">":bg,"<":_g,">=":kg,"<=":xg,array:af,at:lg,boolean:af,case:hg,coalesce:ag,collator:ff,format:sf,image:lf,in:ug,"index-of":pg,interpolate:ng,"interpolate-hcl":ng,"interpolate-lab":ng,length:Sg,let:sg,literal:of,match:dg,number:af,"number-format":wg,object:af,slice:cg,step:Gf,string:af,"to-boolean":pf,"to-color":pf,"to-number":pf,"to-string":pf,var:Mf,within:jf};function zg(t,[e,i,o,n]){e=e.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);const r=n?n.evaluate(t):1,a=Jc(e,i,o,r);if(a)throw new nf(a);return new Kc(e/255*r,i/255*r,o/255*r,r)}function Tg(t,e){return t in e}function Eg(t,e){const i=e[t];return void 0===i?null:i}function Og(t){return{type:t}}function Pg(t){return{result:"success",value:t}}function jg(t){return{result:"error",value:t}}function Rg(t){return!!t.expression&&t.expression.interpolated}function Ig(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}cf.register(Cg,{error:[{kind:"error"},[Rc],(t,[e])=>{throw new nf(e.evaluate(t))}],typeof:[Rc,[Ac],(t,[e])=>Bc(tf(e.evaluate(t)))],"to-rgba":[Nc(jc,4),[Fc],(t,[e])=>e.evaluate(t).toArray()],rgb:[Fc,[jc,jc,jc],zg],rgba:[Fc,[jc,jc,jc,jc],zg],has:{type:Ic,overloads:[[[Rc],(t,[e])=>Tg(e.evaluate(t),t.properties())],[[Rc,Mc],(t,[e,i])=>Tg(e.evaluate(t),i.evaluate(t))]]},get:{type:Ac,overloads:[[[Rc],(t,[e])=>Eg(e.evaluate(t),t.properties())],[[Rc,Mc],(t,[e,i])=>Eg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Ac,[Rc],(t,[e])=>Eg(e.evaluate(t),t.featureState||{})],properties:[Mc,[],t=>t.properties()],"geometry-type":[Rc,[],t=>t.geometryType()],id:[Ac,[],t=>t.id()],zoom:[jc,[],t=>t.globals.zoom],pitch:[jc,[],t=>t.globals.pitch||0],"distance-from-center":[jc,[],t=>t.distanceFromCenter()],"heatmap-density":[jc,[],t=>t.globals.heatmapDensity||0],"line-progress":[jc,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[jc,[],t=>t.globals.skyRadialProgress||0],accumulated:[Ac,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[jc,Og(jc),(t,e)=>{let i=0;for(const o of e)i+=o.evaluate(t);return i}],"*":[jc,Og(jc),(t,e)=>{let i=1;for(const o of e)i*=o.evaluate(t);return i}],"-":{type:jc,overloads:[[[jc,jc],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[jc],(t,[e])=>-e.evaluate(t)]]},"/":[jc,[jc,jc],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[jc,[jc,jc],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[jc,[],()=>Math.LN2],pi:[jc,[],()=>Math.PI],e:[jc,[],()=>Math.E],"^":[jc,[jc,jc],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[jc,[jc],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))],log2:[jc,[jc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[jc,[jc],(t,[e])=>Math.sin(e.evaluate(t))],cos:[jc,[jc],(t,[e])=>Math.cos(e.evaluate(t))],tan:[jc,[jc],(t,[e])=>Math.tan(e.evaluate(t))],asin:[jc,[jc],(t,[e])=>Math.asin(e.evaluate(t))],acos:[jc,[jc],(t,[e])=>Math.acos(e.evaluate(t))],atan:[jc,[jc],(t,[e])=>Math.atan(e.evaluate(t))],min:[jc,Og(jc),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[jc,Og(jc),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[jc,[jc],(t,[e])=>Math.abs(e.evaluate(t))],round:[jc,[jc],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[jc,[jc],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[jc,[jc],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Ic,[Rc,Ac],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Ic,[Ac],(t,[e])=>t.id()===e.value],"filter-type-==":[Ic,[Rc],(t,[e])=>t.geometryType()===e.value],"filter-<":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[Ic,[Rc,Ac],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Ic,[Ac],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[Ic,[Ac],(t,[e])=>e.value in t.properties()],"filter-has-id":[Ic,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Ic,[Nc(Rc)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Ic,[Nc(Ac)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Ic,[Rc,Nc(Ac)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Ic,[Rc,Nc(Ac)],(t,[e,i])=>function(t,e,i,o){for(;i<=o;){const n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ic,overloads:[[[Ic,Ic],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Og(Ic),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Ic,overloads:[[[Ic,Ic],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Og(Ic),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Ic,[Ic],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Ic,[Rc],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Rc,[Rc],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Rc,[Rc],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Rc,Og(Ac),(t,e)=>e.map((e=>ef(e.evaluate(t)))).join("")],"resolved-locale":[Rc,[Dc],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Fg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new hf,this._defaultValue=e?"color"===(i=e).type&&Ig(i.default)?new Kc(0,0,0,0):"color"===i.type?Kc.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new nf(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,"undefined"!=typeof console&&console.warn(l.message)),this._defaultValue}}}function Mg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Cg}function Ag(t,e){const i=new Af(Cg,[],e?function(t){const e={color:Fc,string:Rc,number:jc,enum:Rc,boolean:Ic,formatted:Lc,resolvedImage:Gc};if("array"===t.type)return Nc(e[t.value]||Ac,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Pg(new Fg(o,e)):jg(i.errors)}class Dg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!If(e.expression)}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}}class Lg{constructor(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!If(e.expression),this.interpolationType=o}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}interpolationFactor(t,e,i){return this.interpolationType?ng.interpolationFactor(this.interpolationType,t,e,i):0}}function Gg(t,e){if("error"===(t=Ag(t,e)).result)return t;const i=t.value.expression,o=Rf(i);if(!o&&("data-driven"!==(n=e)["property-type"]&&"cross-faded-data-driven"!==n["property-type"]))return jg([new Ec("","data expressions not supported")]);var n;const r=Ff(i,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return jg([new Ec("","zoom expressions not supported")]);const a=Ng(i);if(!a&&!r)return jg([new Ec("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ec)return jg([a]);if(a instanceof ng&&!Rg(e))return jg([new Ec("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Pg(new Dg(o?"constant":"source",t.value));const s=a instanceof ng?a.interpolation:void 0;return Pg(new Lg(o?"camera":"composite",t.value,a.labels,s))}function Ng(t){let e=null;if(t instanceof sg)e=Ng(t.result);else if(t instanceof ag){for(const i of t.args)if(e=Ng(i),e)break}else(t instanceof Gf||t instanceof ng)&&t.input instanceof cf&&"zoom"===t.input.name&&(e=t);return e instanceof Ec||t.eachChild((t=>{const i=Ng(t);i instanceof Ec?e=i:!e&&i?e=new Ec("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ec("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Bg(t){return"object"==typeof t?["literal",t]:t}function qg(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Wg(t,e){const i=Bg((o=t.default,n=e.default,void 0!==o?o:void 0!==n?n:void 0));var o,n;return void 0===i&&"resolvedImage"===e.type?"":i}function Vg(t,e,i){const o=Kg(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){const o=["case"];for(const t of i)o.push(["==",n,t[0]],t[1]);return o.push(Wg(t,e)),o}if("categorical"===o){const o=["match",n];for(const t of i)Xg(o,t[0],t[1],!1);return o.push(Wg(t,e)),o}if("interval"===o){const e=["step",["number",n]];for(const t of i)Xg(e,t[0],t[1],!0);return Ug(e),void 0===t.default?e:["case",["==",["typeof",n],"number"],e,Bg(t.default)]}if("exponential"===o){const e=void 0!==t.base?t.base:1,o=[qg(t),1===e?["linear"]:["exponential",e],["number",n]];for(const t of i)Xg(o,t[0],t[1],!1);return void 0===t.default?o:["case",["==",["typeof",n],"number"],o,Bg(t.default)]}throw new Error(`Unknown property function type ${o}`)}function Ug(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Xg(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function Kg(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Yg(t){const e=["concat"],i=/{([^{}]+)}/g;let o=0;for(let n=i.exec(t);null!==n;n=i.exec(t)){const r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}function Zg(t){if(Array.isArray(t))return t.map(Zg);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Zg(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function $g(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=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(const e of t.slice(1))if(!$g(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Hg(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};$g(t)||(t=nm(t));const i=t;let o=!0;try{o=function(t){if(!tm(t))return t;let e=Zg(t);return Qg(e),e=Jg(e),e}(i)}catch(u){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const n=xc[`filter_${e}`],r=Ag(o,n);let a=null;if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,i)=>r.value.evaluate(t,e,{},i);let s=null,l=null;if(o!==i){const t=Ag(i,n);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(e,i,o,n,r)=>t.value.evaluate(e,i,{},o,void 0,void 0,n,r),l=!Rf(t.value.expression)}a=a;return{filter:a,dynamicFilter:s||void 0,needGeometry:om(o),needFeature:!!l}}function Jg(t){if(!Array.isArray(t))return t;const e=function(t){if(em.has(t[0]))for(let e=1;e<t.length;e++){if(tm(t[e]))return!0}return t}(t);return!0===e?e:e.map((t=>Jg(t)))}function Qg(t){let e=!1;const i=[];if("case"===t[0]){for(let o=1;o<t.length-1;o+=2)e=e||tm(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||tm(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||tm(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let o=1;o<t.length;o++)Qg(t[o])}function tm(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let i=1;i<t.length;i++){if(tm(t[i]))return!0}return!1}const em=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function im(t,e){return t<e?-1:t>e?1:0}function om(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(om(t[e]))return!0;return!1}function nm(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?rm(t[1],t[2],"=="):"!="===e?lm(rm(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?rm(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(nm))):"all"===e?["all"].concat(t.slice(1).map(nm)):"none"===e?["all"].concat(t.slice(1).map(nm).map(lm)):"in"===e?am(t[1],t.slice(2)):"!in"===e?lm(am(t[1],t.slice(2))):"has"===e?sm(t[1]):"!has"===e?lm(sm(t[1])):"within"!==e||t}function rm(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function am(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(im)]]:["filter-in-small",t,["literal",e]]}}function sm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function lm(t){return["!",t]}var um=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function pm(t,e){const i={};for(const o in t)"ref"!==o&&(i[o]=t[o]);return um.forEach((t=>{t in e&&(i[t]=e[t])})),i}wc((function(t,e){var i=function(){var t=function(t,e,i,o){for(i=i||{},o=t.length;o--;i[t[o]]=e);return i},e=[1,12],i=[1,13],o=[1,9],n=[1,10],r=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],p=[22,24],d={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,o,n,r,a){var s=r.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=r[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=r[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[r[s-2],r[s]];break;case 16:this.$={},this.$[r[s][0]]=r[s][1];break;case 17:this.$=r[s-2],r[s-2][r[s][0]]=r[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[r[s]];break;case 21:this.$=r[s-2],r[s-2].push(r[s])}},table:[{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(p,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(p,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],o=[null],n=[],r=this.table,a="",s=0,l=0,u=2,p=1,d=n.slice.call(arguments,1),h=Object.create(this.lexer),c={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(c.yy[f]=this.yy[f]);h.setInput(t,c.yy),c.yy.lexer=h,c.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var g=h.yylloc;n.push(g);var m=h.options&&h.options.ranges;function v(){var t;return"number"!=typeof(t=h.lex()||p)&&(t=e.symbols_[t]||t),t}"function"==typeof c.yy.parseError?this.parseError=c.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,_,b,x,k,w,S,C,z={};;){if(_=i[i.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null==y&&(y=v()),b=r[_]&&r[_][y]),void 0===b||!b.length||!b[0]){var T="";for(k in C=[],r[_])this.terminals_[k]&&k>u&&C.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(s+1)+":\n"+h.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==p?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:g,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(b[0]){case 1:i.push(y),o.push(h.yytext),n.push(h.yylloc),i.push(b[1]),y=null,l=h.yyleng,a=h.yytext,s=h.yylineno,g=h.yylloc;break;case 2:if(w=this.productions_[b[1]][1],z.$=o[o.length-w],z._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},m&&(z._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),void 0!==(x=this.performAction.apply(z,[a,l,s,c.yy,b[1],o,n].concat(d))))return x;w&&(i=i.slice(0,-1*w*2),o=o.slice(0,-1*w),n=n.slice(0,-1*w)),i.push(this.productions_[b[1]][0]),o.push(z.$),n.push(z._$),S=r[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}},h={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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 e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var o=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 n=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===o.length?this.yylloc.first_column:0)+o[o.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),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(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,o,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(o=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.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,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,o=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[o]))&&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,e,i,o){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.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 c(){this.yy={}}return d.lexer=h,c.prototype=d,d.Parser=c,new c}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const dm=Mg,hm=Gg,cm=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const o=["color"===e.type?"to-color":e.type,i,Bg(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}}(t,e);const o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((t=>!n&&e.tokens&&"string"==typeof t[1]?[t[0],Yg(t[1])]:[t[0],Bg(t[1])])),o?function(t,e,i){const o={},n={},r=[];for(let a=0;a<i.length;a++){const e=i[a],s=e[0].zoom;void 0===o[s]&&(o[s]={zoom:s,type:t.type,property:t.property,default:t.default},n[s]=[],r.push(s)),n[s].push([e[0].value,e[1]])}if("exponential"===Kg({},e)){const i=[qg(t),["linear"],["zoom"]];for(const t of r){Xg(i,t,Vg(o[t],e,n[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of r){Xg(t,i,Vg(o[i],e,n[i]),!0)}return Ug(t),t}}(t,e,i):r?function(t,e,i,o=["zoom"]){const n=Kg(t,e);let r,a=!1;if("interval"===n)r=["step",o],a=!0;else{if("exponential"!==n)throw new Error(`Unknown zoom function type "${n}"`);{const e=void 0!==t.base?t.base:1;r=[qg(t),1===e?["linear"]:["exponential",e],o]}}for(const s of i)Xg(r,s[0],s[1],a);return Ug(r),r}(t,e,i):Vg(t,e,i)},fm=Ig;var gm=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mm=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Dh({extent:Nh(o),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:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,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 gm(e,t),e}(mc),vm=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ym='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',_m=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[ym];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return vm(e,t),e}(mm);const bm=Array.isArray;function xm(t,e){if(1===arguments.length)return e=>xm(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!bm(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const km=new jd({features:[],wrapX:!1}),wm=new fd({source:km,style:new pl({image:new nl({radius:3,fill:new Rs({color:"grey"})})})});function Sm(t,e){return xm(2,t&&t.getSource().getFeaturesInExtent(e).filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})).flatMap((t=>t.flatCoordinates_))).forEach(((t,e)=>{km.addFeature(new os({geometry:new _a(t),i:e}))}))}const Cm={color:"#ff0000",width:3},zm=new Qs(Cm),Tm=new Qs(l(s({},Cm),{lineDash:[2,8]})),Em=new Rs({color:"rgba(255, 0, 0, 0.1)"}),Om=new il({stroke:new Qs({color:"red",width:2}),points:4,radius1:15,radius2:1}),Pm=new nl({radius:6,fill:new Rs({color:"#ff0000"})}),jm=new pl({image:new il({fill:new Rs({color:"#fff"}),stroke:new Qs({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ma){const t=e.getCoordinates()[0];return new xs(t)}}}),Rm=new jd,Im=new fd({source:Rm,style:[new pl({fill:Em,stroke:zm}),jm]});const Fm=new eh({source:km,pixelTolerance:15});
38
38
  /**
39
39
  * splaytree v3.1.0
40
40
  * Fast Splay tree for Node and browser
@@ -43,7 +43,7 @@ wc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="ob
43
43
  * @license MIT
44
44
  * @preserve
45
45
  */
46
- var Mm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Am(t,e){return t>e?1:t<e?-1:0}function Dm(t,e,i){for(var o=new Mm(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Lm(t,e,i,o){var n=new Mm(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Dm(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function Gm(t,e,i){var o=null,n=null;if(e){var r=i((e=Dm(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function Nm(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&Nm(t.left,r,!1,o,n),t.right&&Nm(t.right,r,!0,o,n)}}var Bm=function(){function t(t){void 0===t&&(t=Am),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Lm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Mm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Dm(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Dm(t,e,i)).key)?(null===e.left?o=e.right:(o=Dm(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Dm(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Dm(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Mm(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&Vm(t,e,0,o-1,n),null===this._root)this._root=qm(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Mm(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Mm(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Mm(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=Wm({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Nm(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=Gm(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Lm(e,i,a,o):r=Lm(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Dm(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return Gm(t,this._root,this._comparator)},t}();function qm(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Mm(a,s);return l.left=qm(t,e,i,r),l.right=qm(t,e,r+1,o),l}return null}function Wm(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=Wm(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=Wm(t,n+1,i),a}return null}function Vm(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}Vm(t,e,i,s,n),Vm(t,e,s+1,o,n)}}function Um(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xm(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Km(t,e,i){return e&&Xm(t.prototype,e),i&&Xm(t,i),t}var Ym=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Zm=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},Hm=Number.EPSILON;void 0===Hm&&(Hm=Math.pow(2,-52));var $m=Hm*Hm,Jm=function(t,e){if(-Hm<t&&t<Hm&&-Hm<e&&e<Hm)return 0;var i=t-e;return i*i<$m*t*e?0:t<e?-1:1},Qm=function(){function t(){Um(this,t),this.reset()}return Km(t,[{key:"reset",value:function(){this.xRounder=new tv,this.yRounder=new tv}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),tv=function(){function t(){Um(this,t),this.tree=new Bm,this.round(0)}return Km(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===Jm(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===Jm(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),ev=new Qm,iv=function(t,e){return t.x*e.y-t.y*e.x},ov=function(t,e){return t.x*e.x+t.y*e.y},nv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=iv(o,n);return Jm(r,0)},rv=function(t){return Math.sqrt(ov(t,t))},av=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return ov(n,o)/rv(n)/rv(o)},sv=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},lv=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},uv=function(){function t(e,i){Um(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return Km(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:dv.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),Km(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},iv(l,s)/rv(l)/rv(s)),cosine:av(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),pv=0,dv=function(){function t(e,i,o,n){Um(this,t),this.id=++pv,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return Km(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var d=e.comparePoint(t.rightSE.point);return 0!==d?d:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var h=e.comparePoint(t.leftSE.point);if(0!==h)return h;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(n>r){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),Km(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=Zm(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=Ym(e,a)&&0===this.comparePoint(a),u=Ym(i,n)&&0===t.comparePoint(n),p=Ym(e,s)&&0===this.comparePoint(s),d=Ym(i,r)&&0===t.comparePoint(r);if(u&&l)return d&&!p?r:!d&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return d&&r.x===a.x&&r.y===a.y?null:a;if(d&&p)return null;if(d)return r;if(p)return s;var h=function(t,e,i,o){if(0===e.x)return lv(i,o,t.x);if(0===o.x)return lv(t,e,i.x);if(0===e.y)return sv(i,o,t.y);if(0===o.y)return sv(t,e,i.y);var n=iv(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=iv(r,e)/n,s=iv(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===h?null:Ym(o,h)?ev.round(h.x,h.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new uv(e,!0),r=new uv(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return uv.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),uv.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],d=i.rings.indexOf(u);-1===d?(i.rings.push(u),i.windings.push(p)):i.windings[d]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],d=0,h=e.length;d<h;d++)if(0!==i[d]){var c=e[d],f=c.poly;if(-1===p.indexOf(f))if(c.isExterior)u.push(f);else{-1===p.indexOf(f)&&p.push(f);var g=u.indexOf(c.poly);-1!==g&&u.splice(g,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(xv.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===xv.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(xv.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=uv.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new uv(n,!0),new uv(r,!1),[o],[a])}}]),t}(),hv=function(){function t(e,i,o){if(Um(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=ev.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=ev.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(dv.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(dv.fromRing(r,n,this))}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),cv=function(){function t(e,i){if(Um(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new hv(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new hv(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),fv=function(){function t(e,i){if(Um(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new cv(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),gv=function(){function t(e){Um(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return Km(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,d=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var h=s.getAvailableLinkedEvents();if(0===h.length){var c=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===h.length){l=h[0].otherSE;break}for(var g=null,m=0,v=d.length;m<v;m++)if(d[m].point===s.point){g=m;break}if(null===g){d.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=h.sort(y)[0].otherSE;break}var _=d.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),Km(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==nv(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===nv(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,d=[],h=u;h!=p;h+=l)d.push([e[h].x,e[h].y]);return d}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];uv.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),mv=function(){function t(e){Um(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Km(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),vv=function(){function t(e){Um(this,t),this.rings=e,this.polys=this._composePolys(e)}return Km(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new mv(n));else{var r=n.enclosingRing();r.poly||e.push(new mv(r)),r.poly.addInterior(n)}}return e}}]),t}(),yv=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dv.compare;Um(this,t),this.queue=e,this.tree=new Bm(i),this.segments=[]}return Km(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),d=0,h=p.length;d<h;d++)i.push(p[d])}var c=null;if(s){var f=s.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f)))for(var g=this._splitSafely(s,f),m=0,v=g.length;m<v;m++)i.push(g[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=uv.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),T=0,E=z.length;T<E;T++)i.push(z[T])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),_v="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,bv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,xv=new(function(){function t(){Um(this,t)}return Km(t,[{key:"run",value:function(t,e,i){xv.type=t,ev.reset();for(var o=[new fv(e,!0)],n=0,r=i.length;n<r;n++)o.push(new fv(i[n],!1));if(xv.numMultiPolys=o.length,"difference"===xv.type)for(var a=o[0],s=1;s<o.length;)null!==Zm(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===xv.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],d=l+1,h=o.length;d<h;d++)if(null===Zm(p.bbox,o[d].bbox))return[];for(var c=new Bm(uv.compare),f=0,g=o.length;f<g;f++)for(var m=o[f].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>_v)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new yv(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>_v)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>bv)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var T=S[C];void 0===T.consumedBy&&c.insert(T)}b=c.size,x=c.pop()}ev.reset();var E=gv.factory(_.segments);return new vv(E).getGeom()}}]),t}()),kv=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return xv.run("union",t,i)};function wv(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Sv(t){return"Feature"===t.type?t.geometry:t}function Cv(t,e,i){void 0===i&&(i={});var o=Sv(t),n=Sv(e),r=kv(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return wv({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),wv({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function zv(t,e){const i=Wo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Tv(t,e,i){const o=e.getExtent();return t.getView().fit(Qi(o,i))}function Ev(t,e){const[i,o,n]=Array.from(In(t));return On([i,o,n,e])}const Ov=new jd,Pv=new jd;function jv(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=un(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=We(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new js,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ov.getFeatureById(e);i?Ov.removeFeature(i):(t.setId(e),Ov.addFeature(t))})):(Ov.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ov.addFeature(t)}))),Pv.clear(),Pv.addFeature(n.readFeature(Ov.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Cv(t,i):i}),null)))})).catch((t=>console.log(t)))}var Rv={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},Iv=/(italic|oblique)$/i,Fv={},Mv=function(t,e,i){var o=Fv[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var d in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):Iv.test(p)&&(p=p.replace(Iv,""),r=u[u.length-1].replace(p,"")),Rv){var h=u.length>1?u[u.length-2].toLowerCase():"";if(p==d||p==d.replace("-","")||h+"-"+p==d){n=Rv[d],u.pop(),h&&d.startsWith(h)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(" ")&&(c='"'+c+'"'),a.push(c)}o=Fv[t]=[r,n,a]}return o[0]+" "+o[1]+" "+e+"px"+(i?"/"+i:"")+" "+o[2]};function Av(t){return t*Math.PI/180}var Dv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Lv(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Gv,Nv=Array(256).join(" ");function Bv(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=Nv.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function qv(){return Gv||(Gv=Lv(1,1).getContext("2d")),Gv}function Wv(t,e){return qv().measureText(t).width+(t.length-1)*e}var Vv={};function Uv(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(Uv(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=Vv[l];if(!u){var p=t.split(" ");if(p.length>1){var d=qv();d.font=e;var h=d.measureText("M").width*i,c="";for(r=[],a=0,s=p.length;a<s;++a){var f=p[a],g=c+(c?" ":"")+f;Wv(g,o)<=h?c=g:(c&&r.push(c),c=f)}c&&r.push(c);for(a=0,s=r.length;a<s&&s>1;++a){var m=r[a];if(Wv(m,o)<.35*h){var v=a>0?Wv(r[a-1],o):1/0,y=a<s-1?Wv(r[a+1],o):1/0;r.splice(a,1),s-=1,v<y?(r[a-1]+=" "+m,a-=1):r[a]=m+" "+r[a]}}for(a=0,s=r.length-1;a<s;++a){var _=r[a],b=r[a+1];if(Wv(_,o)>.7*h&&Wv(b,o)<.6*h){var x=_.split(" "),k=x.pop();Wv(k,o)<.2*h&&(r[a]=x.join(" "),r[a+1]=k+" "+b),s-=1}}u=r.join("\n")}else u=t;u=Bv(u,o),Vv[l]=u}return u}Xn&&Kt(Xn,Dt,(function(){Vv={}}));var Xv,Kv,Yv=fm,Zv=cm,Hv=dm,$v=hm,Jv={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Qv={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]},ty={},ey={zoom:0};function iy(t,e,i,o,n,r){var a=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[a]||(r[a]={});var s=r[a];if(!s[i]){var l=(t[e]||ty)[i],u=xc["".concat(e,"_").concat(t.type)][i];void 0===l&&(l=u.default);var p=Hv(l);if(!p&&Yv(l)&&(l=Zv(l,u),p=!0),p){var d=function(t,e){var i=$v(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(l,u);s[i]=d.evaluate.bind(d)}else"color"==u.type&&(l=Kc.parse(l)),s[i]=function(){return l}}return ey.zoom=o,s[i](ey,n)}function oy(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var ny=/^([^]*)\{(.*)\}([^]*)$/;function ry(t,e){var i;do{if(i=t.match(ny)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function ay(t,e,i,o,n,r,a){if(void 0===o&&(o=Dv),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var d,h=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=pm(t[i],e[t[i].ref]));return t}(e.layers),c={},f=[],g={},m={},v={},y={},_=0,b=h.length;_<b;++_){var x=h[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(!d){d=x.source;var S=e.sources[d];if(!S)throw new Error('Source "'.concat(d,'" is not defined'));var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'.concat(d,'" is not of type "vector" or "geojson", but "').concat(C,'"'))}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),f.push(k)}}var T=new Qs,E=new Rs,O=[],P=function(t,e){var i=t.getProperties(),r=c[i.layer];if(r){var u=o.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(e,o));for(var p=Jv[t.getGeometry().getType()],d={properties:i,type:p},h=-1,f=function(o,c){var f=r[o],_=f.layer,b=_.id,x=_.layout||ty,k=_.paint||ty;if("none"===x.visibility||"minzoom"in _&&u<_.minzoom||"maxzoom"in _&&u>=_.maxzoom)return"continue";var w=_.filter;if(!w||function(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=$g(e).filter),ey.zoom=o,n[t](ey,i)}(b,w,d,u,y)){var S=void 0,C=void 0,z=void 0,P=void 0,j=void 0,R=void 0,I=f.index;if(3==p&&("fill"==_.type||"fill-extrusion"==_.type))if(C=iy(_,"paint",_.type+"-opacity",u,d,v),_.type+"-pattern"in k){var F=iy(_,"paint",_.type+"-pattern",u,d,v);if(F){var M="string"==typeof F?ry(F,i):F.toString();if(s&&n&&n[M]){++h,(R=O[h])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new pl({fill:new Rs}),O[h]=R),z=R.getFill(),R.setZIndex(I);var A=m[ct=M+"."+C];if(!A){var D=n[M],L=Lv(D.width,D.height),G=L.getContext("2d");G.globalAlpha=C,G.drawImage(s,D.x,D.y,D.width,D.height,0,0,D.width,D.height),A=G.createPattern(L,"repeat"),m[ct]=A}z.setColor(A)}}}else S=oy(iy(_,"paint",_.type+"-color",u,d,v),C),_.type+"-outline-color"in k&&(j=oy(iy(_,"paint",_.type+"-outline-color",u,d,v),C)),j||(j=S),(S||j)&&(++h,(!(R=O[h])||S&&!R.getFill()||!S&&R.getFill()||j&&!R.getStroke()||!j&&R.getStroke()||R.getText())&&(R=new pl({fill:S?new Rs:void 0,stroke:j?new Qs:void 0}),O[h]=R),S&&(z=R.getFill()).setColor(S),j&&((P=R.getStroke()).setColor(j),P.setWidth(.5)),R.setZIndex(I));if(1!=p&&"line"==_.type){S=!("line-pattern"in k)&&"line-color"in k?oy(iy(_,"paint","line-color",u,d,v),iy(_,"paint","line-opacity",u,d,v)):void 0;var N=iy(_,"paint","line-width",u,d,v);S&&N>0&&(++h,(R=O[h])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new pl({stroke:new Qs}),O[h]=R),(P=R.getStroke()).setLineCap(iy(_,"layout","line-cap",u,d,v)),P.setLineJoin(iy(_,"layout","line-join",u,d,v)),P.setMiterLimit(iy(_,"layout","line-miter-limit",u,d,v)),P.setColor(S),P.setWidth(N),P.setLineDash(k["line-dasharray"]?iy(_,"paint","line-dasharray",u,d,v).map((function(t){return t*N})):null),R.setZIndex(I))}var B=!1,q=null,W=0,V=void 0,U=void 0,X=void 0;if((1==p||2==p)&&"icon-image"in x){var K=iy(_,"layout","icon-image",u,d,v);if(K){V="string"==typeof K?ry(K,i):K.toString();var Y=void 0;if(s&&n&&n[V]){var Z=iy(_,"layout","icon-rotation-alignment",u,d,v);if(2==p){var H=t.getGeometry();if(H.getFlatMidpoint||H.getFlatMidpoints){var $=H.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/e,2),Math.pow(($[3]-$[1])/e,2)))>150){var J="MultiLineString"===H.getType()?H.getFlatMidpoints():H.getFlatMidpoint();if(Kv||(Kv=new Dl("Point",Xv=[NaN,NaN],[],{},null)),Y=Kv,Xv[0]=J[0],Xv[1]=J[1],"line"===(jt=iy(_,"layout","symbol-placement",u,d,v))&&"map"===Z)for(var Q=H.getStride(),tt=H.getFlatCoordinates(),et=0,it=tt.length-Q;et<it;et+=Q){var ot=tt[et],nt=tt[et+1],rt=tt[et+Q],at=tt[et+Q+1],st=Math.min(ot,rt),lt=Math.min(nt,at),ut=Math.max(ot,rt),pt=Math.max(nt,at);if(J[0]>=st&&J[0]<=ut&&J[1]>=lt&&J[1]<=pt){W=Math.atan2(nt-at,rt-ot);break}}}}}if(2!==p||Y){var dt=iy(_,"layout","icon-size",u,d,v),ht=void 0!==k["icon-color"]?iy(_,"paint","icon-color",u,d,v):null;if(!ht||0!==ht.a){var ct=V+"."+dt;if(null!==ht&&(ct+="."+ht),!(U=g[ct])){var ft=n[V];U=new Js({color:ht?[255*ht.r,255*ht.g,255*ht.b,ht.a]:void 0,img:s,imgSize:l,size:[ft.width,ft.height],offset:[ft.x,ft.y],rotateWithView:"map"===Z,scale:dt/ft.pixelRatio,displacement:"icon-offset"in x?iy(_,"layout","icon-offset",u,d,v).map((function(t){return-t*ft.pixelRatio})):void 0}),g[ct]=U}}U&&(++h,(R=O[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R),R.setGeometry(Y),U.setRotation(W+Av(iy(_,"layout","icon-rotate",u,d,v))),U.setOpacity(iy(_,"paint","icon-opacity",u,d,v)),U.setAnchor(Qv[iy(_,"layout","icon-anchor",u,d,v)]),R.setImage(U),q=R.getText(),R.setText(void 0),R.setZIndex(I),B=!0,X=!1)}else X=!0}}}if(1==p&&"circle"===_.type){++h,(R=O[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R);var gt="circle-radius"in k?iy(_,"paint","circle-radius",u,d,v):5,mt=oy(iy(_,"paint","circle-stroke-color",u,d,v),iy(_,"paint","circle-stroke-opacity",u,d,v)),vt=oy(iy(_,"paint","circle-color",u,d,v),iy(_,"paint","circle-opacity",u,d,v)),yt=iy(_,"paint","circle-stroke-width",u,d,v),_t=gt+"."+mt+"."+vt+"."+yt;(U=g[_t])||(U=new nl({radius:gt,stroke:mt&&yt>0?new Qs({width:yt,color:mt}):void 0,fill:vt?new Rs({color:vt}):void 0}),g[_t]=U),R.setImage(U),q=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),B=!0}var bt,xt,kt,wt,St=void 0,Ct=void 0;if("text-field"in x){xt=Math.round(iy(_,"layout","text-size",u,d,v));var zt=iy(_,"layout","text-font",u,d,v);bt=iy(_,"layout","text-line-height",u,d,v),Ct=Mv(a?a(zt):zt,xt,bt),kt=iy(_,"layout","text-letter-spacing",u,d,v),wt=iy(_,"layout","text-max-width",u,d,v);var Tt=iy(_,"layout","text-field",u,d,v);St="object"==typeof Tt&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):zt,n=Mv(a?a(o):o,xt*(e.scale||1),bt),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=p){for(var s=0,l=(r=Uv(r,n,wt,kt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(Bv(r,kt),n)}),[]):ry(Tt,i).trim(),C=iy(_,"paint","text-opacity",u,d,v)}if(St&&C&&!X){B||(++h,(R=O[h])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(q||new cl({padding:[2,2,2,2]})),q=R.getText();var Et=x["text-transform"];"uppercase"==Et?St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toUpperCase()})):St.toUpperCase():"lowercase"==Et&&(St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toLowerCase()})):St.toLowerCase());var Ot=Array.isArray(St)?St:2==p?Bv(St,kt):Uv(St,Ct,wt,kt);q.setText(Ot),q.setFont(Ct),q.setRotation(Av(iy(_,"layout","text-rotate",u,d,v)));var Pt=iy(_,"layout","text-anchor",u,d,v),jt=B||1==p?"point":iy(_,"layout","symbol-placement",u,d,v);q.setPlacement(jt),q.setOverflow("point"===jt);var Rt=iy(_,"paint","text-halo-width",u,d,v),It=iy(_,"layout","text-offset",u,d,v),Ft=iy(_,"paint","text-translate",u,d,v),Mt=0,At=0;if("point"==jt){var Dt="center";-1!==Pt.indexOf("left")?(Dt="left",At=Rt):-1!==Pt.indexOf("right")&&(Dt="right",At=-Rt),q.setTextAlign(Dt);var Lt=iy(_,"layout","text-rotation-alignment",u,d,v);q.setRotateWithView("map"==Lt)}else q.setMaxAngle(Av(iy(_,"layout","text-max-angle",u,d,v))*St.length/Ot.length),q.setTextAlign(),q.setRotateWithView(!1);var Gt="middle";0==Pt.indexOf("bottom")?(Gt="bottom",Mt=-Rt-.5*(bt-1)*xt):0==Pt.indexOf("top")&&(Gt="top",Mt=Rt+.5*(bt-1)*xt),q.setTextBaseline(Gt),q.setOffsetX(It[0]*xt+At+Ft[0]),q.setOffsetY(It[1]*xt+Mt+Ft[1]),E.setColor(oy(iy(_,"paint","text-color",u,d,v),C)),q.setFill(E);var Nt=oy(iy(_,"paint","text-halo-color",u,d,v),C);if(Nt){T.setColor(Nt),Rt*=2;var Bt=.5*xt;T.setWidth(Rt<=Bt?Rt:Bt),q.setStroke(T)}else q.setStroke(void 0);var qt=iy(_,"layout","text-padding",u,d,v),Wt=q.getPadding();qt!==Wt[0]&&(Wt[0]=qt,Wt[1]=qt,Wt[2]=qt,Wt[3]=qt),R.setZIndex(I)}}},_=0,b=r.length;_<b;++_)f(_);return h>-1?(O.length=h+1,O):void 0}};return t.setStyle(P),t.set("mapbox-source",d),t.set("mapbox-layers",f),P}g`.ol-box {
46
+ var Mm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Am(t,e){return t>e?1:t<e?-1:0}function Dm(t,e,i){for(var o=new Mm(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Lm(t,e,i,o){var n=new Mm(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Dm(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function Gm(t,e,i){var o=null,n=null;if(e){var r=i((e=Dm(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function Nm(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&Nm(t.left,r,!1,o,n),t.right&&Nm(t.right,r,!0,o,n)}}var Bm=function(){function t(t){void 0===t&&(t=Am),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Lm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Mm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Dm(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Dm(t,e,i)).key)?(null===e.left?o=e.right:(o=Dm(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Dm(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Dm(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Mm(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&Vm(t,e,0,o-1,n),null===this._root)this._root=qm(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Mm(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Mm(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Mm(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=Wm({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Nm(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=Gm(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Lm(e,i,a,o):r=Lm(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Dm(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return Gm(t,this._root,this._comparator)},t}();function qm(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Mm(a,s);return l.left=qm(t,e,i,r),l.right=qm(t,e,r+1,o),l}return null}function Wm(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=Wm(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=Wm(t,n+1,i),a}return null}function Vm(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}Vm(t,e,i,s,n),Vm(t,e,s+1,o,n)}}function Um(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xm(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Km(t,e,i){return e&&Xm(t.prototype,e),i&&Xm(t,i),t}var Ym=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Zm=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},$m=Number.EPSILON;void 0===$m&&($m=Math.pow(2,-52));var Hm=$m*$m,Jm=function(t,e){if(-$m<t&&t<$m&&-$m<e&&e<$m)return 0;var i=t-e;return i*i<Hm*t*e?0:t<e?-1:1},Qm=function(){function t(){Um(this,t),this.reset()}return Km(t,[{key:"reset",value:function(){this.xRounder=new tv,this.yRounder=new tv}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),tv=function(){function t(){Um(this,t),this.tree=new Bm,this.round(0)}return Km(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===Jm(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===Jm(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),ev=new Qm,iv=function(t,e){return t.x*e.y-t.y*e.x},ov=function(t,e){return t.x*e.x+t.y*e.y},nv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=iv(o,n);return Jm(r,0)},rv=function(t){return Math.sqrt(ov(t,t))},av=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return ov(n,o)/rv(n)/rv(o)},sv=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},lv=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},uv=function(){function t(e,i){Um(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return Km(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:dv.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),Km(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},iv(l,s)/rv(l)/rv(s)),cosine:av(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),pv=0,dv=function(){function t(e,i,o,n){Um(this,t),this.id=++pv,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return Km(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var d=e.comparePoint(t.rightSE.point);return 0!==d?d:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var h=e.comparePoint(t.leftSE.point);if(0!==h)return h;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(n>r){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),Km(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=Zm(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=Ym(e,a)&&0===this.comparePoint(a),u=Ym(i,n)&&0===t.comparePoint(n),p=Ym(e,s)&&0===this.comparePoint(s),d=Ym(i,r)&&0===t.comparePoint(r);if(u&&l)return d&&!p?r:!d&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return d&&r.x===a.x&&r.y===a.y?null:a;if(d&&p)return null;if(d)return r;if(p)return s;var h=function(t,e,i,o){if(0===e.x)return lv(i,o,t.x);if(0===o.x)return lv(t,e,i.x);if(0===e.y)return sv(i,o,t.y);if(0===o.y)return sv(t,e,i.y);var n=iv(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=iv(r,e)/n,s=iv(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===h?null:Ym(o,h)?ev.round(h.x,h.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new uv(e,!0),r=new uv(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return uv.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),uv.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],d=i.rings.indexOf(u);-1===d?(i.rings.push(u),i.windings.push(p)):i.windings[d]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],d=0,h=e.length;d<h;d++)if(0!==i[d]){var c=e[d],f=c.poly;if(-1===p.indexOf(f))if(c.isExterior)u.push(f);else{-1===p.indexOf(f)&&p.push(f);var g=u.indexOf(c.poly);-1!==g&&u.splice(g,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(xv.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===xv.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(xv.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=uv.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new uv(n,!0),new uv(r,!1),[o],[a])}}]),t}(),hv=function(){function t(e,i,o){if(Um(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=ev.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=ev.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(dv.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(dv.fromRing(r,n,this))}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),cv=function(){function t(e,i){if(Um(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new hv(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new hv(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),fv=function(){function t(e,i){if(Um(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new cv(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return Km(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),gv=function(){function t(e){Um(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return Km(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,d=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var h=s.getAvailableLinkedEvents();if(0===h.length){var c=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===h.length){l=h[0].otherSE;break}for(var g=null,m=0,v=d.length;m<v;m++)if(d[m].point===s.point){g=m;break}if(null===g){d.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=h.sort(y)[0].otherSE;break}var _=d.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),Km(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==nv(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===nv(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,d=[],h=u;h!=p;h+=l)d.push([e[h].x,e[h].y]);return d}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];uv.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),mv=function(){function t(e){Um(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Km(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),vv=function(){function t(e){Um(this,t),this.rings=e,this.polys=this._composePolys(e)}return Km(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new mv(n));else{var r=n.enclosingRing();r.poly||e.push(new mv(r)),r.poly.addInterior(n)}}return e}}]),t}(),yv=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dv.compare;Um(this,t),this.queue=e,this.tree=new Bm(i),this.segments=[]}return Km(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),d=0,h=p.length;d<h;d++)i.push(p[d])}var c=null;if(s){var f=s.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f)))for(var g=this._splitSafely(s,f),m=0,v=g.length;m<v;m++)i.push(g[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=uv.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),T=0,E=z.length;T<E;T++)i.push(z[T])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),_v="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,bv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,xv=new(function(){function t(){Um(this,t)}return Km(t,[{key:"run",value:function(t,e,i){xv.type=t,ev.reset();for(var o=[new fv(e,!0)],n=0,r=i.length;n<r;n++)o.push(new fv(i[n],!1));if(xv.numMultiPolys=o.length,"difference"===xv.type)for(var a=o[0],s=1;s<o.length;)null!==Zm(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===xv.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],d=l+1,h=o.length;d<h;d++)if(null===Zm(p.bbox,o[d].bbox))return[];for(var c=new Bm(uv.compare),f=0,g=o.length;f<g;f++)for(var m=o[f].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>_v)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new yv(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>_v)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>bv)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var T=S[C];void 0===T.consumedBy&&c.insert(T)}b=c.size,x=c.pop()}ev.reset();var E=gv.factory(_.segments);return new vv(E).getGeom()}}]),t}()),kv=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return xv.run("union",t,i)};function wv(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Sv(t){return"Feature"===t.type?t.geometry:t}function Cv(t,e,i){void 0===i&&(i={});var o=Sv(t),n=Sv(e),r=kv(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return wv({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),wv({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function zv(t,e){const i=Wo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Tv(t,e,i){const o=e.getExtent();return t.getView().fit(Qi(o,i))}function Ev(t,e){const[i,o,n]=Array.from(In(t));return On([i,o,n,e])}const Ov=new jd,Pv=new jd;function jv(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=un(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=We(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new js,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ov.getFeatureById(e);i?Ov.removeFeature(i):(t.setId(e),Ov.addFeature(t))})):(Ov.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ov.addFeature(t)}))),Pv.clear(),Pv.addFeature(n.readFeature(Ov.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Cv(t,i):i}),null)))})).catch((t=>console.log(t)))}var Rv={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},Iv=/(italic|oblique)$/i,Fv={},Mv=function(t,e,i){var o=Fv[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var d in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):Iv.test(p)&&(p=p.replace(Iv,""),r=u[u.length-1].replace(p,"")),Rv){var h=u.length>1?u[u.length-2].toLowerCase():"";if(p==d||p==d.replace("-","")||h+"-"+p==d){n=Rv[d],u.pop(),h&&d.startsWith(h)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(" ")&&(c='"'+c+'"'),a.push(c)}o=Fv[t]=[r,n,a]}return o[0]+" "+o[1]+" "+e+"px"+(i?"/"+i:"")+" "+o[2]};function Av(t){return t*Math.PI/180}var Dv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Lv(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Gv,Nv=Array(256).join(" ");function Bv(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=Nv.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function qv(){return Gv||(Gv=Lv(1,1).getContext("2d")),Gv}function Wv(t,e){return qv().measureText(t).width+(t.length-1)*e}var Vv={};function Uv(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(Uv(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=Vv[l];if(!u){var p=t.split(" ");if(p.length>1){var d=qv();d.font=e;var h=d.measureText("M").width*i,c="";for(r=[],a=0,s=p.length;a<s;++a){var f=p[a],g=c+(c?" ":"")+f;Wv(g,o)<=h?c=g:(c&&r.push(c),c=f)}c&&r.push(c);for(a=0,s=r.length;a<s&&s>1;++a){var m=r[a];if(Wv(m,o)<.35*h){var v=a>0?Wv(r[a-1],o):1/0,y=a<s-1?Wv(r[a+1],o):1/0;r.splice(a,1),s-=1,v<y?(r[a-1]+=" "+m,a-=1):r[a]=m+" "+r[a]}}for(a=0,s=r.length-1;a<s;++a){var _=r[a],b=r[a+1];if(Wv(_,o)>.7*h&&Wv(b,o)<.6*h){var x=_.split(" "),k=x.pop();Wv(k,o)<.2*h&&(r[a]=x.join(" "),r[a+1]=k+" "+b),s-=1}}u=r.join("\n")}else u=t;u=Bv(u,o),Vv[l]=u}return u}Xn&&Kt(Xn,Dt,(function(){Vv={}}));var Xv,Kv,Yv=fm,Zv=cm,$v=dm,Hv=hm,Jv={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Qv={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]},ty={},ey={zoom:0};function iy(t,e,i,o,n,r){var a=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[a]||(r[a]={});var s=r[a];if(!s[i]){var l=(t[e]||ty)[i],u=xc["".concat(e,"_").concat(t.type)][i];void 0===l&&(l=u.default);var p=$v(l);if(!p&&Yv(l)&&(l=Zv(l,u),p=!0),p){var d=function(t,e){var i=Hv(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(l,u);s[i]=d.evaluate.bind(d)}else"color"==u.type&&(l=Kc.parse(l)),s[i]=function(){return l}}return ey.zoom=o,s[i](ey,n)}function oy(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var ny=/^([^]*)\{(.*)\}([^]*)$/;function ry(t,e){var i;do{if(i=t.match(ny)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function ay(t,e,i,o,n,r,a){if(void 0===o&&(o=Dv),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var d,h=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=pm(t[i],e[t[i].ref]));return t}(e.layers),c={},f=[],g={},m={},v={},y={},_=0,b=h.length;_<b;++_){var x=h[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(!d){d=x.source;var S=e.sources[d];if(!S)throw new Error('Source "'.concat(d,'" is not defined'));var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'.concat(d,'" is not of type "vector" or "geojson", but "').concat(C,'"'))}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),f.push(k)}}var T=new Qs,E=new Rs,O=[],P=function(t,e){var i=t.getProperties(),r=c[i.layer];if(r){var u=o.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(e,o));for(var p=Jv[t.getGeometry().getType()],d={properties:i,type:p},h=-1,f=function(o,c){var f=r[o],_=f.layer,b=_.id,x=_.layout||ty,k=_.paint||ty;if("none"===x.visibility||"minzoom"in _&&u<_.minzoom||"maxzoom"in _&&u>=_.maxzoom)return"continue";var w=_.filter;if(!w||function(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=Hg(e).filter),ey.zoom=o,n[t](ey,i)}(b,w,d,u,y)){var S=void 0,C=void 0,z=void 0,P=void 0,j=void 0,R=void 0,I=f.index;if(3==p&&("fill"==_.type||"fill-extrusion"==_.type))if(C=iy(_,"paint",_.type+"-opacity",u,d,v),_.type+"-pattern"in k){var F=iy(_,"paint",_.type+"-pattern",u,d,v);if(F){var M="string"==typeof F?ry(F,i):F.toString();if(s&&n&&n[M]){++h,(R=O[h])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new pl({fill:new Rs}),O[h]=R),z=R.getFill(),R.setZIndex(I);var A=m[ct=M+"."+C];if(!A){var D=n[M],L=Lv(D.width,D.height),G=L.getContext("2d");G.globalAlpha=C,G.drawImage(s,D.x,D.y,D.width,D.height,0,0,D.width,D.height),A=G.createPattern(L,"repeat"),m[ct]=A}z.setColor(A)}}}else S=oy(iy(_,"paint",_.type+"-color",u,d,v),C),_.type+"-outline-color"in k&&(j=oy(iy(_,"paint",_.type+"-outline-color",u,d,v),C)),j||(j=S),(S||j)&&(++h,(!(R=O[h])||S&&!R.getFill()||!S&&R.getFill()||j&&!R.getStroke()||!j&&R.getStroke()||R.getText())&&(R=new pl({fill:S?new Rs:void 0,stroke:j?new Qs:void 0}),O[h]=R),S&&(z=R.getFill()).setColor(S),j&&((P=R.getStroke()).setColor(j),P.setWidth(.5)),R.setZIndex(I));if(1!=p&&"line"==_.type){S=!("line-pattern"in k)&&"line-color"in k?oy(iy(_,"paint","line-color",u,d,v),iy(_,"paint","line-opacity",u,d,v)):void 0;var N=iy(_,"paint","line-width",u,d,v);S&&N>0&&(++h,(R=O[h])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new pl({stroke:new Qs}),O[h]=R),(P=R.getStroke()).setLineCap(iy(_,"layout","line-cap",u,d,v)),P.setLineJoin(iy(_,"layout","line-join",u,d,v)),P.setMiterLimit(iy(_,"layout","line-miter-limit",u,d,v)),P.setColor(S),P.setWidth(N),P.setLineDash(k["line-dasharray"]?iy(_,"paint","line-dasharray",u,d,v).map((function(t){return t*N})):null),R.setZIndex(I))}var B=!1,q=null,W=0,V=void 0,U=void 0,X=void 0;if((1==p||2==p)&&"icon-image"in x){var K=iy(_,"layout","icon-image",u,d,v);if(K){V="string"==typeof K?ry(K,i):K.toString();var Y=void 0;if(s&&n&&n[V]){var Z=iy(_,"layout","icon-rotation-alignment",u,d,v);if(2==p){var $=t.getGeometry();if($.getFlatMidpoint||$.getFlatMidpoints){var H=$.getExtent();if(Math.sqrt(Math.max(Math.pow((H[2]-H[0])/e,2),Math.pow((H[3]-H[1])/e,2)))>150){var J="MultiLineString"===$.getType()?$.getFlatMidpoints():$.getFlatMidpoint();if(Kv||(Kv=new Dl("Point",Xv=[NaN,NaN],[],{},null)),Y=Kv,Xv[0]=J[0],Xv[1]=J[1],"line"===(jt=iy(_,"layout","symbol-placement",u,d,v))&&"map"===Z)for(var Q=$.getStride(),tt=$.getFlatCoordinates(),et=0,it=tt.length-Q;et<it;et+=Q){var ot=tt[et],nt=tt[et+1],rt=tt[et+Q],at=tt[et+Q+1],st=Math.min(ot,rt),lt=Math.min(nt,at),ut=Math.max(ot,rt),pt=Math.max(nt,at);if(J[0]>=st&&J[0]<=ut&&J[1]>=lt&&J[1]<=pt){W=Math.atan2(nt-at,rt-ot);break}}}}}if(2!==p||Y){var dt=iy(_,"layout","icon-size",u,d,v),ht=void 0!==k["icon-color"]?iy(_,"paint","icon-color",u,d,v):null;if(!ht||0!==ht.a){var ct=V+"."+dt;if(null!==ht&&(ct+="."+ht),!(U=g[ct])){var ft=n[V];U=new Js({color:ht?[255*ht.r,255*ht.g,255*ht.b,ht.a]:void 0,img:s,imgSize:l,size:[ft.width,ft.height],offset:[ft.x,ft.y],rotateWithView:"map"===Z,scale:dt/ft.pixelRatio,displacement:"icon-offset"in x?iy(_,"layout","icon-offset",u,d,v).map((function(t){return-t*ft.pixelRatio})):void 0}),g[ct]=U}}U&&(++h,(R=O[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R),R.setGeometry(Y),U.setRotation(W+Av(iy(_,"layout","icon-rotate",u,d,v))),U.setOpacity(iy(_,"paint","icon-opacity",u,d,v)),U.setAnchor(Qv[iy(_,"layout","icon-anchor",u,d,v)]),R.setImage(U),q=R.getText(),R.setText(void 0),R.setZIndex(I),B=!0,X=!1)}else X=!0}}}if(1==p&&"circle"===_.type){++h,(R=O[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R);var gt="circle-radius"in k?iy(_,"paint","circle-radius",u,d,v):5,mt=oy(iy(_,"paint","circle-stroke-color",u,d,v),iy(_,"paint","circle-stroke-opacity",u,d,v)),vt=oy(iy(_,"paint","circle-color",u,d,v),iy(_,"paint","circle-opacity",u,d,v)),yt=iy(_,"paint","circle-stroke-width",u,d,v),_t=gt+"."+mt+"."+vt+"."+yt;(U=g[_t])||(U=new nl({radius:gt,stroke:mt&&yt>0?new Qs({width:yt,color:mt}):void 0,fill:vt?new Rs({color:vt}):void 0}),g[_t]=U),R.setImage(U),q=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),B=!0}var bt,xt,kt,wt,St=void 0,Ct=void 0;if("text-field"in x){xt=Math.round(iy(_,"layout","text-size",u,d,v));var zt=iy(_,"layout","text-font",u,d,v);bt=iy(_,"layout","text-line-height",u,d,v),Ct=Mv(a?a(zt):zt,xt,bt),kt=iy(_,"layout","text-letter-spacing",u,d,v),wt=iy(_,"layout","text-max-width",u,d,v);var Tt=iy(_,"layout","text-field",u,d,v);St="object"==typeof Tt&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):zt,n=Mv(a?a(o):o,xt*(e.scale||1),bt),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=p){for(var s=0,l=(r=Uv(r,n,wt,kt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(Bv(r,kt),n)}),[]):ry(Tt,i).trim(),C=iy(_,"paint","text-opacity",u,d,v)}if(St&&C&&!X){B||(++h,(R=O[h])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new pl,O[h]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(q||new cl({padding:[2,2,2,2]})),q=R.getText();var Et=x["text-transform"];"uppercase"==Et?St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toUpperCase()})):St.toUpperCase():"lowercase"==Et&&(St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toLowerCase()})):St.toLowerCase());var Ot=Array.isArray(St)?St:2==p?Bv(St,kt):Uv(St,Ct,wt,kt);q.setText(Ot),q.setFont(Ct),q.setRotation(Av(iy(_,"layout","text-rotate",u,d,v)));var Pt=iy(_,"layout","text-anchor",u,d,v),jt=B||1==p?"point":iy(_,"layout","symbol-placement",u,d,v);q.setPlacement(jt),q.setOverflow("point"===jt);var Rt=iy(_,"paint","text-halo-width",u,d,v),It=iy(_,"layout","text-offset",u,d,v),Ft=iy(_,"paint","text-translate",u,d,v),Mt=0,At=0;if("point"==jt){var Dt="center";-1!==Pt.indexOf("left")?(Dt="left",At=Rt):-1!==Pt.indexOf("right")&&(Dt="right",At=-Rt),q.setTextAlign(Dt);var Lt=iy(_,"layout","text-rotation-alignment",u,d,v);q.setRotateWithView("map"==Lt)}else q.setMaxAngle(Av(iy(_,"layout","text-max-angle",u,d,v))*St.length/Ot.length),q.setTextAlign(),q.setRotateWithView(!1);var Gt="middle";0==Pt.indexOf("bottom")?(Gt="bottom",Mt=-Rt-.5*(bt-1)*xt):0==Pt.indexOf("top")&&(Gt="top",Mt=Rt+.5*(bt-1)*xt),q.setTextBaseline(Gt),q.setOffsetX(It[0]*xt+At+Ft[0]),q.setOffsetY(It[1]*xt+Mt+Ft[1]),E.setColor(oy(iy(_,"paint","text-color",u,d,v),C)),q.setFill(E);var Nt=oy(iy(_,"paint","text-halo-color",u,d,v),C);if(Nt){T.setColor(Nt),Rt*=2;var Bt=.5*xt;T.setWidth(Rt<=Bt?Rt:Bt),q.setStroke(T)}else q.setStroke(void 0);var qt=iy(_,"layout","text-padding",u,d,v),Wt=q.getPadding();qt!==Wt[0]&&(Wt[0]=qt,Wt[1]=qt,Wt[2]=qt,Wt[3]=qt),R.setZIndex(I)}}},_=0,b=r.length;_<b;++_)f(_);return h>-1?(O.length=h+1,O):void 0}};return t.setStyle(P),t.set("mapbox-source",d),t.set("mapbox-layers",f),P}g`.ol-box {
47
47
  box-sizing: border-box;
48
48
  border-radius: 2px;
49
49
  border: 1.5px solid rgb(179,197,219);
@@ -367,7 +367,7 @@ var Mm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
367
367
  left: 0;
368
368
  z-index: 100;
369
369
  background: white;
370
- }`,uy=Object.freeze,py=Object.defineProperty,dy=Object.getOwnPropertyDescriptor,hy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?dy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&py(e,i,r),r};let cy=class extends ht{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new bc({source:r?new mm({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new _m({attributions:[ym]})}));var n,r;const a=function(t,e){let i=new _h({declutter:!0,source:new Qh({format:new Wl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>ay(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new ic({target:e,layers:[i?a:o],view:new qa({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",d="EPSG:3857",jo(u,ln(p,d),void 0,h)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:rn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:es({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new ts({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:ih({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,d,h;this.map=s;const c=(f=this.drawPointer,new Bd({source:Rm,type:"Polygon",style:new pl({stroke:Tm,fill:Em,image:"crosshair"===f?Om:Pm})}));var f;const g=function(t){return new $d({source:Rm,style:new pl({image:"crosshair"===t?Om:Pm})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Tv(s,Pv,this.featureBuffer):b.getFeatures().length>0?Tv(s,b,this.geojsonBuffer):(s.getView().setCenter(rn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Rm.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Fm))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new be({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new jd;if("FeatureCollection"===this.geojsonData.type){let t=(new js).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new js).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new fd({source:b,style:new pl({stroke:new Qs({color:this.geojsonColor,width:3}),fill:new Rs({color:this.geojsonFill?Ev(this.geojsonColor,.2):Ev(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Tv(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",zv(t,this.areaUnit))}if(this.drawMode){Rm.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new js).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Rm.addFeature(t),Tv(s,Rm,this.drawGeojsonDataBuffer)}s.addLayer(Im),t||s.addInteraction(c),s.addInteraction(g),s.addInteraction(Fm),Rm.on("change",(()=>{var t;const e=Rm.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new js).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",zv(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(wm),Im.setZIndex(1001),this.zoom<t){km.clear();const t=s.getView().calculateExtent(s.getSize());Sm(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?km.clear():setTimeout((()=>{km.clear();const t=s.getView().calculateExtent(s.getSize());Sm(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){jv(rn([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{jv(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new fd({source:Pv,style:new pl({stroke:new Qs({width:3,color:k}),fill:new Rs({color:Ev(k,w?.2:0)})})}));s.addLayer(t),Pv.on("change",(()=>{if("ready"===Pv.getState()&&Pv.getFeatures().length>0){Tv(s,Pv,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new js).writeFeaturesObject(Pv.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Pv.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",zv(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return U(sy||(sy=uy(py(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:uy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};cy.styles=f(ly),hy([gt({type:String})],cy.prototype,"id",2),hy([gt({type:Number})],cy.prototype,"latitude",2),hy([gt({type:Number})],cy.prototype,"longitude",2),hy([gt({type:Number})],cy.prototype,"zoom",2),hy([gt({type:Number})],cy.prototype,"minZoom",2),hy([gt({type:Number})],cy.prototype,"maxZoom",2),hy([gt({type:Boolean})],cy.prototype,"drawMode",2),hy([gt({type:Object})],cy.prototype,"drawGeojsonData",2),hy([gt({type:Number})],cy.prototype,"drawGeojsonDataBuffer",2),hy([gt({type:String})],cy.prototype,"drawPointer",2),hy([gt({type:Boolean})],cy.prototype,"showFeaturesAtPoint",2),hy([gt({type:Boolean})],cy.prototype,"clickFeatures",2),hy([gt({type:String})],cy.prototype,"featureColor",2),hy([gt({type:Boolean})],cy.prototype,"featureFill",2),hy([gt({type:Number})],cy.prototype,"featureBuffer",2),hy([gt({type:Object})],cy.prototype,"geojsonData",2),hy([gt({type:String})],cy.prototype,"geojsonColor",2),hy([gt({type:Boolean})],cy.prototype,"geojsonFill",2),hy([gt({type:Number})],cy.prototype,"geojsonBuffer",2),hy([gt({type:Boolean})],cy.prototype,"disableVectorTiles",2),hy([gt({type:String})],cy.prototype,"osVectorTilesApiKey",2),hy([gt({type:String})],cy.prototype,"osFeaturesApiKey",2),hy([gt({type:String})],cy.prototype,"osCopyright",2),hy([gt({type:Boolean})],cy.prototype,"hideResetControl",2),hy([gt({type:Boolean})],cy.prototype,"staticMode",2),hy([gt({type:String})],cy.prototype,"areaUnit",2),hy([gt({type:Boolean})],cy.prototype,"showScale",2),hy([gt({type:Boolean})],cy.prototype,"useScaleBarStyle",2),cy=hy([ct("my-map")],cy);var fy,gy={exports:{}};fy=gy,function(t,e){fy.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,d,h,c,f=t&u.F,g=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=g?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=g?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in g&&(i=e),i)h=((d=!f&&_&&void 0!==_[p])?_:i)[p],c=y&&d?s(h,o):v&&"function"==typeof h?s(Function.call,h):h,_&&a(_,p,h,t&u.U),b[p]!=h&&r(b,p,c),v&&x[p]!=h&&(x[p]=h)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return F})),i.d(e,"render",(function(){return M})),i.d(e,"rerender",(function(){return f})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var d=new o;return d.nodeName=t,d.children=p,d.attributes=null==e?void 0:e,d.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(d),d}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(n.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function g(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===d.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(j(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=O(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),j(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!g(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,d=r.__preactattr_,h=e.children;if(null==d){d=r.__preactattr_={};for(var c=r.attributes,f=c.length;f--;)d[c[f].name]=c[f].value}return!w&&h&&1===h.length&&"string"==typeof h[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=h[0]&&(p.nodeValue=h[0]):(h&&h.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,d,h,c=t.childNodes,f=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],T=S.__preactattr_;null!=(E=k&&T?S._component?S._component.__key:T.key:null)?(y++,m[E]=S):(T||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(f[x++]=S)}if(0!==k)for(w=0;w<k;w++){var E;if(u=null,null!=(E=(l=e[w]).key))y&&void 0!==m[E]&&(u=m[E],m[E]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==f[r]&&(p=a=f[r],h=n,"string"==typeof(d=l)||"number"==typeof d?void 0!==p.splitText:"string"==typeof d.nodeName?!p._componentConstructor&&g(p,d.nodeName):h||p._componentConstructor===d.nodeName)){u=a,f[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=f[x--])&&z(u,!1)}(r,h,i,o,w||null!=d.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,d),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),T(t))}function T(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var E=[];function O(t,e,i){var o,n=E.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),F.call(o,e,i)):((o=new F(e,i)).constructor=t,o.render=P);n--;)if(E[n].constructor===t)return o.nextBase=E[n].nextBase,E.splice(n,1),o;return o}function P(t,e,i){return this.constructor(t,i)}function j(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,d=t.context,h=t.prevProps||u,c=t.prevState||p,f=t.prevContext||d,g=t.base,v=t.nextBase,y=g||v,_=t._component,T=!1,E=f;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),g&&(t.props=h,t.state=c,t.context=f,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,d)?T=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,d),t.props=u,t.state=p,t.context=d),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!T){r=t.render(u,p,d),t.getChildContext&&(d=l(l({},d),t.getChildContext())),g&&t.getSnapshotBeforeUpdate&&(E=t.getSnapshotBeforeUpdate(h,c));var P,F,M=r&&r.nodeName;if("function"==typeof M){var A=m(r);(a=_)&&a.constructor===M&&A.key==a.__key?j(a,A,1,d,!1):(P=a,t._component=a=O(M,A,d),a.nextBase=a.nextBase||v,a._parentComponent=t,j(a,A,0,d,!1),R(a,1,i,!0)),F=a.base}else s=y,(P=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),F=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,d,i||!g,y&&y.parentNode,!0));if(y&&F!==y&&a!==_){var D=y.parentNode;D&&F!==D&&(D.replaceChild(F,y),P||(y._component=null,z(y,!1)))}if(P&&I(P),(t.base=F)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=F;F._component=L,F._componentConstructor=L.constructor}}for(!g||i?b.unshift(t):T||(t.componentDidUpdate&&t.componentDidUpdate(h,c,E),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),E.push(t),T(e)),t.__ref&&t.__ref(null)}function F(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function M(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(F.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var A={h:s,createElement:s,cloneElement:p,Component:F,render:M,rerender:f,options:n};e.default=A},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,d=6==t,h=5==t||d,c=e||s;return function(e,s,f){for(var g,m,v=r(e),y=n(v),_=o(s,f,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((h||x in y)&&(m=_(g=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return x;case 2:k.push(g)}else if(p)return!1;return d?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,d=r.f;u<l;)for(var h,c=s(arguments[u++]),f=p?o(c).concat(p(c)):o(c),g=f.length,m=0;m<g;)d.call(c,h=f[m++])&&(i[h]=c[h]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var d=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var d=n&&p();this.handleComponentBlur({menuOpen:d,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,d=i.name,h=i.placeholder,c=i.required,f=i.showAllValues,g=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,T=k.query,E=k.selected,O=k.ariaHint,P=k.validChoiceMade,j=this.hasAutoselect(),R=-1===w,I=0===z.length,F=0!==T.length,M=T.length>=u,A=this.props.showNoOptionsFound&&R&&I&&F&&M,D=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",q=-1!==w&&null!==w,W=r+"__menu",V=W+"--"+a,U=W+"--"+(C||A?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[E]),Z=Y&&0===Y.toLowerCase().indexOf(T.toLowerCase())&&j?T+Y.substr(T.length):"",H=l+"__assistiveHint",$=O?{"aria-describedby":H}:null;return f&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:T.length,minQueryLength:u,selectedOption:this.templateInputValue(z[E]),selectedOptionIndex:E,validChoiceMade:P,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!q&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:d,placeholder:h,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:T})),t,(0,o.createElement)("ul",{className:W+" "+V+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?E===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),A&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},g())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=d).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],d=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,d=e.tSelectedOption,h=e.tResults,c=this.state,f=c.bump,g=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?d(s,n,l):"";return t=v?u(a):y?p():h(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&g&&f?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!g||f?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var my,vy,yy=fl(gy.exports),_y=g`@charset "UTF-8";
370
+ }`,uy=Object.freeze,py=Object.defineProperty,dy=Object.getOwnPropertyDescriptor,hy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?dy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&py(e,i,r),r};let cy=class extends ht{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new bc({source:r?new mm({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new _m({attributions:[ym]})}));var n,r;const a=function(t,e){let i=new _h({declutter:!0,source:new Qh({format:new Wl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>ay(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new ic({target:e,layers:[i?a:o],view:new qa({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",d="EPSG:3857",jo(u,ln(p,d),void 0,h)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:rn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:es({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new ts({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:ih({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,d,h;this.map=s;const c=(f=this.drawPointer,new Bd({source:Rm,type:"Polygon",style:new pl({stroke:Tm,fill:Em,image:"crosshair"===f?Om:Pm})}));var f;const g=function(t){return new Hd({source:Rm,style:new pl({image:"crosshair"===t?Om:Pm})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Tv(s,Pv,this.featureBuffer):b.getFeatures().length>0?Tv(s,b,this.geojsonBuffer):(s.getView().setCenter(rn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Rm.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Fm))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new be({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new jd;if("FeatureCollection"===this.geojsonData.type){let t=(new js).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new js).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new fd({source:b,style:new pl({stroke:new Qs({color:this.geojsonColor,width:3}),fill:new Rs({color:this.geojsonFill?Ev(this.geojsonColor,.2):Ev(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Tv(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",zv(t,this.areaUnit))}if(this.drawMode){Rm.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new js).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Rm.addFeature(t),Tv(s,Rm,this.drawGeojsonDataBuffer)}s.addLayer(Im),t||s.addInteraction(c),s.addInteraction(g),s.addInteraction(Fm),Rm.on("change",(()=>{var t;const e=Rm.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new js).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",zv(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(wm),Im.setZIndex(1001),this.zoom<t){km.clear();const t=s.getView().calculateExtent(s.getSize());Sm(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?km.clear():setTimeout((()=>{km.clear();const t=s.getView().calculateExtent(s.getSize());Sm(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){jv(rn([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{jv(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new fd({source:Pv,style:new pl({stroke:new Qs({width:3,color:k}),fill:new Rs({color:Ev(k,w?.2:0)})})}));s.addLayer(t),Pv.on("change",(()=>{if("ready"===Pv.getState()&&Pv.getFeatures().length>0){Tv(s,Pv,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new js).writeFeaturesObject(Pv.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Pv.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",zv(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return U(sy||(sy=uy(py(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:uy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};cy.styles=f(ly),hy([gt({type:String})],cy.prototype,"id",2),hy([gt({type:Number})],cy.prototype,"latitude",2),hy([gt({type:Number})],cy.prototype,"longitude",2),hy([gt({type:Number})],cy.prototype,"zoom",2),hy([gt({type:Number})],cy.prototype,"minZoom",2),hy([gt({type:Number})],cy.prototype,"maxZoom",2),hy([gt({type:Boolean})],cy.prototype,"drawMode",2),hy([gt({type:Object})],cy.prototype,"drawGeojsonData",2),hy([gt({type:Number})],cy.prototype,"drawGeojsonDataBuffer",2),hy([gt({type:String})],cy.prototype,"drawPointer",2),hy([gt({type:Boolean})],cy.prototype,"showFeaturesAtPoint",2),hy([gt({type:Boolean})],cy.prototype,"clickFeatures",2),hy([gt({type:String})],cy.prototype,"featureColor",2),hy([gt({type:Boolean})],cy.prototype,"featureFill",2),hy([gt({type:Number})],cy.prototype,"featureBuffer",2),hy([gt({type:Object})],cy.prototype,"geojsonData",2),hy([gt({type:String})],cy.prototype,"geojsonColor",2),hy([gt({type:Boolean})],cy.prototype,"geojsonFill",2),hy([gt({type:Number})],cy.prototype,"geojsonBuffer",2),hy([gt({type:Boolean})],cy.prototype,"disableVectorTiles",2),hy([gt({type:String})],cy.prototype,"osVectorTilesApiKey",2),hy([gt({type:String})],cy.prototype,"osFeaturesApiKey",2),hy([gt({type:String})],cy.prototype,"osCopyright",2),hy([gt({type:Boolean})],cy.prototype,"hideResetControl",2),hy([gt({type:Boolean})],cy.prototype,"staticMode",2),hy([gt({type:String})],cy.prototype,"areaUnit",2),hy([gt({type:Boolean})],cy.prototype,"showScale",2),hy([gt({type:Boolean})],cy.prototype,"useScaleBarStyle",2),cy=hy([ct("my-map")],cy);var fy,gy={exports:{}};fy=gy,function(t,e){fy.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,d,h,c,f=t&u.F,g=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=g?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=g?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in g&&(i=e),i)h=((d=!f&&_&&void 0!==_[p])?_:i)[p],c=y&&d?s(h,o):v&&"function"==typeof h?s(Function.call,h):h,_&&a(_,p,h,t&u.U),b[p]!=h&&r(b,p,c),v&&x[p]!=h&&(x[p]=h)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return F})),i.d(e,"render",(function(){return M})),i.d(e,"rerender",(function(){return f})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var d=new o;return d.nodeName=t,d.children=p,d.attributes=null==e?void 0:e,d.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(d),d}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(n.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function g(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===d.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(j(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=O(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),j(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!g(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,d=r.__preactattr_,h=e.children;if(null==d){d=r.__preactattr_={};for(var c=r.attributes,f=c.length;f--;)d[c[f].name]=c[f].value}return!w&&h&&1===h.length&&"string"==typeof h[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=h[0]&&(p.nodeValue=h[0]):(h&&h.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,d,h,c=t.childNodes,f=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],T=S.__preactattr_;null!=(E=k&&T?S._component?S._component.__key:T.key:null)?(y++,m[E]=S):(T||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(f[x++]=S)}if(0!==k)for(w=0;w<k;w++){var E;if(u=null,null!=(E=(l=e[w]).key))y&&void 0!==m[E]&&(u=m[E],m[E]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==f[r]&&(p=a=f[r],h=n,"string"==typeof(d=l)||"number"==typeof d?void 0!==p.splitText:"string"==typeof d.nodeName?!p._componentConstructor&&g(p,d.nodeName):h||p._componentConstructor===d.nodeName)){u=a,f[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=f[x--])&&z(u,!1)}(r,h,i,o,w||null!=d.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,d),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),T(t))}function T(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var E=[];function O(t,e,i){var o,n=E.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),F.call(o,e,i)):((o=new F(e,i)).constructor=t,o.render=P);n--;)if(E[n].constructor===t)return o.nextBase=E[n].nextBase,E.splice(n,1),o;return o}function P(t,e,i){return this.constructor(t,i)}function j(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,d=t.context,h=t.prevProps||u,c=t.prevState||p,f=t.prevContext||d,g=t.base,v=t.nextBase,y=g||v,_=t._component,T=!1,E=f;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),g&&(t.props=h,t.state=c,t.context=f,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,d)?T=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,d),t.props=u,t.state=p,t.context=d),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!T){r=t.render(u,p,d),t.getChildContext&&(d=l(l({},d),t.getChildContext())),g&&t.getSnapshotBeforeUpdate&&(E=t.getSnapshotBeforeUpdate(h,c));var P,F,M=r&&r.nodeName;if("function"==typeof M){var A=m(r);(a=_)&&a.constructor===M&&A.key==a.__key?j(a,A,1,d,!1):(P=a,t._component=a=O(M,A,d),a.nextBase=a.nextBase||v,a._parentComponent=t,j(a,A,0,d,!1),R(a,1,i,!0)),F=a.base}else s=y,(P=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),F=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,d,i||!g,y&&y.parentNode,!0));if(y&&F!==y&&a!==_){var D=y.parentNode;D&&F!==D&&(D.replaceChild(F,y),P||(y._component=null,z(y,!1)))}if(P&&I(P),(t.base=F)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=F;F._component=L,F._componentConstructor=L.constructor}}for(!g||i?b.unshift(t):T||(t.componentDidUpdate&&t.componentDidUpdate(h,c,E),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),E.push(t),T(e)),t.__ref&&t.__ref(null)}function F(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function M(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(F.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var A={h:s,createElement:s,cloneElement:p,Component:F,render:M,rerender:f,options:n};e.default=A},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,d=6==t,h=5==t||d,c=e||s;return function(e,s,f){for(var g,m,v=r(e),y=n(v),_=o(s,f,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((h||x in y)&&(m=_(g=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return x;case 2:k.push(g)}else if(p)return!1;return d?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,d=r.f;u<l;)for(var h,c=s(arguments[u++]),f=p?o(c).concat(p(c)):o(c),g=f.length,m=0;m<g;)d.call(c,h=f[m++])&&(i[h]=c[h]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var d=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var d=n&&p();this.handleComponentBlur({menuOpen:d,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,d=i.name,h=i.placeholder,c=i.required,f=i.showAllValues,g=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,T=k.query,E=k.selected,O=k.ariaHint,P=k.validChoiceMade,j=this.hasAutoselect(),R=-1===w,I=0===z.length,F=0!==T.length,M=T.length>=u,A=this.props.showNoOptionsFound&&R&&I&&F&&M,D=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",q=-1!==w&&null!==w,W=r+"__menu",V=W+"--"+a,U=W+"--"+(C||A?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[E]),Z=Y&&0===Y.toLowerCase().indexOf(T.toLowerCase())&&j?T+Y.substr(T.length):"",$=l+"__assistiveHint",H=O?{"aria-describedby":$}:null;return f&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:T.length,minQueryLength:u,selectedOption:this.templateInputValue(z[E]),selectedOptionIndex:E,validChoiceMade:P,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!q&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},H,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:d,placeholder:h,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:T})),t,(0,o.createElement)("ul",{className:W+" "+V+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?E===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),A&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},g())),(0,o.createElement)("span",{id:$,style:{display:"none"}},b()))},e}(o.Component);(e.default=d).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],d=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,d=e.tSelectedOption,h=e.tResults,c=this.state,f=c.bump,g=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?d(s,n,l):"";return t=v?u(a):y?p():h(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&g&&f?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!g||f?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var my,vy=fl(gy.exports),yy=g`@charset "UTF-8";
371
371
  .govuk-link {
372
372
  font-family: "GDS Transport", arial, sans-serif;
373
373
  -webkit-font-smoothing: antialiased;
@@ -6549,7 +6549,20 @@ x:-moz-any-link {
6549
6549
  }
6550
6550
  :host .autocomplete__menu {
6551
6551
  max-height: var(--autocomplete__menu__max-height, 342px);
6552
- }`,by=Object.freeze,xy=Object.defineProperty,ky=Object.getOwnPropertyDescriptor,wy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?ky(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&xy(e,i,r),r},Sy=(t,e)=>by(xy(t,"raw",{value:by(e||t.slice())}));let Cy=class extends ht{constructor(){super(...arguments),this.id="autocomplete",this.postcode="SE5 0HU",this.label="Select an address",this.initialAddress="",this.osPlacesApiKey="",this.arrowStyle="default",this.labelStyle="responsive",this._totalAddresses=void 0,this._addressesInPostcode=[],this._options=[],this._selectedAddress=null,this._osError=void 0,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}connectedCallback(){super.connectedCallback(),this._fetchData()}disconnectedCallback(){super.disconnectedCallback()}getLightDropdownArrow(){return'<svg class="autocomplete__dropdown-arrow-down" style="height: 17px;" viewBox="0 0 512 512" ><path d="M256,298.3L256,298.3L256,298.3l174.2-167.2c4.3-4.2,11.4-4.1,15.8,0.2l30.6,29.9c4.4,4.3,4.5,11.3,0.2,15.5L264.1,380.9 c-2.2,2.2-5.2,3.2-8.1,3c-3,0.1-5.9-0.9-8.1-3L35.2,176.7c-4.3-4.2-4.2-11.2,0.2-15.5L66,131.3c4.4-4.3,11.5-4.4,15.8-0.2L256,298.3 z"/></svg>'}firstUpdated(){yy({element:this.renderRoot.querySelector(`#${this.id}-container`),id:this.id,required:!0,source:this._options,defaultValue:this.initialAddress,showAllValues:!0,displayMenu:"overlay",dropdownArrow:"light"===this.arrowStyle?this.getLightDropdownArrow:void 0,tNoResults:()=>"No addresses found",onConfirm:t=>{this._selectedAddress=this._addressesInPostcode.filter((e=>e.LPI.ADDRESS.split(`, ${e.LPI.ADMINISTRATIVE_AREA}`)[0]===t))[0],this._selectedAddress&&this.dispatch("addressSelection",{address:this._selectedAddress})}})}async _fetchData(t=0,e=[]){const i={postcode:this.postcode,dataset:"LPI",maxResults:"100",output_srs:"EPSG:4326",lr:"EN",key:this.osPlacesApiKey},o=`https://api.os.uk/search/places/v1/postcode?${new URLSearchParams(i)}`;await fetch(o+`&offset=${t}`).then((t=>t.json())).then((t=>{var i,o,n;(t.error||t.fault)&&(this._osError=(null==(i=t.error)?void 0:i.message)||(null==(o=t.fault)?void 0:o.faultstring)||"Something went wrong"),this._totalAddresses=null==(n=t.header)?void 0:n.totalresults;const r=e.concat(t.results||[]);if(this._addressesInPostcode=r,this.dispatch("ready",{postcode:this.postcode,status:`fetched ${this._addressesInPostcode.length}/${this._totalAddresses} addresses`}),t.results){t.results.filter((t=>"APPROVED"===t.LPI.LPI_LOGICAL_STATUS_CODE_DESCRIPTION)).map((t=>{this._options.push(t.LPI.ADDRESS.split(`, ${t.LPI.ADMINISTRATIVE_AREA}`)[0])}));const e=new Intl.Collator([],{numeric:!0});this._options.sort(((t,i)=>e.compare(t,i)))}this._totalAddresses&&this._totalAddresses>this._addressesInPostcode.length&&this._fetchData(this._addressesInPostcode.length,this._addressesInPostcode)})).catch((t=>console.log(t)))}_getLabelClasses(){let t="govuk-label";return"static"===this.labelStyle&&(t+=" govuk-label--static"),t}render(){let t;return this.osPlacesApiKey?this._osError?t=this._osError:0===this._totalAddresses&&(t=`No addresses found in postcode ${this.postcode}`):t="Missing OS Places API key",t?U(my||(my=Sy(['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-warning-text" role="status">\n <span class="govuk-warning-text__icon" aria-hidden="true">!</span>\n <strong class="govuk-warning-text__text">\n <span class="govuk-warning-text__assistive">Warning</span>\n ',"\n </strong>\n </div>"])),t):U(vy||(vy=Sy(['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link\n rel="stylesheet"\n href="https://cdn.jsdelivr.net/npm/accessible-autocomplete@2.0.4/dist/accessible-autocomplete.min.css"\n />\n <label class='," for=","\n >",'</label\n >\n <div id="','-container" spellcheck="false"></div>'])),this._getLabelClasses(),this.id,this.label,this.id)}};Cy.styles=f(_y),wy([gt({type:String})],Cy.prototype,"id",2),wy([gt({type:String})],Cy.prototype,"postcode",2),wy([gt({type:String})],Cy.prototype,"label",2),wy([gt({type:String})],Cy.prototype,"initialAddress",2),wy([gt({type:String})],Cy.prototype,"osPlacesApiKey",2),wy([gt({type:String})],Cy.prototype,"arrowStyle",2),wy([gt({type:String})],Cy.prototype,"labelStyle",2),wy([mt()],Cy.prototype,"_totalAddresses",2),wy([mt()],Cy.prototype,"_addressesInPostcode",2),wy([mt()],Cy.prototype,"_options",2),wy([mt()],Cy.prototype,"_selectedAddress",2),wy([mt()],Cy.prototype,"_osError",2),Cy=wy([ct("address-autocomplete")],Cy);var zy,Ty=function(){return(Ty=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},Ey=/^([a-z]{1,2}\d)([a-z])$/i,Oy=/[a-z]{2}$/i,Py=/\d[a-z]{2}$/i,jy=/^[a-z]{1,2}\d[a-z\d]?\s*\d[a-z]{2}$/i,Ry=/^[a-z]{1,2}/i,Iy={valid:!1,postcode:null,incode:null,outcode:null,area:null,district:null,subDistrict:null,sector:null,unit:null},Fy=function(t){return null===t?null:t[0]},My=/\s+/gi,Ay=function(t){return t.replace(My,"").toUpperCase()},Dy=function(t,e){return Ay(t).match(e)},Ly=function(t){return null!==t.match(jy)},Gy=function(t){var e=Ny(t);if(null===e)return null;var i=By(t);return null===i?null:e+" "+i},Ny=function(t){return Ly(t)?Ay(t).replace(Py,""):null},By=function(t){if(!Ly(t))return null;var e=Dy(t,Py);return Fy(e)},qy=function(t){if(!Ly(t))return null;var e=Dy(t,Ry);return Fy(e)},Wy=function(t){var e=Ny(t);if(null===e)return null;var i=By(t);return null===i?null:e+" "+i[0]},Vy=function(t){if(!Ly(t))return null;var e=Dy(t,Oy);return Fy(e)},Uy=function(t){var e=Ny(t);if(null===e)return null;var i=e.match(Ey);return null===i?e:i[1]},Xy=function(t){var e=Ny(t);return null===e||null===e.match(Ey)?null:e},Ky=g`@charset "UTF-8";
6552
+ }`,_y=Object.freeze,by=Object.defineProperty,xy=Object.getOwnPropertyDescriptor,ky=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?xy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&by(e,i,r),r};let wy=class extends ht{constructor(){super(...arguments),this.id="autocomplete",this.postcode="SE5 0HU",this.label="Select an address",this.initialAddress="",this.osPlacesApiKey="",this.arrowStyle="default",this.labelStyle="responsive",this._totalAddresses=void 0,this._addressesInPostcode=[],this._options=[],this._selectedAddress=null,this._osError=void 0,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}connectedCallback(){super.connectedCallback(),this._fetchData()}disconnectedCallback(){super.disconnectedCallback()}getLightDropdownArrow(){return'<svg class="autocomplete__dropdown-arrow-down" style="height: 17px;" viewBox="0 0 512 512" ><path d="M256,298.3L256,298.3L256,298.3l174.2-167.2c4.3-4.2,11.4-4.1,15.8,0.2l30.6,29.9c4.4,4.3,4.5,11.3,0.2,15.5L264.1,380.9 c-2.2,2.2-5.2,3.2-8.1,3c-3,0.1-5.9-0.9-8.1-3L35.2,176.7c-4.3-4.2-4.2-11.2,0.2-15.5L66,131.3c4.4-4.3,11.5-4.4,15.8-0.2L256,298.3 z"/></svg>'}firstUpdated(){vy({element:this.renderRoot.querySelector(`#${this.id}-container`),id:this.id,required:!0,source:this._options,defaultValue:this.initialAddress,showAllValues:!0,displayMenu:"overlay",dropdownArrow:"light"===this.arrowStyle?this.getLightDropdownArrow:void 0,tNoResults:()=>"No addresses found",onConfirm:t=>{this._selectedAddress=this._addressesInPostcode.filter((e=>e.LPI.ADDRESS.split(`, ${e.LPI.ADMINISTRATIVE_AREA}`)[0]===t))[0],this._selectedAddress&&this.dispatch("addressSelection",{address:this._selectedAddress})}})}async _fetchData(t=0,e=[]){const i={postcode:this.postcode,dataset:"LPI",maxResults:"100",output_srs:"EPSG:4326",lr:"EN",key:this.osPlacesApiKey},o=`https://api.os.uk/search/places/v1/postcode?${new URLSearchParams(i)}`;await fetch(o+`&offset=${t}`).then((t=>t.json())).then((t=>{var i,o,n;(t.error||t.fault)&&(this._osError=(null==(i=t.error)?void 0:i.message)||(null==(o=t.fault)?void 0:o.faultstring)||"Something went wrong"),this._totalAddresses=null==(n=t.header)?void 0:n.totalresults;const r=e.concat(t.results||[]);if(this._addressesInPostcode=r,this.dispatch("ready",{postcode:this.postcode,status:`fetched ${this._addressesInPostcode.length}/${this._totalAddresses} addresses`}),t.results){t.results.filter((t=>"APPROVED"===t.LPI.LPI_LOGICAL_STATUS_CODE_DESCRIPTION)).map((t=>{this._options.push(t.LPI.ADDRESS.split(`, ${t.LPI.ADMINISTRATIVE_AREA}`)[0])}));const e=new Intl.Collator([],{numeric:!0});this._options.sort(((t,i)=>e.compare(t,i)))}this._totalAddresses&&this._totalAddresses>this._addressesInPostcode.length&&this._fetchData(this._addressesInPostcode.length,this._addressesInPostcode)})).catch((t=>console.log(t)))}_getLabelClasses(){let t="govuk-label";return"static"===this.labelStyle&&(t+=" govuk-label--static"),t}_getErrorMessageContainer(t){const e=t?U` <span class="govuk-warning-text__icon" aria-hidden="true">!</span>
6553
+ <strong class="govuk-warning-text__text">
6554
+ <span class="govuk-warning-text__assistive">Warning</span>
6555
+ ${t}
6556
+ </strong>`:null;return U`<div class="${t?"govuk-warning-text":""}" role="status">${e}</div>`}_getAutocomplete(t){return t?null:U`
6557
+ <link
6558
+ rel="stylesheet"
6559
+ href="https://cdn.jsdelivr.net/npm/accessible-autocomplete@2.0.4/dist/accessible-autocomplete.min.css"
6560
+ />
6561
+ <label class=${this._getLabelClasses()} for=${this.id}>
6562
+ ${this.label}
6563
+ </label>
6564
+ <div id="${this.id}-container" spellcheck="false"></div>
6565
+ `}render(){let t;return this.osPlacesApiKey?this._osError?t=this._osError:0===this._totalAddresses&&(t=`No addresses found in postcode ${this.postcode}`):t="Missing OS Places API key",U(my||(my=_y(by(e=['\n <script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n ',"\n ","\n "],"raw",{value:_y(i||e.slice())}))),this._getErrorMessageContainer(t),this._getAutocomplete(t));var e,i}};wy.styles=f(yy),ky([gt({type:String})],wy.prototype,"id",2),ky([gt({type:String})],wy.prototype,"postcode",2),ky([gt({type:String})],wy.prototype,"label",2),ky([gt({type:String})],wy.prototype,"initialAddress",2),ky([gt({type:String})],wy.prototype,"osPlacesApiKey",2),ky([gt({type:String})],wy.prototype,"arrowStyle",2),ky([gt({type:String})],wy.prototype,"labelStyle",2),ky([mt()],wy.prototype,"_totalAddresses",2),ky([mt()],wy.prototype,"_addressesInPostcode",2),ky([mt()],wy.prototype,"_options",2),ky([mt()],wy.prototype,"_selectedAddress",2),ky([mt()],wy.prototype,"_osError",2),wy=ky([ct("address-autocomplete")],wy);var Sy,Cy=function(){return(Cy=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},zy=/^([a-z]{1,2}\d)([a-z])$/i,Ty=/[a-z]{2}$/i,Ey=/\d[a-z]{2}$/i,Oy=/^[a-z]{1,2}\d[a-z\d]?\s*\d[a-z]{2}$/i,Py=/^[a-z]{1,2}/i,jy={valid:!1,postcode:null,incode:null,outcode:null,area:null,district:null,subDistrict:null,sector:null,unit:null},Ry=function(t){return null===t?null:t[0]},Iy=/\s+/gi,Fy=function(t){return t.replace(Iy,"").toUpperCase()},My=function(t,e){return Fy(t).match(e)},Ay=function(t){return null!==t.match(Oy)},Dy=function(t){var e=Ly(t);if(null===e)return null;var i=Gy(t);return null===i?null:e+" "+i},Ly=function(t){return Ay(t)?Fy(t).replace(Ey,""):null},Gy=function(t){if(!Ay(t))return null;var e=My(t,Ey);return Ry(e)},Ny=function(t){if(!Ay(t))return null;var e=My(t,Py);return Ry(e)},By=function(t){var e=Ly(t);if(null===e)return null;var i=Gy(t);return null===i?null:e+" "+i[0]},qy=function(t){if(!Ay(t))return null;var e=My(t,Ty);return Ry(e)},Wy=function(t){var e=Ly(t);if(null===e)return null;var i=e.match(zy);return null===i?e:i[1]},Vy=function(t){var e=Ly(t);return null===e||null===e.match(zy)?null:e},Uy=g`@charset "UTF-8";
6553
6566
  .govuk-link {
6554
6567
  font-family: "GDS Transport", arial, sans-serif;
6555
6568
  -webkit-font-smoothing: antialiased;
@@ -12700,10 +12713,10 @@ x:-moz-any-link {
12700
12713
  .govuk-\\!-width-one-quarter {
12701
12714
  width: 25% !important;
12702
12715
  }
12703
- }`,Yy=Object.freeze,Zy=Object.defineProperty,Hy=Object.getOwnPropertyDescriptor,$y=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Hy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Zy(e,i,r),r};let Jy=class extends ht{constructor(){super(...arguments),this.id="postcode",this.errorId="postcode-error",this.label="Postcode",this.hintText="",this.errorMessage="Enter a valid UK postcode",this.onlyQuestionOnPage=!1,this._postcode="",this._sanitizedPostcode=null,this._showPostcodeError=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}_onInputChange(t){const e=t.target.value;var i;(i=e.trim(),Ly(i)?{valid:!0,postcode:Gy(i),incode:By(i),outcode:Ny(i),area:qy(i),district:Uy(i),subDistrict:Xy(i),sector:Wy(i),unit:Vy(i)}:Ty({},Iy)).valid?(this._sanitizedPostcode=Gy(e.trim()),this._postcode=Gy(e.trim())||e):(this._sanitizedPostcode=null,this._postcode=e.toUpperCase()),this._sanitizedPostcode&&(this._showPostcodeError=!1,this.dispatch("postcodeValidated",{postcode:this._sanitizedPostcode}))}_onBlur(){this._sanitizedPostcode||(this._showPostcodeError=!0),this._showError()}_onKeyUp(t){"Enter"!==t.key||this._sanitizedPostcode||(this._showPostcodeError=!0),this._showError()}_showError(){var t,e;const i=null==(t=this.shadowRoot)?void 0:t.querySelector(`#${this.errorId}`);i&&(i.style.display="none"),i&&this._showPostcodeError&&(i.style.display="");const o=null==(e=this.shadowRoot)?void 0:e.querySelector(".govuk-form-group");o&&this._showPostcodeError&&o.classList.add("govuk-form-group--error"),o&&!this._showPostcodeError&&o.classList.remove("govuk-form-group--error")}_makeLabel(){return this.onlyQuestionOnPage?U`<h1 class="govuk-label-wrapper">
12716
+ }`,Xy=Object.freeze,Ky=Object.defineProperty,Yy=Object.getOwnPropertyDescriptor,Zy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Yy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Ky(e,i,r),r};let $y=class extends ht{constructor(){super(...arguments),this.id="postcode",this.errorId="postcode-error",this.label="Postcode",this.hintText="",this.errorMessage="Enter a valid UK postcode",this.onlyQuestionOnPage=!1,this._postcode="",this._sanitizedPostcode=null,this._showPostcodeError=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}_onInputChange(t){const e=t.target.value;var i;(i=e.trim(),Ay(i)?{valid:!0,postcode:Dy(i),incode:Gy(i),outcode:Ly(i),area:Ny(i),district:Wy(i),subDistrict:Vy(i),sector:By(i),unit:qy(i)}:Cy({},jy)).valid?(this._sanitizedPostcode=Dy(e.trim()),this._postcode=Dy(e.trim())||e):(this._sanitizedPostcode=null,this._postcode=e.toUpperCase()),this._sanitizedPostcode&&(this._showPostcodeError=!1,this.dispatch("postcodeValidated",{postcode:this._sanitizedPostcode}))}_onBlur(){this._sanitizedPostcode||(this._showPostcodeError=!0),this._showError()}_onKeyUp(t){"Enter"!==t.key||this._sanitizedPostcode||(this._showPostcodeError=!0),this._showError()}_showError(){var t,e;const i=null==(t=this.shadowRoot)?void 0:t.querySelector(`#${this.errorId}`);i&&(i.style.display="none"),i&&this._showPostcodeError&&(i.style.display="");const o=null==(e=this.shadowRoot)?void 0:e.querySelector(".govuk-form-group");o&&this._showPostcodeError&&o.classList.add("govuk-form-group--error"),o&&!this._showPostcodeError&&o.classList.remove("govuk-form-group--error")}_makeLabel(){return this.onlyQuestionOnPage?U`<h1 class="govuk-label-wrapper">
12704
12717
  <label class="govuk-label govuk-label--l" htmlFor=${this.id}>
12705
12718
  ${this.label}
12706
12719
  </label>
12707
12720
  </h1>`:U`<label class="govuk-label" htmlFor=${this.id}
12708
12721
  >${this.label}</label
12709
- >`}render(){return U(zy||(zy=Yy(Zy(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-form-group">\n ','\n <div id="postcode-hint" class="govuk-hint">',"</div>\n <span\n id=",'\n class="govuk-error-message"\n style="display:none"\n role="status"\n >\n <span class="govuk-visually-hidden">Error:</span>','\n </span>\n <input\n class="govuk-input govuk-input--width-10"\n id=','\n name="postcode"\n type="text"\n autocomplete="postal-code"\n spellcheck="false"\n aria-describedby="postcode-hint ','"\n .value=',"\n @input=","\n @blur=","\n @keyup=",'\n tabindex="0"\n />\n </div>'],"raw",{value:Yy(e||t.slice())}))),this._makeLabel(),this.hintText,this.errorId,this.errorMessage,this.id,this.errorId,this._postcode,this._onInputChange,this._onBlur,this._onKeyUp);var t,e}};Jy.styles=f(Ky),$y([gt({type:String})],Jy.prototype,"id",2),$y([gt({type:String})],Jy.prototype,"errorId",2),$y([gt({type:String})],Jy.prototype,"label",2),$y([gt({type:String})],Jy.prototype,"hintText",2),$y([gt({type:String})],Jy.prototype,"errorMessage",2),$y([gt({type:Boolean})],Jy.prototype,"onlyQuestionOnPage",2),$y([mt()],Jy.prototype,"_postcode",2),$y([mt()],Jy.prototype,"_sanitizedPostcode",2),$y([mt()],Jy.prototype,"_showPostcodeError",2),Jy=$y([ct("postcode-search")],Jy);export{Cy as AddressAutocomplete,cy as MyMap,Jy as PostcodeSearch};
12722
+ >`}render(){return U(Sy||(Sy=Xy(Ky(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-form-group">\n ','\n <div id="postcode-hint" class="govuk-hint">',"</div>\n <span\n id=",'\n class="govuk-error-message"\n style="display:none"\n role="status"\n >\n <span class="govuk-visually-hidden">Error:</span>','\n </span>\n <input\n class="govuk-input govuk-input--width-10"\n id=','\n name="postcode"\n type="text"\n autocomplete="postal-code"\n spellcheck="false"\n aria-describedby="postcode-hint ','"\n .value=',"\n @input=","\n @blur=","\n @keyup=",'\n tabindex="0"\n />\n </div>'],"raw",{value:Xy(e||t.slice())}))),this._makeLabel(),this.hintText,this.errorId,this.errorMessage,this.id,this.errorId,this._postcode,this._onInputChange,this._onBlur,this._onKeyUp);var t,e}};$y.styles=f(Uy),Zy([gt({type:String})],$y.prototype,"id",2),Zy([gt({type:String})],$y.prototype,"errorId",2),Zy([gt({type:String})],$y.prototype,"label",2),Zy([gt({type:String})],$y.prototype,"hintText",2),Zy([gt({type:String})],$y.prototype,"errorMessage",2),Zy([gt({type:Boolean})],$y.prototype,"onlyQuestionOnPage",2),Zy([mt()],$y.prototype,"_postcode",2),Zy([mt()],$y.prototype,"_sanitizedPostcode",2),Zy([mt()],$y.prototype,"_showPostcodeError",2),$y=Zy([ct("postcode-search")],$y);export{wy as AddressAutocomplete,cy as MyMap,$y as PostcodeSearch};