Something went wrong on our end
-
Dominik Hebeler authoredDominik Hebeler authored
packages.js 820.92 KiB
function md5cycle(x, k) {
var a = x[0], b = x[1], c = x[2], d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
a = ff(a, b, c, d, k[4], 7, -176418897);
d = ff(d, a, b, c, k[5], 12, 1200080426);
c = ff(c, d, a, b, k[6], 17, -1473231341);
b = ff(b, c, d, a, k[7], 22, -45705983);
a = ff(a, b, c, d, k[8], 7, 1770035416);
d = ff(d, a, b, c, k[9], 12, -1958414417);
c = ff(c, d, a, b, k[10], 17, -42063);
b = ff(b, c, d, a, k[11], 22, -1990404162);
a = ff(a, b, c, d, k[12], 7, 1804603682);
d = ff(d, a, b, c, k[13], 12, -40341101);
c = ff(c, d, a, b, k[14], 17, -1502002290);
b = ff(b, c, d, a, k[15], 22, 1236535329);
a = gg(a, b, c, d, k[1], 5, -165796510);
d = gg(d, a, b, c, k[6], 9, -1069501632);
c = gg(c, d, a, b, k[11], 14, 643717713);
b = gg(b, c, d, a, k[0], 20, -373897302);
a = gg(a, b, c, d, k[5], 5, -701558691);
d = gg(d, a, b, c, k[10], 9, 38016083);
c = gg(c, d, a, b, k[15], 14, -660478335);
b = gg(b, c, d, a, k[4], 20, -405537848);
a = gg(a, b, c, d, k[9], 5, 568446438);
d = gg(d, a, b, c, k[14], 9, -1019803690);
c = gg(c, d, a, b, k[3], 14, -187363961);
b = gg(b, c, d, a, k[8], 20, 1163531501);
a = gg(a, b, c, d, k[13], 5, -1444681467);
d = gg(d, a, b, c, k[2], 9, -51403784);
c = gg(c, d, a, b, k[7], 14, 1735328473);
b = gg(b, c, d, a, k[12], 20, -1926607734);
a = hh(a, b, c, d, k[5], 4, -378558);
d = hh(d, a, b, c, k[8], 11, -2022574463);
c = hh(c, d, a, b, k[11], 16, 1839030562);
b = hh(b, c, d, a, k[14], 23, -35309556);
a = hh(a, b, c, d, k[1], 4, -1530992060);
d = hh(d, a, b, c, k[4], 11, 1272893353);
c = hh(c, d, a, b, k[7], 16, -155497632);
b = hh(b, c, d, a, k[10], 23, -1094730640);
a = hh(a, b, c, d, k[13], 4, 681279174);
d = hh(d, a, b, c, k[0], 11, -358537222);
c = hh(c, d, a, b, k[3], 16, -722521979);
b = hh(b, c, d, a, k[6], 23, 76029189);
a = hh(a, b, c, d, k[9], 4, -640364487);
d = hh(d, a, b, c, k[12], 11, -421815835);
c = hh(c, d, a, b, k[15], 16, 530742520);
b = hh(b, c, d, a, k[2], 23, -995338651);
a = ii(a, b, c, d, k[0], 6, -198630844);
d = ii(d, a, b, c, k[7], 10, 1126891415);
c = ii(c, d, a, b, k[14], 15, -1416354905);
b = ii(b, c, d, a, k[5], 21, -57434055);
a = ii(a, b, c, d, k[12], 6, 1700485571);
d = ii(d, a, b, c, k[3], 10, -1894986606);
c = ii(c, d, a, b, k[10], 15, -1051523);
b = ii(b, c, d, a, k[1], 21, -2054922799);
a = ii(a, b, c, d, k[8], 6, 1873313359);
d = ii(d, a, b, c, k[15], 10, -30611744);
c = ii(c, d, a, b, k[6], 15, -1560198380);
b = ii(b, c, d, a, k[13], 21, 1309151649);
a = ii(a, b, c, d, k[4], 6, -145523070);
d = ii(d, a, b, c, k[11], 10, -1120210379);
c = ii(c, d, a, b, k[2], 15, 718787259);
b = ii(b, c, d, a, k[9], 21, -343485551);
x[0] = add32(a, x[0]);
x[1] = add32(b, x[1]);
x[2] = add32(c, x[2]);
x[3] = add32(d, x[3]);
}
function cmn(q, a, b, x, s, t) {
a = add32(add32(a, q), add32(x, t));
return add32((a << s) | (a >>> (32 - s)), b);
}
function ff(a, b, c, d, x, s, t) {
return cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function gg(a, b, c, d, x, s, t) {
return cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function hh(a, b, c, d, x, s, t) {
return cmn(b ^ c ^ d, a, b, x, s, t);
}
function ii(a, b, c, d, x, s, t) {
return cmn(c ^ (b | (~d)), a, b, x, s, t);
}
function md51(s) {
txt = '';
var n = s.length,
state = [1732584193, -271733879, -1732584194, 271733878], i;
for (i=64; i<=s.length; i+=64) {
md5cycle(state, md5blk(s.substring(i-64, i)));
}
s = s.substring(i-64);
var tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];
for (i=0; i<s.length; i++)
tail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3);
tail[i>>2] |= 0x80 << ((i%4) << 3);
if (i > 55) {
md5cycle(state, tail);
for (i=0; i<16; i++) tail[i] = 0;
}
tail[14] = n*8;
md5cycle(state, tail);
return state;
}
/* there needs to be support for Unicode here,
* unless we pretend that we can redefine the MD-5
* algorithm for multi-byte characters (perhaps
* by adding every four 16-bit characters and
* shortening the sum to 32 bits). Otherwise
* I suggest performing MD-5 as if every character
* was two bytes--e.g., 0040 0025 = @%--but then
* how will an ordinary MD-5 sum be matched?
* There is no way to standardize text to something
* like UTF-8 before transformation; speed cost is
* utterly prohibitive. The JavaScript standard
* itself needs to look at this: it should start
* providing access to strings as preformed UTF-8
* 8-bit unsigned value arrays.
*/
function md5blk(s) { /* I figured global was faster. */
var md5blks = [], i; /* Andy King said do it this way. */
for (i=0; i<64; i+=4) {
md5blks[i>>2] = s.charCodeAt(i)
+ (s.charCodeAt(i+1) << 8)
+ (s.charCodeAt(i+2) << 16)
+ (s.charCodeAt(i+3) << 24);
}
return md5blks;
}
var hex_chr = '0123456789abcdef'.split('');
function rhex(n)
{
var s='', j=0;
for(; j<4; j++)
s += hex_chr[(n >> (j * 8 + 4)) & 0x0F]
+ hex_chr[(n >> (j * 8)) & 0x0F];
return s;
}
function hex(x) {
for (var i=0; i<x.length; i++)
x[i] = rhex(x[i]);
return x.join('');
}
function md5(s) {
return hex(md51(s));
}
/* this function is much faster,
so if possible we use it. Some IEs
are the only ones I know of that
need the idiotic second function,
generated by an if clause. */
function add32(a, b) {
return (a + b) & 0xFFFFFFFF;
}
if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {
function add32(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
}
/*! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)
}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
/*! jQuery UI - v1.12.1 - 2017-01-30
* http://jqueryui.com
* Includes: widget.js, data.js, disable-selection.js, jquery-1-7.js, scroll-parent.js, widgets/sortable.js, widgets/mouse.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var s=!1;t(document).on("mouseup",function(){s=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,s=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td> </td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])
},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}});var n="ui-effects-",o="ui-effects-style",a="ui-effects-animated",r=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(r),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(r.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(a)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(n+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,o=e.length;o>s;s++)null!==e[s]&&(i=t.data(n+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(o,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(o)||"",t.removeData(o)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),o=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(n+"placeholder",i)),e.css({position:s,left:o.left,top:o.top}),i},removePlaceholder:function(t){var e=n+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){l.removeData(a),t.effects.cleanUp(l),"hide"===s.mode&&l.hide(),r()}function r(){t.isFunction(h)&&h.call(l[0]),t.isFunction(e)&&e()}var l=t(this);s.mode=u.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(l[c](),r()):n.call(l[0],s,i):(l.is(":hidden")?"hide"===c:"show"===c)?(l[c](),r()):n.call(l[0],s,r)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,r=s.queue,l=r||"fx",h=s.complete,c=s.mode,u=[],d=function(e){var i=t(this),s=t.effects.mode(i,c)||o;i.data(a,!0),u.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?c?this[c](s.duration,h):this.each(function(){h&&h.call(this)}):r===!1?this.each(d).each(i):this.queue(l,d).queue(l,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,l=o?a.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var l=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},l=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),l&&l.css(t.effects.clipToBox(r)),r.clip=a),l&&l.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,l="hide"===r,h="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(h||l?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),h&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),l&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=l?2*u:u/2;l&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,l=r||"horizontal"===a,h=r||"vertical"===a;s=o.cssClip(),n.clip={top:h?(s.bottom-s.top)/2:s.top,right:l?(s.right-s.left)/2:s.right,bottom:h?(s.bottom-s.top)/2:s.bottom,left:l?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r?"-=":"+=",c="+="===h?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,u[l]=h+s,a&&(n.css(u),u[l]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(l=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,h=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?h*_:0),top:l+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:h*_),top:l+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,l=/([0-9]+)%/.exec(r),h=!!e.horizFirst,c=h?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;l&&(r=parseInt(l[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,l,n.from.y,_),v=t.effects.setTransition(a,l,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,h,n.from.x,_),v=t.effects.setTransition(a,h,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(l=l.concat(["marginTop","marginBottom"]).concat(r),h=h.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,l,n.from.y,o),a=t.effects.setTransition(i,l,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,h,n.from.x,o),a=t.effects.setTransition(i,h,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,l=2*(e.times||5)+(r?1:0),h=e.duration/l,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);l>u;u++)s.animate({opacity:c},h,e.easing),c=1-c;s.animate({opacity:c},h,e.easing),s.queue(i),t.effects.unshift(s,d,l+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,l=2*r+1,h=Math.round(e.duration/l),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,h,e.easing);r>s;s++)n.animate(p,h,e.easing).animate(f,h,e.easing);n.animate(p,h,e.easing).animate(d,h/2,e.easing).queue(i),t.effects.unshift(n,g,l+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u=e.distance||o["top"===h?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[h],d[h]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[l][1]]=d.clip[a[l][0]],"show"===r&&(o.cssClip(d.clip),o.css(h,d[h]),d.clip=s,d[h]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var l;t.uiBackCompat!==!1&&(l=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)}))});
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){
var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
!function(){"use strict";var e=0;function Et(t){return t.ol_uid||(t.ol_uid=++e)}var n=function(i){function t(t){var e="Assertion failed. See https://openlayers.org/en/"+"5.1.3".split("-")[0]+"/doc/errors/#"+t+" for details.";i.call(this,e),this.code=t,this.name="AssertionError",this.message=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Error),h="add",l="remove",a="propertychange",C="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,o=arguments.length;n<o;++n){var s=i[n];if(null!=s)for(var a in s)s.hasOwnProperty(a)&&(r[a]=s[a])}return r};function _(t){for(var e in t)delete t[e]}function o(t){var e=[];for(var i in t)e.push(t[i]);return e}function Tt(t){var e;for(e in t)return!1;return!e}function u(t,e,i,r){for(var n,o=0,s=t.length;o<s;++o)if((n=t[o]).listener===e&&n.bindTo===i)return r&&(n.deleteIndex=o),n}function s(t,e){var i=t.ol_lm;return i?i[e]:void 0}function c(t){var e=t.ol_lm;return e||(e=t.ol_lm={}),e}function r(t,e){var i=s(t,e);if(i){for(var r=0,n=i.length;r<n;++r)t.removeEventListener(e,i[r].boundListener),_(i[r]);i.length=0;var o=t.ol_lm;o&&(delete o[e],0===Object.keys(o).length&&delete t.ol_lm)}}function E(t,e,i,r,n){var o=c(t),s=o[e];s||(s=o[e]=[]);var a,h,l=u(s,i,r,!1);return l?n||(l.callOnce=!1):(l={bindTo:r,callOnce:!!n,listener:i,target:t,type:e},t.addEventListener(e,(h=function(t){var e=a.listener,i=a.bindTo||a.target;return a.callOnce&&g(a),e.call(i,t)},(a=l).boundListener=h)),s.push(l)),l}function p(t,e,i,r){return E(t,e,i,r,!0)}function d(t,e,i,r){var n=s(t,e);if(n){var o=u(n,i,r,!0);o&&g(o)}}function g(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var e=s(t.target,t.type);if(e){var i="deleteIndex"in t?t.deleteIndex:e.indexOf(t);-1!==i&&e.splice(i,1),0===e.length&&r(t.target,t.type)}_(t)}}function f(t){var e=c(t);for(var i in e)r(t,i)}function y(){return!0}function v(){return!1}function L(){}var t=function(){};t.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t.prototype.disposed_=!1,t.prototype.disposeInternal=L;var m=function(t){this.propagationStopped,this.type=t,this.target=null};function x(t){t.stopPropagation()}m.prototype.preventDefault=function(){this.propagationStopped=!0},m.prototype.stopPropagation=function(){this.propagationStopped=!0};var i=function(t){function e(){t.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.addEventListener=function(t,e){var i=this.listeners_[t];i||(i=this.listeners_[t]=[]),-1===i.indexOf(e)&&i.push(e)},e.prototype.dispatchEvent=function(t){var e,i="string"==typeof t?new m(t):t,r=i.type,n=(i.target=this).listeners_[r];if(n){r in this.dispatching_||(this.dispatching_[r]=0,this.pendingRemovals_[r]=0),++this.dispatching_[r];for(var o=0,s=n.length;o<s;++o)if(!1===n[o].call(this,i)||i.propagationStopped){e=!1;break}if(--this.dispatching_[r],0===this.dispatching_[r]){var a=this.pendingRemovals_[r];for(delete this.pendingRemovals_[r];a--;)this.removeEventListener(r,L);delete this.dispatching_[r]}return e}},e.prototype.disposeInternal=function(){f(this)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:0<Object.keys(this.listeners_).length},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var r=i.indexOf(e);t in this.pendingRemovals_?(i[r]=L,++this.pendingRemovals_[t]):(i.splice(r,1),0===i.length&&delete this.listeners_[t])}},e}(t),w={CHANGE:"change",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"},S=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.changed=function(){++this.revision_,this.dispatchEvent(w.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=E(this,t[n],e);return r}return E(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=p(this,t[n],e);return r}return p(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)d(this,t[i],e);else d(this,t,e)},e}(i);var T=function(r){function t(t,e,i){r.call(this,t),this.key=e,this.oldValue=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),R=function(e){function t(t){e.call(this),Et(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return C({},this.values_)},t.prototype.notify=function(t,e){var i;i=b(t),this.dispatchEvent(new T(i,t,e)),i=a,this.dispatchEvent(new T(i,t,e))},t.prototype.set=function(t,e,i){if(i)this.values_[t]=e;else{var r=this.values_[t];r!==(this.values_[t]=e)&&this.notify(t,r)}},t.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},t.prototype.unset=function(t,e){if(t in this.values_){var i=this.values_[t];delete this.values_[t],e||this.notify(t,i)}},t}(S),I={};function b(t){return I.hasOwnProperty(t)?I[t]:I[t]="change:"+t}var P="length",F=function(i){function t(t,e){i.call(this,t),this.element=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(m),M=function(o){function t(t,e){o.call(this);var i=e||{};if(this.unique_=!!i.unique,this.array_=t||[],this.unique_)for(var r=0,n=this.array_.length;r<n;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}return o&&(t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).prototype.clear=function(){for(;0<this.getLength();)this.pop()},t.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},t.prototype.forEach=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)t(e[i],i,e)},t.prototype.getArray=function(){return this.array_},t.prototype.item=function(t){return this.array_[t]},t.prototype.getLength=function(){return this.get(P)},t.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new F(h,e))},t.prototype.pop=function(){return this.removeAt(this.getLength()-1)},t.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},t.prototype.remove=function(t){for(var e=this.array_,i=0,r=e.length;i<r;++i)if(e[i]===t)return this.removeAt(i)},t.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new F(l,e)),e},t.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new F(l,r)),this.dispatchEvent(new F(h,e))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},t.prototype.updateLength_=function(){this.set(P,this.array_.length)},t.prototype.assertUnique_=function(t,e){for(var i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===t&&i!==e)throw new n(58)},t}(R);function Z(t,e){if(!t)throw new n(e)}var O={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},N={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function A(t){for(var e=B(),i=0,r=t.length;i<r;++i)q(e,t[i]);return e}function G(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 k(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function D(t,e,i){var r,n;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function j(t,e){return U(t,e[0],e[1])}function Q(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function U(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Y(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=e[0],a=e[1],h=N.UNKNOWN;return s<i?h|=N.LEFT:n<s&&(h|=N.RIGHT),a<r?h|=N.BELOW:o<a&&(h|=N.ABOVE),h===N.UNKNOWN&&(h=N.INTERSECTING),h}function B(){return[1/0,1/0,-1/0,-1/0]}function X(t,e,i,r,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=r,n):[t,e,i,r]}function z(t){return X(1/0,1/0,-1/0,-1/0,t)}function V(t,e){var i=t[0],r=t[1];return X(i,r,i,r,e)}function W(t,e){return function(t,e){for(var i=0,r=e.length;i<r;++i)q(t,e[i]);return t}(z(e),t)}function K(t,e,i,r,n){return J(z(n),t,e,i,r)}function $(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function H(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 q(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 J(t,e,i,r,n){for(;i<r;i+=n)tt(t,e[i],e[i+1]);return t}function tt(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 et(t,e,i){var r;return(r=e.call(i,rt(t)))?r:(r=e.call(i,nt(t)))?r:(r=e.call(i,ut(t)))?r:(r=e.call(i,lt(t)))||!1}function it(t){var e=0;return pt(t)||(e=ct(t)*at(t)),e}function rt(t){return[t[0],t[1]]}function nt(t){return[t[2],t[1]]}function ot(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function st(t,e,i,r,n){var o=e*r[0]/2,s=e*r[1]/2,a=Math.cos(i),h=Math.sin(i),l=o*a,u=o*h,c=s*a,p=s*h,d=t[0],f=t[1],_=d-l+p,g=d-l-p,y=d+l-p,v=d+l+p,m=f-u-c,x=f-u+c,S=f+u+c,C=f+u-c;return X(Math.min(_,g,y,v),Math.min(m,x,S,C),Math.max(_,g,y,v),Math.max(m,x,S,C),n)}function at(t){return t[3]-t[1]}function ht(t,e,i){var r=i||[1/0,1/0,-1/0,-1/0];return wt(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):z(r),r}function lt(t){return[t[0],t[3]]}function ut(t){return[t[2],t[3]]}function ct(t){return t[2]-t[0]}function wt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function pt(t){return t[2]<t[0]||t[3]<t[1]}function dt(t,e){var i=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=r,t[3]+=r}function ft(t,e,i){var r,n,o,s=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(s,s,2),r=[s[0],s[2],s[4],s[6]],n=[s[1],s[3],s[5],s[7]],o=i,X(Math.min.apply(null,r),Math.min.apply(null,n),Math.max.apply(null,r),Math.max.apply(null,n),o)}function Rt(t,e,i,r,n,o){for(var s=o||[],a=0,h=e;h<i;h+=r){var l=t[h],u=t[h+1];s[a++]=n[0]*l+n[2]*u+n[4],s[a++]=n[1]*l+n[3]*u+n[5]}return o&&s.length!=a&&(s.length=a),s}function _t(t,e,i,r,n,o,s){for(var a=s||[],h=0,l=e;l<i;l+=r){a[h++]=t[l]+n,a[h++]=t[l+1]+o;for(var u=l+2;u<l+r;++u)a[h++]=t[u]}return s&&a.length!=h&&(a.length=h),a}function gt(t,e,i){return Math.min(Math.max(t,e),i)}var yt="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function vt(t,e,i,r,n,o){var s=n-i,a=o-r;if(0!==s||0!==a){var h=((t-i)*s+(e-r)*a)/(s*s+a*a);1<h?(i=n,r=o):0<h&&(i+=s*h,r+=a*h)}return mt(t,e,i,r)}function mt(t,e,i,r){var n=i-t,o=r-e;return n*n+o*o}function xt(t){return 180*t/Math.PI}function St(t){return t*Math.PI/180}function Ct(t,e){var i=t%e;return i*e<0?i+e:i}function It(t,e,i){return t+i*(e-t)}var Lt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},bt=6371008.8;function Pt(t,e,i){var r=i||bt,n=St(t[1]),o=St(e[1]),s=(o-n)/2,a=St(e[0]-t[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}function Ft(t,e){for(var i=0,r=0,n=t.length;r<n-1;++r)i+=Pt(t[r],t[r+1],e);return i}function Mt(t,e){for(var i=0,r=t.length,n=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var a=t[s][0],h=t[s][1];i+=St(a-n)*(2+Math.sin(St(o))+Math.sin(St(h))),n=a,o=h}return i*e*e/2}var Ot={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Nt={};Nt[Ot.DEGREES]=2*Math.PI*6370997/360,Nt[Ot.FEET]=.3048,Nt[Ot.METERS]=1,Nt[Ot.USFEET]=1200/3937;var At=function(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};At.prototype.canWrapX=function(){return this.canWrapX_},At.prototype.getCode=function(){return this.code_},At.prototype.getExtent=function(){return this.extent_},At.prototype.getUnits=function(){return this.units_},At.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Nt[this.units_]},At.prototype.getWorldExtent=function(){return this.worldExtent_},At.prototype.getAxisOrientation=function(){return this.axisOrientation_},At.prototype.isGlobal=function(){return this.global_},At.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},At.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},At.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},At.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},At.prototype.setWorldExtent=function(t){this.worldExtent_=t},At.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},At.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Gt=6378137,kt=Math.PI*Gt,Dt=[-kt,-kt,kt,kt],jt=[-180,-85,180,85],Ut=function(e){function t(t){e.call(this,{code:t,units:Ot.METERS,extent:Dt,global:!0,worldExtent:jt,getPointResolution:function(t,e){return t/yt(e[1]/Gt)}})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(At),Yt=[new Ut("EPSG:3857"),new Ut("EPSG:102100"),new Ut("EPSG:102113"),new Ut("EPSG:900913"),new Ut("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ut("urn:ogc:def:crs:EPSG::3857"),new Ut("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Bt(t,e,i){var r=t.length,n=1<i?i:2,o=e;void 0===o&&(o=2<n?t.slice():new Array(r));for(var s=kt,a=0;a<r;a+=n){o[a]=s*t[a]/180;var h=Gt*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));s<h?h=s:h<-s&&(h=-s),o[a+1]=h}return o}function Xt(t,e,i){var r=t.length,n=1<i?i:2,o=e;void 0===o&&(o=2<n?t.slice():new Array(r));for(var s=0;s<r;s+=n)o[s]=180*t[s]/kt,o[s+1]=360*Math.atan(Math.exp(t[s+1]/Gt))/Math.PI-90;return o}var zt=[-180,-90,180,90],Vt=6378137*Math.PI/180,Wt=function(i){function t(t,e){i.call(this,{code:t,units:Ot.DEGREES,extent:zt,axisOrientation:e,global:!0,metersPerUnit:Vt,worldExtent:zt})}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(At),Kt=[new Wt("CRS:84"),new Wt("EPSG:4326","neu"),new Wt("urn:ogc:def:crs:EPSG::4326","neu"),new Wt("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Wt("urn:ogc:def:crs:OGC:1.3:CRS84"),new Wt("urn:ogc:def:crs:OGC:2:84"),new Wt("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Wt("urn:x-ogc:def:crs:EPSG:4326","neu")],Ht={};var Zt,qt,Jt,Qt={};function $t(t,e,i){var r=t.getCode(),n=e.getCode();r in Qt||(Qt[r]={}),Qt[r][n]=i}function te(t,e){var i;return t in Qt&&e in Qt[t]&&(i=Qt[t][e]),i}function ee(t,e,i){var r;if(void 0!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];r=e}else r=t.slice();return r}function ie(t,e,i){if(void 0!==e&&t!==e){for(var r=0,n=t.length;r<n;++r)e[r]=t[r];t=e}return t}function re(t){var e,i;e=t.getCode(),i=t,Ht[e]=i,$t(t,t,ee)}function ne(t){var e=null;if(t instanceof At)e=t;else if("string"==typeof t){e=Ht[t]||null}return e}function oe(t,e,i,r){var n,o=(t=ne(t)).getPointResolutionFunc();if(o)n=o(e,i);else if(t.getUnits()==Ot.DEGREES&&!r||r==Ot.DEGREES)n=e;else{var s=ce(t,ne("EPSG:4326")),a=[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=(Pt((a=s(a,a,2)).slice(0,2),a.slice(2,4))+Pt(a.slice(4,6),a.slice(6,8)))/2;var h=r?Nt[r]:t.getMetersPerUnit();void 0!==h&&(n/=h)}return n}function se(t){t.forEach(re),t.forEach(function(e){t.forEach(function(t){e!==t&&$t(e,t,ee)})})}function ae(t,e){return t?"string"==typeof t?ne(t):t:ne(e)}function he(l){return function(t,e,i){for(var r=t.length,n=void 0!==i?i:2,o=void 0!==e?e:new Array(r),s=0;s<r;s+=n){var a=l([t[s],t[s+1]]);o[s]=a[0],o[s+1]=a[1];for(var h=n-1;2<=h;--h)o[s+h]=t[s+h]}return o}}function le(t,e,i,r){var n=ne(t),o=ne(e);$t(n,o,he(i)),$t(o,n,he(r))}function ue(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:ce(t,e)===ee&&i}function ce(t,e){var i=te(t.getCode(),e.getCode());return i||(i=ie),i}function pe(t,e){return ce(ne(t),ne(e))}function de(t,e,i){return pe(e,i)(t,void 0,t.length)}function fe(t,e,i){return ft(t,pe(e,i))}se(Yt),se(Kt),Zt=Yt,qt=Bt,Jt=Xt,Kt.forEach(function(e){Zt.forEach(function(t){$t(e,t,qt),$t(t,e,Jt)})});var _e=new Array(6);function ge(t){return ve(t,1,0,0,1,0,0)}function ye(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],h=e[0],l=e[1],u=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*h+n*l,t[1]=r*h+o*l,t[2]=i*u+n*c,t[3]=r*u+o*c,t[4]=i*p+n*d+s,t[5]=r*p+o*d+a,t}function ve(t,e,i,r,n,o,s){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=o,t[5]=s,t}function me(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function xe(t,e){var i=e[0],r=e[1];return e[0]=t[0]*i+t[2]*r+t[4],e[1]=t[1]*i+t[3]*r+t[5],e}function Se(t,e){var i=Math.cos(e),r=Math.sin(e);return ye(t,ve(_e,i,r,-r,i,0,0))}function Ce(t,e,i){return ye(t,ve(_e,e,0,0,i,0,0))}function Ee(t,e,i){return ye(t,ve(_e,1,0,0,1,e,i))}function Te(t,e,i,r,n,o,s,a){var h=Math.sin(o),l=Math.cos(o);return t[0]=r*l,t[1]=n*h,t[2]=-r*h,t[3]=n*l,t[4]=s*r*l-a*r*h+e,t[5]=s*n*h+a*n*l+i,t}function we(t){var e,i=(e=t)[0]*e[3]-e[1]*e[2];Z(0!==i,32);var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5];return t[0]=s/i,t[1]=-n/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*h-s*a)/i,t[5]=-(r*h-n*a)/i,t}var Re=[1,0,0,1,0,0],Ie=function(t){function e(){t.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.clone=function(){},e.prototype.closestPointXY=function(t,e,i,r){},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){},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),e=this.extent_,(i=t)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i):e;var e,i},e.prototype.rotate=function(t,e){},e.prototype.scale=function(t,e,i){},e.prototype.translate=function(t,e){},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){},e.prototype.getType=function(){},e.prototype.applyTransform=function(t){},e.prototype.intersectsExtent=function(t){},e.prototype.translate=function(t,e){},e.prototype.transform=function(s,a){var t=(s=ne(s)).getUnits()==Ot.TILE_PIXELS?function(t,e,i){var r=s.getExtent(),n=s.getWorldExtent(),o=at(n)/at(r);return Te(Re,n[0],n[3],o,-o,0,0,0),Rt(t,0,t.length,i,Re,e),pe(s,a)(t,e,i)}:pe(s,a);return this.applyTransform(t),this},e}(R);Ie.prototype.containsXY=v;var Le=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,be=/^([a-z]*)$/i;function Pe(t){return"string"==typeof t?t:Ge(t)}var Fe,Me,Oe=(Fe={},Me=0,function(t){var e;if(Fe.hasOwnProperty(t))e=Fe[t];else{if(1024<=Me){var i=0;for(var r in Fe)0==(3&i++)&&(delete Fe[r],--Me)}e=function(t){var e,i,r,n,o;if(be.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)),Le.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var h=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),n=h?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,r=(r<<4)+r,h&&(n=(n<<4)+n)),o=[e,i,r,n/255]}else 0==t.indexOf("rgba(")?Ae(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Ae(o)):Z(!1,14);return o}(t),Fe[t]=e,++Me}return e});function Ne(t){return Array.isArray(t)?t:Oe(t)}function Ae(t){return t[0]=gt(t[0]+.5|0,0,255),t[1]=gt(t[1]+.5|0,0,255),t[2]=gt(t[2]+.5|0,0,255),t[3]=gt(t[3],0,1),t}function Ge(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+i+","+r+","+(void 0===t[3]?1:t[3])+")"}function ke(t){return"string"==typeof(e=t)||e instanceof CanvasPattern||e instanceof CanvasGradient?t:Ge(t);var e}function De(t,e){var i=document.createElement("CANVAS");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function je(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function Ue(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Ye(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var Be,Xe,ze=34962,Ve=5126,We=10242,Ke=10243,He=3553,Ze=33071,qe=36160,Je=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Qe(t,e){for(var i=Je.length,r=0;r<i;++r)try{var n=t.getContext(Je[r],e);if(n)return n}catch(t){}return null}if("undefined"!=typeof window&&"WebGLRenderingContext"in window)try{var $e=Qe(document.createElement("CANVAS"),{failIfMajorPerformanceCaveat:!0});$e&&(Be=$e.getParameter($e.MAX_TEXTURE_SIZE),Xe=$e.getSupportedExtensions())}catch(t){}var ti,ei,ii="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",ri=-1!==ii.indexOf("firefox"),ni=-1!==ii.indexOf("safari")&&-1==ii.indexOf("chrom"),oi=-1!==ii.indexOf("webkit")&&-1==ii.indexOf("edge"),si=-1!==ii.indexOf("macintosh"),ai=window.devicePixelRatio||1,hi=function(){var t=!1;try{t=!!document.createElement("CANVAS").getContext("2d").setLineDash}catch(t){}return t}(),li="geolocation"in navigator,ui="ontouchstart"in window,ci="PointerEvent"in window,pi=!!navigator.msPointerEnabled,di={IDLE:0,LOADING:1,LOADED:2,ERROR:3},fi="ol-hidden",_i="ol-unselectable",gi="ol-control",yi="ol-collapsed",vi=(ei={},function(t){if(ti||(ti=document.createElement("div").style),!(t in ei)){ti.font=t;var e=ti.fontFamily;if(ti.font="",!e)return null;ei[t]=e.split(/,\s?/)}return ei[t]}),mi=function(e){function t(t){e.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(w.CLEAR)},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(t){var e=this.entries_[t];return Z(void 0!==e,15),e===this.newest_?e.value_:(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,(this.newest_=e).value_)},t.prototype.remove=function(t){var e=this.entries_[t];return Z(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){Z(!(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.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(i),xi="10px sans-serif",Si=[0,0,0,1],Ci="round",Ei=[],Ti="round",wi=[0,0,0,1],Ri="center",Ii=[0,0,0,0],Li=new mi,bi={},Pi=null,Fi={},Mi=function(){var o,s,a=60,h=bi,l="32px ",u=["monospace","serif"],c=u.length,p="wmytzilWMYTZIL@#/&?$%10";function d(t){for(var e=Oi(),i=!0,r=0;r<c;++r){var n=u[r];if(e.font=l+n,s=e.measureText(p).width,t!=n){e.font=l+t+","+n;var o=e.measureText(p).width;i=i&&o!=s}}return i}function f(){var t=!0;for(var e in h)h[e]<a&&(d(e)?(h[e]=a,_(Fi),Pi=null,Li.clear()):(++h[e],t=!1));t&&(clearInterval(o),o=void 0)}return function(t){var e=vi(t);if(e)for(var i=0,r=e.length;i<r;++i){var n=e[i];n in h||(h[n]=a,d(n)||void(h[n]=0)===o&&(o=setInterval(f,32)))}}}();function Oi(){return Pi||(Pi=De(1,1)),Pi}var Ni,Ai,Gi=(Ai=Fi,function(t){var e=Ai[t];return null==e&&(Ni||((Ni=document.createElement("span")).textContent="M",Ni.style.margin=Ni.style.padding="0 !important",Ni.style.position="absolute !important",Ni.style.left="-99999px !important"),Ni.style.font=t,document.body.appendChild(Ni),e=Ai[t]=Ni.offsetHeight,document.body.removeChild(Ni)),e});function ki(t,e){var i=Oi();return t!=i.font&&(i.font=t),i.measureText(e).width}function Di(t,e,i,r){0!==e&&(t.translate(i,r),t.rotate(e),t.translate(-i,-r))}var ji=[1,0,0,1,0,0];function Ui(t,e,i,r,n,o,s,a,h,l,u){var c;1!=i&&(c=t.globalAlpha,t.globalAlpha=c*i),e&&t.setTransform.apply(t,e),t.drawImage(r,n,o,s,a,h,l,s*u,a*u),c&&(t.globalAlpha=c),e&&t.setTransform.apply(t,ji)}var Yi=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};Yi.prototype.getOpacity=function(){return this.opacity_},Yi.prototype.getRotateWithView=function(){return this.rotateWithView_},Yi.prototype.getRotation=function(){return this.rotation_},Yi.prototype.getScale=function(){return this.scale_},Yi.prototype.getSnapToPixel=function(){return this.snapToPixel_},Yi.prototype.getAnchor=function(){},Yi.prototype.getImage=function(t){},Yi.prototype.getHitDetectionImage=function(t){},Yi.prototype.getImageState=function(){},Yi.prototype.getImageSize=function(){},Yi.prototype.getHitDetectionImageSize=function(){},Yi.prototype.getOrigin=function(){},Yi.prototype.getSize=function(){},Yi.prototype.setOpacity=function(t){this.opacity_=t},Yi.prototype.setRotateWithView=function(t){this.rotateWithView_=t},Yi.prototype.setRotation=function(t){this.rotation_=t},Yi.prototype.setScale=function(t){this.scale_=t},Yi.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},Yi.prototype.listenImageChange=function(t,e){},Yi.prototype.load=function(){},Yi.prototype.unlistenImageChange=function(t,e){};var Bi=function(r){function e(t){var e=void 0===t.snapToPixel||t.snapToPixel,i=void 0!==t.rotateWithView&&t.rotateWithView;r.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:e}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_)}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},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(t){return this.hitDetectionCanvas_},e.prototype.getImage=function(t){return this.canvas_},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return di.LOADED},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){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t,e){},e.prototype.render_=function(t){var e,i,r="",n="",o=0,s=null,a=0,h=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=wi),i=ke(i),void 0===(h=this.stroke_.getWidth())&&(h=1),s=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),hi||(s=null,a=0),void 0===(n=this.stroke_.getLineJoin())&&(n=Ti),void 0===(r=this.stroke_.getLineCap())&&(r=Ci),void 0===(o=this.stroke_.getMiterLimit())&&(o=10));var l=2*(this.radius_+h)+1,u={strokeStyle:i,strokeWidth:h,size:l,lineCap:r,lineDash:s,lineDashOffset:a,lineJoin:n,miterLimit:o};if(void 0===t){var c=De(l,l);this.canvas_=c.canvas,e=l=this.canvas_.width,this.draw_(u,c,0,0),this.createHitDetectionCanvas_(u)}else{l=Math.round(l);var p,d=!this.fill_;d&&(p=this.drawHitDetectionCanvas_.bind(this,u));var f=this.getChecksum(),_=t.add(f,l,l,this.draw_.bind(this,u),p);this.canvas_=_.image,this.origin_=[_.offsetX,_.offsetY],e=_.image.width,d?(this.hitDetectionCanvas_=_.hitImage,this.hitDetectionImageSize_=[_.hitImage.width,_.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[e,e])}this.anchor_=[l/2,l/2],this.size_=[l,l],this.imageSize_=[e,e]},e.prototype.draw_=function(t,e,i,r){var n,o,s;e.setTransform(1,0,0,1,0,0),e.translate(i,r),e.beginPath();var a=this.points_;if(a===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(a*=2),n=0;n<=a;n++)o=2*n*Math.PI/a-Math.PI/2+this.angle_,s=n%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(o),t.size/2+s*Math.sin(o))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l=Si),e.fillStyle=ke(l),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var e=De(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e,0,0)}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,r){e.setTransform(1,0,0,1,0,0),e.translate(i,r),e.beginPath();var n=this.points_;if(n===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o,s,a,h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(n*=2),o=0;o<=n;o++)a=2*o*Math.PI/n-Math.PI/2+this.angle_,s=o%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}e.fillStyle=Si,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",e=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,t,e,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},e}(Yi),Xi=function(i){function e(t){var e=t||{};i.call(this,{points:1/0,fill:e.fill,radius:e.radius,snapToPixel:e.snapToPixel,stroke:e.stroke,atlasManager:e.atlasManager})}return i&&(e.__proto__=i),((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)},e}(Bi),zi=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.checksum_=void 0};zi.prototype.clone=function(){var t=this.getColor();return new zi({color:t&&t.slice?t.slice():t||void 0})},zi.prototype.getColor=function(){return this.color_},zi.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},zi.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?this.checksum_=Et(this.color_).toString():this.checksum_="f"+(this.color_?Pe(this.color_):"-")),this.checksum_};var Vi=function(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,this.checksum_=void 0};Vi.prototype.clone=function(){var t=this.getColor();return new Vi({color:t&&t.slice?t.slice():t||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()})},Vi.prototype.getColor=function(){return this.color_},Vi.prototype.getLineCap=function(){return this.lineCap_},Vi.prototype.getLineDash=function(){return this.lineDash_},Vi.prototype.getLineDashOffset=function(){return this.lineDashOffset_},Vi.prototype.getLineJoin=function(){return this.lineJoin_},Vi.prototype.getMiterLimit=function(){return this.miterLimit_},Vi.prototype.getWidth=function(){return this.width_},Vi.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},Vi.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},Vi.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},Vi.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},Vi.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},Vi.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},Vi.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},Vi.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=Et(this.color_).toString():this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var Wi=function(t){var e=t||{};this.geometry_=null,this.geometryFunction_=qi,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.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex};Wi.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new Wi({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Wi.prototype.getRenderer=function(){return this.renderer_},Wi.prototype.setRenderer=function(t){this.renderer_=t},Wi.prototype.getGeometry=function(){return this.geometry_},Wi.prototype.getGeometryFunction=function(){return this.geometryFunction_},Wi.prototype.getFill=function(){return this.fill_},Wi.prototype.setFill=function(t){this.fill_=t},Wi.prototype.getImage=function(){return this.image_},Wi.prototype.setImage=function(t){this.image_=t},Wi.prototype.getStroke=function(){return this.stroke_},Wi.prototype.setStroke=function(t){this.stroke_=t},Wi.prototype.getText=function(){return this.text_},Wi.prototype.setText=function(t){this.text_=t},Wi.prototype.getZIndex=function(){return this.zIndex_},Wi.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=qi,this.geometry_=e},Wi.prototype.setZIndex=function(t){this.zIndex_=t};var Ki=null;function Hi(t,e){if(!Ki){var i=new zi({color:"rgba(255,255,255,0.4)"}),r=new Vi({color:"#3399CC",width:1.25});Ki=[new Wi({image:new Xi({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return Ki}function Zi(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Lt.POLYGON]=[new Wi({fill:new zi({color:[255,255,255,.5]})})],t[Lt.MULTI_POLYGON]=t[Lt.POLYGON],t[Lt.LINE_STRING]=[new Wi({stroke:new Vi({color:e,width:5})}),new Wi({stroke:new Vi({color:i,width:3})})],t[Lt.MULTI_LINE_STRING]=t[Lt.LINE_STRING],t[Lt.CIRCLE]=t[Lt.POLYGON].concat(t[Lt.LINE_STRING]),t[Lt.POINT]=[new Wi({image:new Xi({radius:6,fill:new zi({color:i}),stroke:new Vi({color:e,width:1.5})}),zIndex:1/0})],t[Lt.MULTI_POINT]=t[Lt.POINT],t[Lt.GEOMETRY_COLLECTION]=t[Lt.POLYGON].concat(t[Lt.LINE_STRING],t[Lt.POINT]),t}function qi(t){return t.getGeometry()}var Ji=function(r){function n(t){if(r.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,E(this,b(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t)if(t instanceof Ie||!t){var e=t;this.setGeometry(e)}else{var i=t;this.setProperties(i)}}return r&&(n.__proto__=r),((n.prototype=Object.create(r&&r.prototype)).constructor=n).prototype.clone=function(){var t=new n(this.getProperties());t.setGeometryName(this.getGeometryName());var e=this.getGeometry();e&&t.setGeometry(e.clone());var i=this.getStyle();return i&&t.setStyle(i),t},n.prototype.getGeometry=function(){return this.get(this.geometryName_)},n.prototype.getId=function(){return this.id_},n.prototype.getGeometryName=function(){return this.geometryName_},n.prototype.getStyle=function(){return this.style_},n.prototype.getStyleFunction=function(){return this.styleFunction_},n.prototype.handleGeometryChange_=function(){this.changed()},n.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(g(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=E(t,w.CHANGE,this.handleGeometryChange_,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},n.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){{return"function"==typeof t?t:(Array.isArray(t)?e=t:(Z(t instanceof Wi,41),e=[t]),function(){return e});var e}}(t):void 0,this.changed()},n.prototype.setId=function(t){this.id_=t,this.changed()},n.prototype.setGeometryName=function(t){d(this,b(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,E(this,b(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},n}(R);var Qi="accuracy",$i="accuracyGeometry",tr="altitude",er="altitudeAccuracy",ir="heading",rr="position",nr="projection",or="speed",sr="tracking",ar="trackingOptions";function hr(t,e){return e<t?1:t<e?-1:0}function lr(t,e){return 0<=t.indexOf(e)}function ur(t,e,i){var r,n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;if(0<i){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return n-1}function cr(t,e,i){for(;e<i;){var r=t[e];t[e]=t[i],t[i]=r,++e,--i}}function pr(t,e){for(var i=Array.isArray(e)?e:[e],r=i.length,n=0;n<r;n++)t[t.length]=i[n]}function dr(t,e){for(var i,r=t.length>>>0,n=0;n<r;n++)if(e(i=t[n],n,t))return i;return null}function fr(t,e){var i=t.length;if(i!==e.length)return!1;for(var r=0;r<i;r++)if(t[r]!==e[r])return!1;return!0}function _r(t,i){var e,r=t.length,n=Array(t.length);for(e=0;e<r;e++)n[e]={index:e,value:t[e]};for(n.sort(function(t,e){return i(t.value,e.value)||t.index-e.index}),e=0;e<t.length;e++)t[e]=n[e].value}function gr(i,r){var n;return!i.every(function(t,e){return!r(t,n=e,i)})?n:-1}var yr={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},vr=function(t){function e(){t.call(this),this.layout=yr.XY,this.stride=2,this.flatCoordinates=null}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.computeExtent=function(t){return K(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){},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.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];var i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?this.simplifiedGeometryCache[e]=i:(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=mr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){},e.prototype.setLayout=function(t,e,i){var r;if(t)r=mr(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=yr.XY,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=yr.XY:3==t?e=yr.XYZ:4==t&&(e=yr.XYZM);return e}(r=e.length)}this.layout=t,this.stride=r},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 r=this.getStride();!function(t,e,i,r,n,o,s){for(var a=s||[],h=Math.cos(n),l=Math.sin(n),u=o[0],c=o[1],p=0,d=e;d<i;d+=r){var f=t[d]-u,_=t[d+1]-c;a[p++]=u+f*h-_*l,a[p++]=c+f*l+_*h;for(var g=d+2;g<d+r;++g)a[p++]=t[g]}s&&a.length!=p&&(a.length=p)}(i,0,i.length,r,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var r=e;void 0===r&&(r=t);var n=i;n||(n=ot(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,i,r,n,o,s,a){for(var h=a||[],l=s[0],u=s[1],c=0,p=e;p<i;p+=r){var d=t[p]-l,f=t[p+1]-u;h[c++]=l+n*d,h[c++]=u+o*f;for(var _=p+2;_<p+r;++_)h[c++]=t[_]}a&&h.length!=c&&(h.length=c)}(o,0,o.length,s,t,r,n,o),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var r=this.getStride();_t(i,0,i.length,r,t,e,i),this.changed()}},e}(Ie);function mr(t){var e;return t==yr.XY?e=2:t==yr.XYZ||t==yr.XYM?e=3:t==yr.XYZM&&(e=4),e}function xr(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=s*a-o*h,o=a,s=h}return n/2}function Sr(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=xr(t,e,a,r),e=a}return n}function Cr(t,e,i,r,n,o,s){var a,h=t[e],l=t[e+1],u=t[i]-h,c=t[i+1]-l;if(0===u&&0===c)a=e;else{var p=((n-h)*u+(o-l)*c)/(u*u+c*c);if(1<p)a=i;else{if(0<p){for(var d=0;d<r;++d)s[d]=It(t[e+d],t[i+d],p);return void(s.length=r)}a=e}}for(var f=0;f<r;++f)s[f]=t[a+f];s.length=r}function Er(t,e,i,r,n){var o=t[e],s=t[e+1];for(e+=r;e<i;e+=r){var a=t[e],h=t[e+1],l=mt(o,s,a,h);n<l&&(n=l),o=a,s=h}return n}function Tr(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=Er(t,e,a,r,n),e=a}return n}function wr(t,e,i,r,n,o,s,a,h,l,u){if(e==i)return l;var c,p;if(0===n){if((p=mt(s,a,t[e],t[e+1]))<l){for(c=0;c<r;++c)h[c]=t[e+c];return h.length=r,p}return l}for(var d=u||[NaN,NaN],f=e+r;f<i;)if(Cr(t,f-r,f,r,s,a,d),(p=mt(s,a,d[0],d[1]))<l){for(l=p,c=0;c<r;++c)h[c]=d[c];f+=h.length=r}else f+=r*Math.max((Math.sqrt(p)-Math.sqrt(l))/n|0,1);if(o&&(Cr(t,i-r,e,r,s,a,d),(p=mt(s,a,d[0],d[1]))<l)){for(l=p,c=0;c<r;++c)h[c]=d[c];h.length=r}return l}function Rr(t,e,i,r,n,o,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=wr(t,e,f,r,n,o,s,a,h,l,c),e=f}return l}function Ir(t,e,i,r){for(var n=0,o=i.length;n<o;++n)t[e++]=i[n];return e}function Lr(t,e,i,r){for(var n=0,o=i.length;n<o;++n)for(var s=i[n],a=0;a<r;++a)t[e++]=s[a];return e}function br(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=Lr(t,e,i[a],r);e=o[s++]=l}return o.length=s,o}function Pr(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=e;a<i;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function Fr(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=Pr(t,e,l,r,o[s]),e=l}return o.length=s,o}function Mr(t,e,i,r,n){for(var o=void 0!==n?n:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];o[s++]=Fr(t,e,l,r,o[s]),e=l[l.length-1]}return o.length=s,o}function Or(t,e,i,r,n,o,s){var a=(i-e)/r;if(a<3){for(;e<i;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var h=new Array(a);h[0]=1,h[a-1]=1;for(var l=[e,i-r],u=0;0<l.length;){for(var c=l.pop(),p=l.pop(),d=0,f=t[p],_=t[p+1],g=t[c],y=t[c+1],v=p+r;v<c;v+=r){var m=vt(t[v],t[v+1],f,_,g,y);d<m&&(u=v,d=m)}n<d&&(h[(u-e)/r]=1,p+r<u&&l.push(p,u),u+r<c&&l.push(u,c))}for(var x=0;x<a;++x)h[x]&&(o[s++]=t[e+x*r],o[s++]=t[e+x*r+1]);return s}function Nr(t,e){return e*Math.round(t/e)}function Ar(t,e,i,r,n,o,s){if(e==i)return s;var a,h,l=Nr(t[e],n),u=Nr(t[e+1],n);e+=r,o[s++]=l,o[s++]=u;do{if(a=Nr(t[e],n),h=Nr(t[e+1],n),(e+=r)==i)return o[s++]=a,o[s++]=h,s}while(a==l&&h==u);for(;e<i;){var c=Nr(t[e],n),p=Nr(t[e+1],n);if(e+=r,c!=a||p!=h){var d=a-l,f=h-u,_=c-l,g=p-u;d*g==f*_&&(d<0&&_<d||d==_||0<d&&d<_)&&(f<0&&g<f||f==g||0<f&&f<g)||(l=o[s++]=a,u=o[s++]=h),a=c,h=p}}return o[s++]=a,o[s++]=h,s}function Gr(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=Ar(t,e,u,r,n,o,s),a.push(s),e=u}return s}vr.prototype.containsXY=v;var kr=function(i){function r(t,e){i.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}return i&&(r.__proto__=i),((r.prototype=Object.create(i&&i.prototype)).constructor=r).prototype.clone=function(){return new r(this.flatCoordinates.slice(),this.layout)},r.prototype.closestPointXY=function(t,e,i,r){return r<D(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),wr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,r))},r.prototype.getArea=function(){return xr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getCoordinates=function(){return Pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=Or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new r(e,yr.XY)},r.prototype.getType=function(){return Lt.LINEAR_RING},r.prototype.intersectsExtent=function(t){},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},r}(vr),Dr=function(i){function t(t,e){i.call(this),this.setCoordinates(t,e)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=mt(t,e,n[0],n[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)i[a]=n[a];return i.length=s,o}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(t){return V(this.flatCoordinates,t)},t.prototype.getType=function(){return Lt.POINT},t.prototype.intersectsExtent=function(t){return U(t,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ir(this.flatCoordinates,0,t,this.stride),this.changed()},t}(vr);function jr(e,i,r,n,t){return!et(t,function(t){return!Ur(e,i,r,n,t[0],t[1])})}function Ur(t,e,i,r,n,o){for(var s=0,a=t[i-r],h=t[i-r+1];e<i;e+=r){var l=t[e],u=t[e+1];h<=o?o<u&&0<(l-a)*(o-h)-(n-a)*(u-h)&&s++:u<=o&&(l-a)*(o-h)-(n-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function Yr(t,e,i,r,n,o){if(0===i.length)return!1;if(!Ur(t,e,i[0],r,n,o))return!1;for(var s=1,a=i.length;s<a;++s)if(Ur(t,i[s-1],i[s],r,n,o))return!1;return!0}function Br(t,e,i,r,n,o,s){for(var a,h,l,u,c,p,d,f=n[o+1],_=[],g=0,y=i.length;g<y;++g){var v=i[g];for(u=t[v-r],p=t[v-r+1],a=e;a<v;a+=r)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(l=(f-p)/(d-p)*(c-u)+u,_.push(l)),u=c,p=d}var m=NaN,x=-1/0;for(_.sort(hr),u=_[0],a=1,h=_.length;a<h;++a){c=_[a];var S=Math.abs(c-u);x<S&&Yr(t,e,i,r,l=(u+c)/2,f)&&(m=l,x=S),u=c}return isNaN(m)&&(m=n[o]),s?(s.push(m,f,x),s):[m,f,x]}function Xr(t,e,i,r,n){for(var o=[],s=0,a=i.length;s<a;++s){var h=i[s];o=Br(t,e,h,r,n,2*s,o),e=h[h.length-1]}return o}function zr(t,e,i,r,n,o){for(var s,a=[t[e],t[e+1]],h=[];e+r<i;e+=r){if(h[0]=t[e+r],h[1]=t[e+r+1],s=n.call(o,a,h))return s;a[0]=h[0],a[1]=h[1]}return!1}function Vr(t,e,i,r,n){var o=J([1/0,1/0,-1/0,-1/0],t,e,i,r);return!!wt(n,o)&&(!!Q(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||zr(t,e,i,r,function(t,e){return function(t,e,i){var r=!1,n=Y(t,e),o=Y(t,i);if(n===N.INTERSECTING||o===N.INTERSECTING)r=!0;else{var s,a,h=t[0],l=t[1],u=t[2],c=t[3],p=e[0],d=e[1],f=i[0],_=i[1],g=(_-d)/(f-p);o&N.ABOVE&&!(n&N.ABOVE)&&(r=h<=(s=f-(_-c)/g)&&s<=u),r||!(o&N.RIGHT)||n&N.RIGHT||(r=l<=(a=_-(f-u)*g)&&a<=c),r||!(o&N.BELOW)||n&N.BELOW||(r=h<=(s=f-(_-l)/g)&&s<=u),r||!(o&N.LEFT)||n&N.LEFT||(r=l<=(a=_-(f-h)*g)&&a<=c)}return r}(n,t,e)}))))}function Wr(t,e,i,r,n){if(o=t,s=e,a=i[0],!(Vr(o,s,a,h=r,l=n)||Ur(o,s,a,h,l[0],l[1])||Ur(o,s,a,h,l[0],l[3])||Ur(o,s,a,h,l[2],l[1])||Ur(o,s,a,h,l[2],l[3])))return!1;var o,s,a,h,l;if(1===i.length)return!0;for(var u=1,c=i.length;u<c;++u)if(jr(t,i[u-1],i[u],r,n))return!1;return!0}function Kr(t,e,i,r){for(;e<i-r;){for(var n=0;n<r;++n){var o=t[e+n];t[e+n]=t[i-r+n],t[i-r+n]=o}e+=r,i-=r}}function Hr(t,e,i,r){for(var n=0,o=t[i-r],s=t[i-r+1];e<i;e+=r){var a=t[e],h=t[e+1];n+=(a-o)*(h+s),o=a,s=h}return 0<n}function Zr(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=Hr(t,e,h,r);if(0===s){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=h}return!0}function qr(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s<a;++s){var h=i[s],l=Hr(t,e,h,r);(0===s?o&&l||!o&&!l:o&&!l||!o&&l)&&Kr(t,e,h,r),e=h}return e}function Jr(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)e=qr(t,e,i[o],r,n);return e}var Qr=function(r){function n(t,e,i){r.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}return r&&(n.__proto__=r),((n.prototype=Object.create(r&&r.prototype)).constructor=n).prototype.appendLinearRing=function(t){this.flatCoordinates?pr(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){return new n(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},n.prototype.closestPointXY=function(t,e,i,r){return r<D(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Rr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))},n.prototype.containsXY=function(t,e){return Yr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},n.prototype.getArea=function(){return Sr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},n.prototype.getCoordinates=function(t){var e;return void 0!==t?qr(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Fr(e,0,this.ends_,this.stride)},n.prototype.getEnds=function(){return this.ends_},n.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=ot(this.getExtent());this.flatInteriorPoint_=Br(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},n.prototype.getInteriorPoint=function(){return new Dr(this.getFlatInteriorPoint(),yr.XYM)},n.prototype.getLinearRingCount=function(){return this.ends_.length},n.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new kr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},n.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o],h=new kr(e.slice(n,a),t);r.push(h),n=a}return r},n.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Zr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=qr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},n.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];return e.length=Gr(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new n(e,yr.XY,i)},n.prototype.getType=function(){return Lt.POLYGON},n.prototype.intersectsExtent=function(t){return Wr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},n.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=br(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},n}(vr);function $r(t,e,i,r){for(var n,o,s,a,h,l,u,c,p=i||32,d=[],f=0;f<p;++f)pr(d,(n=t,o=e,s=2*Math.PI*f/p,void 0,a=r||bt,h=St(n[1]),l=St(n[0]),u=o/a,c=Math.asin(Math.sin(h)*Math.cos(u)+Math.cos(h)*Math.sin(u)*Math.cos(s)),[xt(l+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(h),Math.cos(u)-Math.sin(h)*Math.sin(c))),xt(c)]));return d.push(d[0],d[1]),new Qr(d,yr.XY,[d.length])}function tn(t){var e=t[0],i=t[1],r=t[2],n=t[3],o=[e,i,e,n,r,n,r,i,e,i];return new Qr(o,yr.XY,[o.length])}function en(t,e,i){for(var r=e||32,n=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=n*(r+1),h=new Array(a),l=0;l<a;l+=n){h[l]=0,h[l+1]=0;for(var u=2;u<n;u++)h[l+u]=s[u]}var c=[h.length],p=new Qr(h,o,c);return rn(p,s,t.getRadius(),i),p}function rn(t,e,i,r){for(var n=t.getFlatCoordinates(),o=t.getStride(),s=n.length/o-1,a=r||0,h=0;h<=s;++h){var l=h*o,u=a+2*Ct(h,s)*Math.PI/s;n[l]=e[0]+i*Math.cos(u),n[l+1]=e[1]+i*Math.sin(u)}t.changed()}var nn=function(i){function t(t){i.call(this);var e=t||{};this.position_=null,this.transform_=ie,this.watchId_=void 0,E(this,b(nr),this.handleProjectionChanged_,this),E(this,b(sr),this.handleTrackingChanged_,this),void 0!==e.projection&&this.setProjection(e.projection),void 0!==e.trackingOptions&&this.setTrackingOptions(e.trackingOptions),this.setTracking(void 0!==e.tracking&&e.tracking)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.disposeInternal=function(){this.setTracking(!1),i.prototype.disposeInternal.call(this)},t.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=ce(ne("EPSG:4326"),t),this.position_&&this.set(rr,this.transform_(this.position_)))},t.prototype.handleTrackingChanged_=function(){if(li){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},t.prototype.positionChange_=function(t){var e=t.coords;this.set(Qi,e.accuracy),this.set(tr,null===e.altitude?void 0:e.altitude),this.set(er,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(ir,null===e.heading?void 0:St(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var i=this.transform_(this.position_);this.set(rr,i),this.set(or,null===e.speed?void 0:e.speed);var r=$r(this.position_,e.accuracy);r.applyTransform(this.transform_),this.set($i,r),this.changed()},t.prototype.positionError_=function(t){t.type=w.ERROR,this.setTracking(!1),this.dispatchEvent(t)},t.prototype.getAccuracy=function(){return this.get(Qi)},t.prototype.getAccuracyGeometry=function(){return this.get($i)||null},t.prototype.getAltitude=function(){return this.get(tr)},t.prototype.getAltitudeAccuracy=function(){return this.get(er)},t.prototype.getHeading=function(){return this.get(ir)},t.prototype.getPosition=function(){return this.get(rr)},t.prototype.getProjection=function(){return this.get(nr)},t.prototype.getSpeed=function(){return this.get(or)},t.prototype.getTracking=function(){return this.get(sr)},t.prototype.getTrackingOptions=function(){return this.get(ar)},t.prototype.setProjection=function(t){this.set(nr,ne(t))},t.prototype.setTracking=function(t){this.set(sr,t)},t.prototype.setTrackingOptions=function(t){this.set(ar,t)},t}(R);function on(t,e,i){var r=void 0!==i?t.toFixed(i):""+t,n=r.indexOf(".");return e<(n=-1===n?r.length:n)?r:new Array(1+e-n).join("0")+r}function sn(t,e){for(var i=(""+t).split("."),r=(""+e).split("."),n=0;n<Math.max(i.length,r.length);n++){var o=parseInt(i[n]||"0",10),s=parseInt(r[n]||"0",10);if(s<o)return 1;if(o<s)return-1}return 0}function an(t,e){return t[0]+=e[0],t[1]+=e[1],t}function hn(t,e){var i,r,n=t[0],o=t[1],s=e[0],a=e[1],h=s[0],l=s[1],u=a[0],c=a[1],p=u-h,d=c-l,f=0===p&&0===d?0:(p*(n-h)+d*(o-l))/(p*p+d*d||0);return f<=0?(i=h,r=l):1<=f?(i=u,r=c):(i=h+f*p,r=l+f*d),[i,r]}function ln(t,e,i){var r=Ct(e+180,360)-180,n=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),a=Math.floor(n/3600),h=Math.floor((n-3600*a)/60),l=n-3600*a-60*h;return 60<=(l=Math.ceil(l*s)/s)&&(l=0,h+=1),60<=h&&(h=0,a+=1),a+"° "+on(h,2)+"′ "+on(l,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function un(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function cn(t,e){for(var i=!0,r=t.length-1;0<=r;--r)if(t[r]!=e[r]){i=!1;break}return i}function pn(t,e){var i=Math.cos(e),r=Math.sin(e),n=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=n,t[1]=o,t}function dn(t,e){return t[0]*=e,t[1]*=e,t}function fn(t,e){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function _n(t,e){return Math.sqrt(fn(t,e))}function gn(t,e){return fn(t,hn(t,e))}function yn(t,e){return un(t,"{x}, {y}",e)}function vn(t,e,i,r,n,o){var s=NaN,a=NaN,h=(i-e)/r;if(1===h)s=t[e],a=t[e+1];else if(2==h)s=(1-n)*t[e]+n*t[e+r],a=(1-n)*t[e+1]+n*t[e+r+1];else if(0!==h){for(var l=t[e],u=t[e+1],c=0,p=[0],d=e+r;d<i;d+=r){var f=t[d],_=t[d+1];c+=Math.sqrt((f-l)*(f-l)+(_-u)*(_-u)),p.push(c),l=f,u=_}var g=n*c,y=function(t,e,i){for(var r,n,o=i||hr,s=0,a=t.length,h=!1;s<a;)(n=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,h=!n);return h?s:~s}(p,g);if(y<0){var v=(g-p[-y-2])/(p[-y-1]-p[-y-2]),m=e+(-y-2)*r;s=It(t[m],t[m+r],v),a=It(t[m+1],t[m+r+1],v)}else s=t[e+y*r],a=t[e+y*r+1]}return o?(o[0]=s,o[1]=a,o):[s,a]}function mn(t,e,i,r,n,o){if(i==e)return null;var s;if(n<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=n,s):null;if(t[i-1]<n)return o?((s=t.slice(i-r,i))[r-1]=n,s):null;if(n==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,h=i/r;a<h;){var l=a+h>>1;n<t[(l+1)*r-1]?h=l:a=l+1}var u=t[a*r-1];if(n==u)return t.slice((a-1)*r,(a-1)*r+r);var c=(n-u)/(t[(a+1)*r-1]-u);s=[];for(var p=0;p<r-1;++p)s.push(It(t[(a-1)*r+p],t[a*r+p],c));return s.push(n),s}function xn(t,e,i,r){for(var n=t[e],o=t[e+1],s=0,a=e+r;a<i;a+=r){var h=t[a],l=t[a+1];s+=Math.sqrt((h-n)*(h-n)+(l-o)*(l-o)),n=h,o=l}return s}var Sn=function(i){function r(t,e){i.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}return i&&(r.__proto__=i),((r.prototype=Object.create(i&&i.prototype)).constructor=r).prototype.appendCoordinate=function(t){this.flatCoordinates?pr(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},r.prototype.clone=function(){return new r(this.flatCoordinates.slice(),this.layout)},r.prototype.closestPointXY=function(t,e,i,r){return r<D(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),wr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))},r.prototype.forEachSegment=function(t){return zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinateAtM=function(t,e){if(this.layout!=yr.XYM&&this.layout!=yr.XYZM)return null;var i=void 0!==e&&e;return mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},r.prototype.getCoordinates=function(){return Pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getCoordinateAt=function(t,e){return vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},r.prototype.getLength=function(){return xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},r.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[];return e.length=Or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new r(e,yr.XY)},r.prototype.getType=function(){return Lt.LINE_STRING},r.prototype.intersectsExtent=function(t){return Vr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},r}(vr);function Cn(t,e,i){for(var r,n,o,s,a,h,l=[],u=t(0),c=t(1),p=e(u),d=e(c),f=[c,u],_=[d,p],g=[1,0],y={},v=1e5;0<--v&&0<g.length;)o=g.pop(),u=f.pop(),p=_.pop(),(h=o.toString())in y||(l.push(p[0],p[1]),y[h]=!0),s=g.pop(),c=f.pop(),d=_.pop(),vt((n=e(r=t(a=(o+s)/2)))[0],n[1],p[0],p[1],d[0],d[1])<i?(l.push(d[0],d[1]),y[h=s.toString()]=!0):(g.push(s,a,a,o),_.push(d,n,n,p),f.push(c,r,r,u));return l}var En="postcompose",Tn="precompose",wn="render",Rn="point",In="line",Ln=function(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new zi({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Rn,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};Ln.prototype.clone=function(){return new Ln({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),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})},Ln.prototype.getOverflow=function(){return this.overflow_},Ln.prototype.getFont=function(){return this.font_},Ln.prototype.getMaxAngle=function(){return this.maxAngle_},Ln.prototype.getPlacement=function(){return this.placement_},Ln.prototype.getOffsetX=function(){return this.offsetX_},Ln.prototype.getOffsetY=function(){return this.offsetY_},Ln.prototype.getFill=function(){return this.fill_},Ln.prototype.getRotateWithView=function(){return this.rotateWithView_},Ln.prototype.getRotation=function(){return this.rotation_},Ln.prototype.getScale=function(){return this.scale_},Ln.prototype.getStroke=function(){return this.stroke_},Ln.prototype.getText=function(){return this.text_},Ln.prototype.getTextAlign=function(){return this.textAlign_},Ln.prototype.getTextBaseline=function(){return this.textBaseline_},Ln.prototype.getBackgroundFill=function(){return this.backgroundFill_},Ln.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},Ln.prototype.getPadding=function(){return this.padding_},Ln.prototype.setOverflow=function(t){this.overflow_=t},Ln.prototype.setFont=function(t){this.font_=t},Ln.prototype.setMaxAngle=function(t){this.maxAngle_=t},Ln.prototype.setOffsetX=function(t){this.offsetX_=t},Ln.prototype.setOffsetY=function(t){this.offsetY_=t},Ln.prototype.setPlacement=function(t){this.placement_=t},Ln.prototype.setFill=function(t){this.fill_=t},Ln.prototype.setRotation=function(t){this.rotation_=t},Ln.prototype.setScale=function(t){this.scale_=t},Ln.prototype.setStroke=function(t){this.stroke_=t},Ln.prototype.setText=function(t){this.text_=t},Ln.prototype.setTextAlign=function(t){this.textAlign_=t},Ln.prototype.setTextBaseline=function(t){this.textBaseline_=t},Ln.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},Ln.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},Ln.prototype.setPadding=function(t){this.padding_=t};var bn=new Vi({color:"rgba(0,0,0,0.2)"}),Pn=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],Fn=function(t){var e=t||{};this.map_=null,this.postcomposeListenerKey_=null,this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxLatP_=1/0,this.maxLonP_=1/0,this.minLatP_=-1/0,this.minLonP_=-1/0,this.targetSize_=void 0!==e.targetSize?e.targetSize:100,this.maxLines_=void 0!==e.maxLines?e.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=void 0!==e.strokeStyle?e.strokeStyle:bn,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,1==e.showLabels&&(this.lonLabelFormatter_=null==e.lonLabelFormatter?ln.bind(this,"EW"):e.lonLabelFormatter,this.latLabelFormatter_=null==e.latLabelFormatter?ln.bind(this,"NS"):e.latLabelFormatter,this.lonLabelPosition_=null==e.lonLabelPosition?0:e.lonLabelPosition,this.latLabelPosition_=null==e.latLabelPosition?1:e.latLabelPosition,this.lonLabelStyle_=void 0!==e.lonLabelStyle?e.lonLabelStyle:new Ln({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new zi({color:"rgba(0,0,0,1)"}),stroke:new Vi({color:"rgba(255,255,255,1)",width:3})}),this.latLabelStyle_=void 0!==e.latLabelStyle?e.latLabelStyle:new Ln({font:"12px Calibri,sans-serif",textAlign:"end",fill:new zi({color:"rgba(0,0,0,1)"}),stroke:new Vi({color:"rgba(255,255,255,1)",width:3})}),this.meridiansLabels_=[],this.parallelsLabels_=[]),this.setMap(void 0!==e.map?e.map:null)};Fn.prototype.addMeridian_=function(t,e,i,r,n,o){var s=this.getMeridian_(t,e,i,r,o);if(wt(s.getExtent(),n)){if(this.meridiansLabels_){var a=this.getMeridianPoint_(s,n,o);this.meridiansLabels_[o]={geom:a,text:this.lonLabelFormatter_(t)}}this.meridians_[o++]=s}return o},Fn.prototype.getMeridianPoint_=function(t,e,i){var r,n=t.getFlatCoordinates(),o=Math.max(e[1],n[1]),s=Math.min(e[3],n[n.length-1]),a=gt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,s),h=[n[0],a];return i in this.meridiansLabels_?(r=this.meridiansLabels_[i]).setCoordinates(h):r=new Dr(h),r},Fn.prototype.addParallel_=function(t,e,i,r,n,o){var s=this.getParallel_(t,e,i,r,o);if(wt(s.getExtent(),n)){if(this.parallelsLabels_){var a=this.getParallelPoint_(s,n,o);this.parallelsLabels_[o]={geom:a,text:this.latLabelFormatter_(t)}}this.parallels_[o++]=s}return o},Fn.prototype.getParallelPoint_=function(t,e,i){var r,n=t.getFlatCoordinates(),o=Math.max(e[0],n[0]),s=Math.min(e[2],n[n.length-2]),a=[gt(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,s),n[1]];return i in this.parallelsLabels_?(r=this.parallelsLabels_[i]).setCoordinates(a):r=new Dr(a),r},Fn.prototype.createGraticule_=function(t,e,i,r){var n=this.getInterval_(i);if(-1==n)return this.meridians_.length=this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o,s,a,h,l=this.toLonLatTransform_(e),u=l[0],c=l[1],p=this.maxLines_,d=[Math.max(t[0],this.minLonP_),Math.max(t[1],this.minLatP_),Math.min(t[2],this.maxLonP_),Math.min(t[3],this.maxLatP_)],f=(d=fe(d,this.projection_,"EPSG:4326"))[3],_=d[2],g=d[1],y=d[0];for(h=gt(u=Math.floor(u/n)*n,this.minLon_,this.maxLon_),s=this.addMeridian_(h,g,f,r,t,0),o=0;h!=this.minLon_&&o++<p;)h=Math.max(h-n,this.minLon_),s=this.addMeridian_(h,g,f,r,t,s);for(h=gt(u,this.minLon_,this.maxLon_),o=0;h!=this.maxLon_&&o++<p;)h=Math.min(h+n,this.maxLon_),s=this.addMeridian_(h,g,f,r,t,s);for(this.meridians_.length=s,this.meridiansLabels_&&(this.meridiansLabels_.length=s),a=gt(c=Math.floor(c/n)*n,this.minLat_,this.maxLat_),s=this.addParallel_(a,y,_,r,t,0),o=0;a!=this.minLat_&&o++<p;)a=Math.max(a-n,this.minLat_),s=this.addParallel_(a,y,_,r,t,s);for(a=gt(c,this.minLat_,this.maxLat_),o=0;a!=this.maxLat_&&o++<p;)a=Math.min(a+n,this.maxLat_),s=this.addParallel_(a,y,_,r,t,s);this.parallels_.length=s,this.parallelsLabels_&&(this.parallelsLabels_.length=s)},Fn.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1],r=-1,n=Math.pow(this.targetSize_*t,2),o=[],s=[],a=0,h=Pn.length;a<h;++a){var l=Pn[a]/2;if(o[0]=e-l,o[1]=i-l,s[0]=e+l,s[1]=i+l,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=n)break;r=Pn[a]}return r},Fn.prototype.getMap=function(){return this.map_},Fn.prototype.getMeridian_=function(t,e,i,r,n){var o,s,a,h,l,u=(o=t,s=e,a=i,h=this.projection_,l=r,Cn(function(t){return[o,s+(a-s)*t]},pe(ne("EPSG:4326"),h),l)),c=this.meridians_[n];return c?(c.setFlatCoordinates(yr.XY,u),c.changed()):c=this.meridians_[n]=new Sn(u,yr.XY),c},Fn.prototype.getMeridians=function(){return this.meridians_},Fn.prototype.getParallel_=function(t,e,i,r,n){var o,s,a,h,l,u=(o=t,s=e,a=i,h=this.projection_,l=r,Cn(function(t){return[s+(a-s)*t,o]},pe(ne("EPSG:4326"),h),l)),c=this.parallels_[n];return c?(c.setFlatCoordinates(yr.XY,u),c.changed()):c=new Sn(u,yr.XY),c},Fn.prototype.getParallels=function(){return this.parallels_},Fn.prototype.handlePostCompose_=function(t){var e,i,r,n,o=t.vectorContext,s=t.frameState,a=s.extent,h=s.viewState,l=h.center,u=h.projection,c=h.resolution,p=s.pixelRatio,d=c*c/(4*p*p);for((!this.projection_||!ue(this.projection_,u))&&this.updateProjectionInfo_(u),this.createGraticule_(a,l,c,d),o.setFillStrokeStyle(null,this.strokeStyle_),e=0,i=this.meridians_.length;e<i;++e)r=this.meridians_[e],o.drawGeometry(r);for(e=0,i=this.parallels_.length;e<i;++e)r=this.parallels_[e],o.drawGeometry(r);if(this.meridiansLabels_)for(e=0,i=this.meridiansLabels_.length;e<i;++e)n=this.meridiansLabels_[e],this.lonLabelStyle_.setText(n.text),o.setTextStyle(this.lonLabelStyle_),o.drawGeometry(n.geom);if(this.parallelsLabels_)for(e=0,i=this.parallelsLabels_.length;e<i;++e)n=this.parallelsLabels_[e],this.latLabelStyle_.setText(n.text),o.setTextStyle(this.latLabelStyle_),o.drawGeometry(n.geom)},Fn.prototype.updateProjectionInfo_=function(t){var e=ne("EPSG:4326"),i=t.getWorldExtent(),r=fe(i,e,t);this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0],this.maxLatP_=r[3],this.maxLonP_=r[2],this.minLatP_=r[1],this.minLonP_=r[0],this.fromLonLatTransform_=pe(e,t),this.toLonLatTransform_=pe(t,e),this.projectionCenterLonLat_=this.toLonLatTransform_(ot(t.getExtent())),this.projection_=t},Fn.prototype.setMap=function(t){this.map_&&(g(this.postcomposeListenerKey_),this.postcomposeListenerKey_=null,this.map_.render()),t&&(this.postcomposeListenerKey_=E(t,En,this.handlePostCompose_,this),t.render()),this.map_=t};var Mn=function(n){function t(t,e,i,r){n.call(this),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state=r}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.changed=function(){this.dispatchEvent(w.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){},t}(i),On=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,i,di.IDLE),this.src_=r,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.imageListenerKeys_=null,this.state=di.IDLE,this.imageLoadFunction_=o}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=di.ERROR,this.unlistenImage_(),this.changed()},t.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=at(this.extent)/this.image_.height),this.state=di.LOADED,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state!=di.IDLE&&this.state!=di.ERROR||(this.state=di.LOADING,this.changed(),this.imageListenerKeys_=[p(this.image_,w.ERROR,this.handleImageError_,this),p(this.image_,w.LOAD,this.handleImageLoad_,this)],this.imageLoadFunction_(this,this.src_))},t.prototype.setImage=function(t){this.image_=t},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(g),this.imageListenerKeys_=null},t}(Mn),Nn=0,An=1,Gn=2,kn=3,Dn=4,jn=5;function Un(t){return Math.pow(t,3)}function Yn(t){return 1-Un(1-t)}function Bn(t){return 3*t*t-2*t*t*t}function Xn(t){return t}var zn=function(n){function t(t,e,i){n.call(this);var r=i||{};this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=void 0===r.transition?250:r.transition,this.transitionStarts_={}}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.changed=function(){this.dispatchEvent(w.CHANGE)},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Gn)return t;t=t.interimTile}while(t);return this},t.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Gn){t.interimTile=null;break}t.getState()==An?e=t:t.getState()==Nn?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(t){this.state=t,this.changed()},t.prototype.load=function(){},t.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 r=e-i+1e3/60;return r>=this.transition_?1:Un(r/this.transition_)},t.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},t.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},t}(i),Vn=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,o),this.crossOrigin_=r,this.src_=i,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.imageListenerKeys_=null,this.tileLoadFunction_=n}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.disposeInternal=function(){this.state==An&&(this.unlistenImage_(),this.image_=Wn()),this.interimTile&&this.interimTile.dispose(),this.state=jn,this.changed(),s.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.image_},t.prototype.getKey=function(){return this.src_},t.prototype.handleImageError_=function(){this.state=kn,this.unlistenImage_(),this.image_=Wn(),this.changed()},t.prototype.handleImageLoad_=function(){this.image_.naturalWidth&&this.image_.naturalHeight?this.state=Gn:this.state=Dn,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state==kn&&(this.state=Nn,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Nn&&(this.state=An,this.changed(),this.imageListenerKeys_=[p(this.image_,w.ERROR,this.handleImageError_,this),p(this.image_,w.LOAD,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(g),this.imageListenerKeys_=null},t}(zn);function Wn(){var t=De(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var Kn=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};Kn.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},Kn.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},Kn.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;0<i&&this.points_[i+2]>t;)i-=3;var r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;var n=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,n),this.initialVelocity_=Math.sqrt(n*n+o*o)/r,this.initialVelocity_>this.minVelocity_},Kn.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},Kn.prototype.getAngle=function(){return this.angle_};var Hn=function(r){function t(t,e,i){r.call(this,t),this.map=e,this.frameState=void 0!==i?i:null}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),Zn=function(o){function t(t,e,i,r,n){o.call(this,t,e,n),this.originalEvent=i,this.pixel=e.getEventPixel(i),this.coordinate=e.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==r&&r}return o&&(t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).prototype.preventDefault=function(){o.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){o.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},t}(Hn),qn={SINGLECLICK:"singleclick",CLICK:w.CLICK,DBLCLICK:w.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Jn=function(o){function t(t,e,i,r,n){o.call(this,t,e,i.originalEvent,r,n),this.pointerEvent=i}return o&&(t.__proto__=o),(t.prototype=Object.create(o&&o.prototype)).constructor=t}(Zn),Qn="pointermove",$n="pointerdown",to="pointerup",eo="pointerover",io="pointerout",ro="pointerenter",no="pointerleave",oo="pointercancel",so=function(t,e){this.dispatcher=t,this.mapping_=e};so.prototype.getEvents=function(){return Object.keys(this.mapping_)},so.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var ao=1,ho="mouse";function lo(t){if(!this.isEventSimulatedFromTouch_(t)){ao.toString()in this.pointerMap&&this.cancel(t);var e=go(t,this.dispatcher);this.pointerMap[ao.toString()]=t,this.dispatcher.down(e,t)}}function uo(t){if(!this.isEventSimulatedFromTouch_(t)){var e=go(t,this.dispatcher);this.dispatcher.move(e,t)}}function co(t){if(!this.isEventSimulatedFromTouch_(t)){var e=this.pointerMap[ao.toString()];if(e&&e.button===t.button){var i=go(t,this.dispatcher);this.dispatcher.up(i,t),this.cleanupMouse()}}}function po(t){if(!this.isEventSimulatedFromTouch_(t)){var e=go(t,this.dispatcher);this.dispatcher.enterOver(e,t)}}function fo(t){if(!this.isEventSimulatedFromTouch_(t)){var e=go(t,this.dispatcher);this.dispatcher.leaveOut(e,t)}}var _o=function(i){function t(t){var e={mousedown:lo,mousemove:uo,mouseup:co,mouseover:po,mouseout:fo};i.call(this,t,e),this.pointerMap=t.pointerMap,this.lastTouches=[]}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.isEventSimulatedFromTouch_=function(t){for(var e=this.lastTouches,i=t.clientX,r=t.clientY,n=0,o=e.length,s=void 0;n<o&&(s=e[n]);n++){var a=Math.abs(i-s[0]),h=Math.abs(r-s[1]);if(a<=25&&h<=25)return!0}return!1},t.prototype.cancel=function(t){var e=go(t,this.dispatcher);this.dispatcher.cancel(e,t),this.cleanupMouse()},t.prototype.cleanupMouse=function(){delete this.pointerMap[ao.toString()]},t}(so);function go(t,e){var i=e.cloneEvent(t,t),r=i.preventDefault;return i.preventDefault=function(){t.preventDefault(),r()},i.pointerId=ao,i.isPrimary=!0,i.pointerType=ho,i}var yo=["","unavailable","touch","pen","mouse"];function vo(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function mo(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function xo(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function So(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function Co(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function Eo(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function To(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function wo(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}var Ro=function(i){function t(t){var e={MSPointerDown:vo,MSPointerMove:mo,MSPointerUp:xo,MSPointerOut:So,MSPointerOver:Co,MSPointerCancel:Eo,MSGotPointerCapture:wo,MSLostPointerCapture:To};i.call(this,t,e),this.pointerMap=t.pointerMap}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=yo[t.pointerType]),e},t.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},t}(so);function Io(t){this.dispatcher.fireNativeEvent(t)}function Lo(t){this.dispatcher.fireNativeEvent(t)}function bo(t){this.dispatcher.fireNativeEvent(t)}function Po(t){this.dispatcher.fireNativeEvent(t)}function Fo(t){this.dispatcher.fireNativeEvent(t)}function Mo(t){this.dispatcher.fireNativeEvent(t)}function Oo(t){this.dispatcher.fireNativeEvent(t)}function No(t){this.dispatcher.fireNativeEvent(t)}var Ao=function(i){function t(t){var e={pointerdown:Io,pointermove:Lo,pointerup:bo,pointerout:Po,pointerover:Fo,pointercancel:Mo,gotpointercapture:No,lostpointercapture:Oo};i.call(this,t,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(so),Go=!1,ko=function(n){function t(t,e,i){n.call(this,t),this.originalEvent=e;var r=i||{};this.buttons=this.getButtons_(r),this.pressure=this.getPressure_(r,this.buttons),this.bubbles="bubbles"in r&&r.bubbles,this.cancelable="cancelable"in r&&r.cancelable,this.view="view"in r?r.view:null,this.detail="detail"in r?r.detail:null,this.screenX="screenX"in r?r.screenX:0,this.screenY="screenY"in r?r.screenY:0,this.clientX="clientX"in r?r.clientX:0,this.clientY="clientY"in r?r.clientY:0,this.ctrlKey="ctrlKey"in r&&r.ctrlKey,this.altKey="altKey"in r&&r.altKey,this.shiftKey="shiftKey"in r&&r.shiftKey,this.metaKey="metaKey"in r&&r.metaKey,this.button="button"in r?r.button:0,this.relatedTarget="relatedTarget"in r?r.relatedTarget:null,this.pointerId="pointerId"in r?r.pointerId:0,this.width="width"in r?r.width:0,this.height="height"in r?r.height:0,this.tiltX="tiltX"in r?r.tiltX:0,this.tiltY="tiltY"in r?r.tiltY:0,this.pointerType="pointerType"in r?r.pointerType:"",this.hwTimestamp="hwTimestamp"in r?r.hwTimestamp:0,this.isPrimary="isPrimary"in r&&r.isPrimary,e.preventDefault&&(this.preventDefault=function(){e.preventDefault()})}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.getButtons_=function(t){var e;if(t.buttons||Go)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e},t.prototype.getPressure_=function(t,e){return t.pressure?t.pressure:e?.5:0},t}(m);!function(){try{var t=new MouseEvent("click",{buttons:1});Go=1===t.buttons}catch(t){}}();function Do(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function jo(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)}function Uo(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function Yo(t){this.processTouches_(t,this.cancelOut_)}var Bo=function(r){function t(t,e){var i={touchstart:Do,touchmove:jo,touchend:Uo,touchcancel:Yo};r.call(this,t,i),this.pointerMap=t.pointerMap,this.mouseSource=e,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0,this.dedupTimeout_=2500}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},t.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&ao.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},t.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},t.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},t.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},t.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},t.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.webkitRadiusX||e.radiusX||0,i.height=e.webkitRadiusY||e.radiusY||0,i.pressure=e.webkitForce||e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},t.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),r=i.length;function n(){t.preventDefault()}for(var o=0;o<r;++o){var s=this.touchToPointer_(t,i[o]);s.preventDefault=n,e.call(this,t,s)}},t.prototype.findTouch_=function(t,e){for(var i=t.length,r=0;r<i;r++){if(t[r].identifier===e)return!0}return!1},t.prototype.vacuumTouches_=function(t){var e=t.touches,i=Object.keys(this.pointerMap),r=i.length;if(r>=e.length){for(var n=[],o=0;o<r;++o){var s=i[o],a=this.pointerMap[s];s==ao||this.findTouch_(e,s-2)||n.push(a.out)}for(var h=0;h<n.length;++h)this.cancelOut_(t,n[h])}},t.prototype.overDown_=function(t,e){this.pointerMap[e.pointerId]={target:e.target,out:e,outTarget:e.target},this.dispatcher.over(e,t),this.dispatcher.enter(e,t),this.dispatcher.down(e,t)},t.prototype.moveOverOut_=function(t,e){var i=e,r=this.pointerMap[i.pointerId];if(r){var n=r.out,o=r.outTarget;this.dispatcher.move(i,t),n&&o!==i.target&&(n.relatedTarget=i.target,i.relatedTarget=o,n.target=o,i.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(i,t)):(i.target=o,i.relatedTarget=null,this.cancelOut_(t,i))),r.out=i,r.outTarget=i.target}},t.prototype.upOut_=function(t,e){this.dispatcher.up(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},t.prototype.cancelOut_=function(t,e){this.dispatcher.cancel(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},t.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},t.prototype.dedupSynthMouse_=function(t){var r=this.mouseSource.lastTouches,e=t.changedTouches[0];if(this.isPrimaryTouch_(e)){var n=[e.clientX,e.clientY];r.push(n),setTimeout(function(){var t,e,i;e=n,i=(t=r).indexOf(e),-1<i&&t.splice(i,1)},this.dedupTimeout_)}},t}(so),Xo=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],zo=function(e){function t(t){e.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.registerSources=function(){if(ci)this.registerSource("native",new Ao(this));else if(pi)this.registerSource("ms",new Ro(this));else{var t=new _o(this);this.registerSource("mouse",t),ui&&this.registerSource("touch",new Bo(this,t))}this.register_()},t.prototype.registerSource=function(t,e){var i=e,r=i.getEvents();r&&(r.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},t.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.addEvents_(i.getEvents())}},t.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.removeEvents_(i.getEvents())}},t.prototype.eventHandler_=function(t){var e=t.type,i=this.eventMap_[e];i&&i(t)},t.prototype.addEvents_=function(t){t.forEach(function(t){E(this.element_,t,this.eventHandler_,this)}.bind(this))},t.prototype.removeEvents_=function(t){t.forEach(function(t){d(this.element_,t,this.eventHandler_,this)}.bind(this))},t.prototype.cloneEvent=function(t,e){for(var i={},r=0,n=Xo.length;r<n;r++){var o=Xo[r][0];i[o]=t[o]||e[o]||Xo[r][1]}return i},t.prototype.down=function(t,e){this.fireEvent($n,t,e)},t.prototype.move=function(t,e){this.fireEvent(Qn,t,e)},t.prototype.up=function(t,e){this.fireEvent(to,t,e)},t.prototype.enter=function(t,e){t.bubbles=!1,this.fireEvent(ro,t,e)},t.prototype.leave=function(t,e){t.bubbles=!1,this.fireEvent(no,t,e)},t.prototype.over=function(t,e){t.bubbles=!0,this.fireEvent(eo,t,e)},t.prototype.out=function(t,e){t.bubbles=!0,this.fireEvent(io,t,e)},t.prototype.cancel=function(t,e){this.fireEvent(oo,t,e)},t.prototype.leaveOut=function(t,e){this.out(t,e),this.contains_(t.target,t.relatedTarget)||this.leave(t,e)},t.prototype.enterOver=function(t,e){this.over(t,e),this.contains_(t.target,t.relatedTarget)||this.enter(t,e)},t.prototype.contains_=function(t,e){return!(!t||!e)&&t.contains(e)},t.prototype.makeEvent=function(t,e,i){return new ko(t,i,e)},t.prototype.fireEvent=function(t,e,i){var r=this.makeEvent(t,e,i);this.dispatchEvent(r)},t.prototype.fireNativeEvent=function(t){var e=this.makeEvent(t.type,t,t);this.dispatchEvent(e)},t.prototype.wrapMouseEvent=function(t,e){return this.makeEvent(t,_o.prepareEvent(e,this),e)},t.prototype.disposeInternal=function(){this.unregister_(),e.prototype.disposeInternal.call(this)},t}(i),Vo=function(r){function t(t,e){r.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e?e*ai:ai,this.down_=null;var i=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new zo(i),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=E(this.pointerEventHandler_,$n,this.handlePointerDown_,this),this.relayedListenerKey_=E(this.pointerEventHandler_,Qn,this.relayEvent_,this)}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.emulateClick_=function(e){var t=new Jn(qn.CLICK,this.map_,e);this.dispatchEvent(t),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,t=new Jn(qn.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var t=new Jn(qn.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},t.prototype.updateActivePointers_=function(t){var e=t;e.type==qn.POINTERUP||e.type==qn.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==qn.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},t.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Jn(qn.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(g),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},t.prototype.isMouseActionButton_=function(t){return 0===t.button},t.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new Jn(qn.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new zo(document),this.dragListenerKeys_.push(E(this.documentPointerEventHandler_,qn.POINTERMOVE,this.handlePointerMove_,this),E(this.documentPointerEventHandler_,qn.POINTERUP,this.handlePointerUp_,this),E(this.pointerEventHandler_,qn.POINTERCANCEL,this.handlePointerUp_,this)))},t.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Jn(qn.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}t.preventDefault()},t.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Jn(t.type,this.map_,t,e))},t.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_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(g(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(g(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(g),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),r.prototype.disposeInternal.call(this)},t}(i),Wo="postrender",Ko="movestart",Ho="moveend",Zo={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},qo=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};qo.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,_(this.queuedElements_)},qo.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 r=this.keyFunction_(i);return delete this.queuedElements_[r],i},qo.prototype.enqueue=function(t){Z(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},qo.prototype.getCount=function(){return this.elements_.length},qo.prototype.getLeftChildIndex_=function(t){return 2*t+1},qo.prototype.getRightChildIndex_=function(t){return 2*t+2},qo.prototype.getParentIndex_=function(t){return t-1>>1},qo.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;0<=t;t--)this.siftUp_(t)},qo.prototype.isEmpty=function(){return 0===this.elements_.length},qo.prototype.isKeyQueued=function(t){return t in this.queuedElements_},qo.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},qo.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,r=e.length,n=e[t],o=i[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),l=h<r&&i[h]<i[a]?h:a;e[t]=e[l],i[t]=i[l],t=l}e[t]=n,i[t]=o,this.siftDown_(s,t)},qo.prototype.siftDown_=function(t,e){for(var i=this.elements_,r=this.priorities_,n=i[e],o=r[e];t<e;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;i[e]=i[s],r[e]=r[s],e=s}i[e]=n,r[e]=o},qo.prototype.reprioritize=function(){var t,e,i,r=this.priorityFunction_,n=this.elements_,o=this.priorities_,s=0,a=n.length;for(e=0;e<a;++e)(i=r(t=n[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=i,n[s++]=t);n.length=s,o.length=s,this.heapify_()};var Jo=function(i){function t(e,t){i.call(this,function(t){return e.apply(null,t)},function(t){return t[0].getKey()}),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.enqueue=function(t){var e=i.prototype.enqueue.call(this,t);e&&E(t[0],w.CHANGE,this.handleTileChange,this);return e},t.prototype.getTilesLoading=function(){return this.tilesLoading_},t.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===Gn||i===kn||i===Dn||i===jn){d(e,w.CHANGE,this.handleTileChange,this);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},t.prototype.loadMoreTiles=function(t,e){for(var i,r,n,o=0,s=!1;this.tilesLoading_<t&&o<e&&0<this.getCount();)n=(r=this.dequeue()[0]).getKey(),(i=r.getState())===jn?s=!0:i!==Nn||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,r.load());0===o&&s&&this.tileChangeCallback_()},t}(qo),Qo=42,$o=256;function ts(t){return t}function es(t,e){return void 0!==t?0:void 0}function is(t,e){return void 0!==t?t+e:void 0}var rs={ANIMATING:0,INTERACTING:1},ns="center",os="resolution",ss="rotation",as=function(i){function t(t){i.call(this);var e=C({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=ae(e.projection,"EPSG:3857"),this.applyOptions_(e)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.applyOptions_=function(t){var e={};e[ns]=void 0!==t.center?t.center:null;var i=function(t){var e,i,r,n=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;i=a[n],r=void 0!==a[o]?a[o]:a[a.length-1],g=a,e=function(t,e,i){if(void 0!==t){var r=ur(g,t,i);r=gt(r+e,0,g.length-1);var n=Math.floor(r);if(r!=n&&n<g.length-1){var o=g[n]/g[n+1];return g[n]/Math.pow(o,r-n)}return g[n]}}}else{var h=ae(t.projection,"EPSG:3857"),l=h.getExtent(),u=l?Math.max(ct(l),at(l)):360*Nt[Ot.DEGREES]/h.getMetersPerUnit(),c=u/$o/Math.pow(2,0),p=c/Math.pow(2,28);void 0!==(i=t.maxResolution)?n=0:i=c/Math.pow(s,n),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,o):c/Math.pow(s,o):p),o=n+Math.floor(Math.log(i/r)/Math.log(s)),r=i/Math.pow(s,o-n),d=s,f=i,_=o-n,e=function(t,e,i){if(void 0!==t){var r=-i/2+.5,n=Math.floor(Math.log(f/t)/Math.log(d)+r),o=Math.max(n+e,0);return void 0!==_&&(o=Math.min(o,_)),f/Math.pow(d,o)}}}var d,f,_;var g;return{constraint:e,maxResolution:i,minResolution:r,minZoom:n,zoomFactor:s}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=i.minZoom;var r,n,o=void 0!==(r=t).extent?(n=r.extent,function(t){return t?[gt(t[0],n[0],n[2]),gt(t[1],n[1],n[3])]:void 0}):ts,s=i.constraint,a=function(t){{if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=n||St(5),function(t,e){return void 0!==t?Math.abs(t+e)<=o?0:t+e:void 0}):!1===e?is:"number"==typeof e?(i=e,r=2*Math.PI/i,function(t,e){return void 0!==t?t=Math.floor((t+e)/r+.5)*r:void 0}):is}return es}var i,r;var n,o}(t);this.constraints_={center:o,resolution:s,rotation:a},void 0!==t.resolution?e[os]=t.resolution:void 0!==t.zoom&&(e[os]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(e[os]=gt(Number(this.getResolution()||e[os]),this.minResolution_,this.maxResolution_))),e[ss]=void 0!==t.rotation?t.rotation:0,this.setProperties(e),this.options_=t},t.prototype.getUpdatedOptions_=function(t){var e=C({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenter(),e.rotation=this.getRotation(),C({},e,t)},t.prototype.animate=function(t){var e,i=arguments,r=arguments.length;if(1<r&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var n=arguments[r-1];return n.center&&this.setCenter(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&setTimeout(function(){e(!0)},0))}for(var o=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),h=this.getRotation(),l=[],u=0;u<r;++u){var c=i[u],p={start:o,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||Bn};if(c.center&&(p.sourceCenter=s,p.targetCenter=c.center,s=p.targetCenter),void 0!==c.zoom?(p.sourceResolution=a,p.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),a=p.targetResolution):c.resolution&&(p.sourceResolution=a,p.targetResolution=c.resolution,a=p.targetResolution),void 0!==c.rotation){p.sourceRotation=h;var d=Ct(c.rotation-h+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=h+d,h=p.targetRotation}p.callback=e,hs(p)?p.complete=!0:o+=p.duration,l.push(p)}this.animations_.push(l),this.setHint(rs.ANIMATING,1),this.updateAnimations_()},t.prototype.getAnimating=function(){return 0<this.hints_[rs.ANIMATING]},t.prototype.getInteracting=function(){return 0<this.hints_[rs.INTERACTING]},t.prototype.cancelAnimations=function(){this.setHint(rs.ANIMATING,-this.hints_[rs.ANIMATING]);for(var t=0,e=this.animations_.length;t<e;++t){var i=this.animations_[t];i[0].callback&&i[0].callback(!1)}this.animations_.length=0},t.prototype.updateAnimations_=function(){var t=this;if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var e=Date.now(),i=!1,r=this.animations_.length-1;0<=r;--r){for(var n=t.animations_[r],o=!0,s=0,a=n.length;s<a;++s){var h=n[s];if(!h.complete){var l=e-h.start,u=0<h.duration?l/h.duration:1;1<=u?(h.complete=!0,u=1):o=!1;var c=h.easing(u);if(h.sourceCenter){var p=h.sourceCenter[0],d=h.sourceCenter[1],f=p+c*(h.targetCenter[0]-p),_=d+c*(h.targetCenter[1]-d);t.set(ns,[f,_])}if(h.sourceResolution&&h.targetResolution){var g=1===c?h.targetResolution:h.sourceResolution+c*(h.targetResolution-h.sourceResolution);h.anchor&&t.set(ns,t.calculateCenterZoom(g,h.anchor)),t.set(os,g)}if(void 0!==h.sourceRotation&&void 0!==h.targetRotation){var y=1===c?Ct(h.targetRotation+Math.PI,2*Math.PI)-Math.PI:h.sourceRotation+c*(h.targetRotation-h.sourceRotation);h.anchor&&t.set(ns,t.calculateCenterRotate(y,h.anchor)),t.set(ss,y)}if(i=!0,!h.complete)break}}if(o){t.animations_[r]=null,t.setHint(rs.ANIMATING,-1);var v=n[0].callback;v&&setTimeout(function(){v(!0)},0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},t.prototype.calculateCenterRotate=function(t,e){var i,r=this.getCenter();return void 0!==r&&(pn(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),an(i,e)),i},t.prototype.calculateCenterZoom=function(t,e){var i,r=this.getCenter(),n=this.getResolution();void 0!==r&&void 0!==n&&(i=[e[0]-t*(e[0]-r[0])/n,e[1]-t*(e[1]-r[1])/n]);return i},t.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+Et(this)+'"]',i=document.querySelector(e);if(i){var r=getComputedStyle(i);t[0]=parseInt(r.width,10),t[1]=parseInt(r.height,10)}return t},t.prototype.constrainCenter=function(t){return this.constraints_.center(t)},t.prototype.constrainResolution=function(t,e,i){var r=e||0,n=i||0;return this.constraints_.resolution(t,r,n)},t.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},t.prototype.getCenter=function(){return this.get(ns)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},t.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_(),i=this.getCenter();Z(i,1);var r=this.getResolution();Z(void 0!==r,2);var n=this.getRotation();return Z(void 0!==n,3),st(i,r,n,e)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(os)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),r=ct(t)/i[0],n=at(t)/i[1];return Math.max(r,n)},t.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},t.prototype.getRotation=function(){return this.get(ss)},t.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,r=this.minResolution_,n=Math.log(i/r)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/n}},t.prototype.getState=function(){var t=this.getCenter(),e=this.getProjection(),i=this.getResolution(),r=this.getRotation();return{center:t.slice(),projection:void 0!==e?e:null,resolution:i,rotation:r,zoom:this.getZoom()}},t.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},t.prototype.getZoomForResolution=function(t){var e,i,r=this.minZoom_||0;if(this.resolutions_){var n=ur(this.resolutions_,t,1);r=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 r+Math.log(e/t)/Math.log(i)},t.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},t.prototype.fit=function(t,e){var i,r=e||{},n=r.size;n||(n=this.getSizeFromViewport_()),t instanceof vr?t.getType()===Lt.CIRCLE?(i=tn(t=t.getExtent())).rotate(this.getRotation(),ot(t)):i=t:(Z(Array.isArray(t),24),Z(!pt(t),25),i=tn(t));var o,s=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0===r.constrainResolution||r.constrainResolution,h=void 0!==r.nearest&&r.nearest;o=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.constrainResolution(this.maxResolution_,r.maxZoom-this.minZoom_,0):0;for(var l=i.getFlatCoordinates(),u=this.getRotation(),c=Math.cos(-u),p=Math.sin(-u),d=1/0,f=1/0,_=-1/0,g=-1/0,y=i.getStride(),v=0,m=l.length;v<m;v+=y){var x=l[v]*c-l[v+1]*p,S=l[v]*p+l[v+1]*c;d=Math.min(d,x),f=Math.min(f,S),_=Math.max(_,x),g=Math.max(g,S)}var C=this.getResolutionForExtent([d,f,_,g],[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);if(C=isNaN(C)?o:Math.max(C,o),a){var E=this.constrainResolution(C,0,0);!h&&E<C&&(E=this.constrainResolution(E,-1,0)),C=E}p=-p;var T=(d+_)/2,w=(f+g)/2,R=[(T+=(s[1]-s[3])/2*C)*c-(w+=(s[0]-s[2])/2*C)*p,w*c+T*p],I=r.callback?r.callback:L;void 0!==r.duration?this.animate({resolution:C,center:R,duration:r.duration,easing:r.easing},I):(this.setResolution(C),this.setCenter(R),setTimeout(I.bind(void 0,!0),0))},t.prototype.centerOn=function(t,e,i){var r=this.getRotation(),n=Math.cos(-r),o=Math.sin(-r),s=t[0]*n-t[1]*o,a=t[1]*n+t[0]*o,h=this.getResolution(),l=(s+=(e[0]/2-i[0])*h)*n-(a+=(i[1]-e[1]/2)*h)*(o=-o),u=a*n+s*o;this.setCenter([l,u])},t.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},t.prototype.rotate=function(t,e){if(void 0!==e){var i=this.calculateCenterRotate(t,e);this.setCenter(i)}this.setRotation(t)},t.prototype.setCenter=function(t){this.set(ns,t),this.getAnimating()&&this.cancelAnimations()},t.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},t.prototype.setResolution=function(t){this.set(os,t),this.getAnimating()&&this.cancelAnimations()},t.prototype.setRotation=function(t){this.set(ss,t),this.getAnimating()&&this.cancelAnimations()},t.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},t}(R);function hs(t){return!(t.sourceCenter&&t.targetCenter&&!cn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var ls="opacity",us="visible",cs="extent",ps="zIndex",ds="maxResolution",fs="minResolution",_s="source",gs=function(i){function t(t){i.call(this);var e=C({},t);e[ls]=void 0!==t.opacity?t.opacity:1,e[us]=void 0===t.visible||t.visible,e[ps]=void 0!==t.zIndex?t.zIndex:0,e[ds]=void 0!==t.maxResolution?t.maxResolution:1/0,e[fs]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(e),this.state_={layer:this,managed:!0},this.type}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getType=function(){return this.type},t.prototype.getLayerState=function(){return this.state_.opacity=gt(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},t.prototype.getLayersArray=function(t){},t.prototype.getLayerStatesArray=function(t){},t.prototype.getExtent=function(){return this.get(cs)},t.prototype.getMaxResolution=function(){return this.get(ds)},t.prototype.getMinResolution=function(){return this.get(fs)},t.prototype.getOpacity=function(){return this.get(ls)},t.prototype.getSourceState=function(){},t.prototype.getVisible=function(){return this.get(us)},t.prototype.getZIndex=function(){return this.get(ps)},t.prototype.setExtent=function(t){this.set(cs,t)},t.prototype.setMaxResolution=function(t){this.set(ds,t)},t.prototype.setMinResolution=function(t){this.set(fs,t)},t.prototype.setOpacity=function(t){this.set(ls,t)},t.prototype.setVisible=function(t){this.set(us,t)},t.prototype.setZIndex=function(t){this.set(ps,t)},t}(R),ys="undefined",vs="loading",ms="ready",xs="error",Ss="layers",Cs=function(n){function t(t){var e=t||{},i=C({},e);delete i.layers;var r=e.layers;n.call(this,i),this.layersListenerKeys_=[],this.listenerKeys_={},E(this,b(Ss),this.handleLayersChanged_,this),r?Array.isArray(r)?r=new M(r.slice(),{unique:!0}):(Z(r instanceof M,43),r=r):r=new M(void 0,{unique:!0}),this.setLayers(r)}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(g),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(E(t,h,this.handleLayersAdd_,this),E(t,l,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(g);_(this.listenerKeys_);for(var i=t.getArray(),r=0,n=i.length;r<n;r++){var o=i[r];this.listenerKeys_[Et(o).toString()]=[E(o,a,this.handleLayerChange_,this),E(o,w.CHANGE,this.handleLayerChange_,this)]}this.changed()},t.prototype.handleLayersAdd_=function(t){var e=t.element,i=Et(e).toString();this.listenerKeys_[i]=[E(e,a,this.handleLayerChange_,this),E(e,w.CHANGE,this.handleLayerChange_,this)],this.changed()},t.prototype.handleLayersRemove_=function(t){var e=Et(t.element).toString();this.listenerKeys_[e].forEach(g),delete this.listenerKeys_[e],this.changed()},t.prototype.getLayers=function(){return this.get(Ss)},t.prototype.setLayers=function(t){this.set(Ss,t)},t.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach(function(t){t.getLayersArray(e)}),e},t.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});for(var r=this.getLayerState(),n=i,o=e.length;n<o;n++){var s=e[n];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),void 0!==r.extent&&(void 0!==s.extent?s.extent=ht(s.extent,r.extent):s.extent=r.extent)}return e},t.prototype.getSourceState=function(){return ms},t}(gs);function Es(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function Ts(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function ws(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}var Rs=function(s){function t(t){s.call(this);var e=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,n,o={},s=t.layers instanceof Cs?t.layers:new Cs({layers:t.layers});o[Zo.LAYERGROUP]=s,o[Zo.TARGET]=t.target,o[Zo.VIEW]=void 0!==t.view?t.view:new as,void 0!==t.controls&&(Array.isArray(t.controls)?i=new M(t.controls.slice()):(Z(t.controls instanceof M,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new M(t.interactions.slice()):(Z(t.interactions instanceof M,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new M(t.overlays.slice()):(Z(t.overlays instanceof M,49),n=t.overlays):n=new M;return{controls:i,interactions:r,keyboardEventTarget:e,overlays:n,values:o}}(t);this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:ai,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(ui?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var i=[w.CLICK,w.DBLCLICK,w.MOUSEDOWN,w.TOUCHSTART,w.MSPOINTERDOWN,qn.POINTERDOWN,w.MOUSEWHEEL,w.WHEEL],r=0,n=i.length;r<n;++r)E(this.overlayContainerStopEvent_,i[r],x);for(var o in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new Vo(this,t.moveTolerance),qn)E(this.mapBrowserEventHandler_,qn[o],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=e.keyboardEventTarget,this.keyHandlerKeys_=null,E(this.viewport_,w.CONTEXTMENU,this.handleBrowserEvent,this),E(this.viewport_,w.WHEEL,this.handleBrowserEvent,this),E(this.viewport_,w.MOUSEWHEEL,this.handleBrowserEvent,this),this.controls=e.controls||new M,this.interactions=e.interactions||new M,this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=this.createRenderer(),this.handleResize_,this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new Jo(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},E(this,b(Zo.LAYERGROUP),this.handleLayerGroupChanged_,this),E(this,b(Zo.VIEW),this.handleViewChanged_,this),E(this,b(Zo.SIZE),this.handleSizeChanged_,this),E(this,b(Zo.TARGET),this.handleTargetChanged_,this),this.setProperties(e.values),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),E(this.controls,h,function(t){t.element.setMap(this)},this),E(this.controls,l,function(t){t.element.setMap(null)},this),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),E(this.interactions,h,function(t){t.element.setMap(this)},this),E(this.interactions,l,function(t){t.element.setMap(null)},this),this.overlays_.forEach(this.addOverlayInternal_.bind(this)),E(this.overlays_,h,function(t){this.addOverlayInternal_(t.element)},this),E(this.overlays_,l,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)},this)}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},t.prototype.addControl=function(t){this.getControls().push(t)},t.prototype.addInteraction=function(t){this.getInteractions().push(t)},t.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},t.prototype.addOverlay=function(t){this.getOverlays().push(t)},t.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},t.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),d(this.viewport_,w.CONTEXTMENU,this.handleBrowserEvent,this),d(this.viewport_,w.WHEEL,this.handleBrowserEvent,this),d(this.viewport_,w.MOUSEWHEEL,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(removeEventListener(w.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),s.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var r=this.getCoordinateFromPixel(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==i.layerFilter?i.layerFilter:y;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,n,e,null,o,null)}},t.prototype.getFeaturesAtPixel=function(t,e){var i=null;return this.forEachFeatureAtPixel(t,function(t){i||(i=[]),i.push(t)},e),i},t.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var r=i||{},n=void 0!==r.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=r.layerFilter||y;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,null,o,null)}},t.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:y,n=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,null)},t.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},t.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i=t.changedTouches?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},t.prototype.getTarget=function(){return this.get(Zo.TARGET)},t.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},t.prototype.getCoordinateFromPixel=function(t){var e=this.frameState_;return e?xe(e.pixelToCoordinateTransform,t.slice()):null},t.prototype.getControls=function(){return this.controls},t.prototype.getOverlays=function(){return this.overlays_},t.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},t.prototype.getInteractions=function(){return this.interactions},t.prototype.getLayerGroup=function(){return this.get(Zo.LAYERGROUP)},t.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},t.prototype.getPixelFromCoordinate=function(t){var e=this.frameState_;return e?xe(e.coordinateToPixelTransform,t.slice(0,2)):null},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.getSize=function(){return this.get(Zo.SIZE)},t.prototype.getView=function(){return this.get(Zo.VIEW)},t.prototype.getViewport=function(){return this.viewport_},t.prototype.getOverlayContainer=function(){return this.overlayContainer_},t.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},t.prototype.getTilePriority=function(t,e,i,r){var n=this.frameState_;if(!(n&&e in n.wantedTiles))return 1/0;if(!n.wantedTiles[e][t.getKey()])return 1/0;var o=i[0]-n.focus[0],s=i[1]-n.focus[1];return 65536*Math.log(r)+Math.sqrt(o*o+s*s)/r},t.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,r=new Zn(i,this,t);this.handleMapBrowserEvent(r)},t.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var e=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var i=e.length-1;0<=i;i--){var r=e[i];if(r.getActive())if(!r.handleEvent(t))break}}},t.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,r=i;if(t){var n=t.viewHints;n[rs.ANIMATING]&&(i=this.loadTilesWhileAnimating_?8:0,r=2),n[rs.INTERACTING]&&(i=this.loadTilesWhileInteracting_?8:0,r=2)}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,r))}for(var o=this.postRenderFunctions_,s=0,a=o.length;s<a;++s)o[s](this,t);o.length=0},t.prototype.handleSizeChanged_=function(){this.render()},t.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)g(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[E(r,w.KEYDOWN,this.handleBrowserEvent,this),E(r,w.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),addEventListener(w.RESIZE,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Ue(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(w.RESIZE,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},t.prototype.handleTileChange_=function(){this.render()},t.prototype.handleViewPropertyChanged_=function(){this.render()},t.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(g(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(g(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",Et(t)),this.viewPropertyListenerKey_=E(t,a,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=E(t,w.CHANGE,this.handleViewPropertyChanged_,this)),this.render()},t.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(g),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[E(t,a,this.render,this),E(t,w.CHANGE,this.render,this)]),this.render()},t.prototype.isRendered=function(){return!!this.frameState_},t.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},t.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},t.prototype.removeControl=function(t){return this.getControls().remove(t)},t.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},t.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},t.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},t.prototype.renderFrame_=function(t){var e,i,r=this.getSize(),n=this.getView(),o=[1/0,1/0,-1/0,-1/0],s=this.frameState_,a=null;if(void 0!==r&&(0<(i=r)[0]&&0<i[1])&&n&&n.isDef()){for(var h=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},c=0,p=l.length;c<p;++c)u[Et(l[c].layer)]=l[c];e=n.getState();var d=this.focus_;if(!d){d=e.center;var f=e.resolution/this.pixelRatio_;d[0]=Math.round(d[0]/f)*f,d[1]=Math.round(d[1]/f)*f}a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:o,focus:d,index:this.frameIndex_++,layerStates:u,layerStatesArray:l,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:h,wantedTiles:{}}}if(a&&(a.extent=st(e.center,e.resolution,e.rotation,a.size,o)),this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),s)(!this.previousExtent_||!pt(this.previousExtent_)&&!$(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Hn(Ko,this,s)),this.previousExtent_=z(this.previousExtent_));this.previousExtent_&&!a.viewHints[rs.ANIMATING]&&!a.viewHints[rs.INTERACTING]&&!$(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Hn(Ho,this,a)),k(a.extent,this.previousExtent_))}this.dispatchEvent(new Hn(Wo,this,a)),setTimeout(this.handlePostRender.bind(this),0)},t.prototype.setLayerGroup=function(t){this.set(Zo.LAYERGROUP,t)},t.prototype.setSize=function(t){this.set(Zo.SIZE,t)},t.prototype.setTarget=function(t){this.set(Zo.TARGET,t)},t.prototype.setView=function(t){this.set(Zo.VIEW,t)},t.prototype.skipFeature=function(t){var e=Et(t).toString();this.skippedFeatureUids_[e]=!0,this.render()},t.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0)},t.prototype.unskipFeature=function(t){var e=Et(t).toString();delete this.skippedFeatureUids_[e],this.render()},t}(R);var Is=function(e){function t(t){e.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:L,t.target&&this.setTarget(t.target)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.disposeInternal=function(){Ue(this.element),e.prototype.disposeInternal.call(this)},t.prototype.getMap=function(){return this.map_},t.prototype.setMap=function(t){this.map_&&Ue(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)g(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==L&&this.listenerKeys.push(E(t,Wo,this.render,this)),t.render())},t.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},t}(R),Ls=function(r){function t(t){var e=C({},t);delete e.source,r.call(this,e),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),E(this,b(_s),this.handleSourcePropertyChange_,this);var i=t.source?t.source:null;this.setSource(i)}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},t.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},t.prototype.getSource=function(){return this.get(_s)||null},t.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():ys},t.prototype.handleSourceChange_=function(){this.changed()},t.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(g(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=E(t,w.CHANGE,this.handleSourceChange_,this)),this.changed()},t.prototype.setMap=function(t){this.mapPrecomposeKey_&&(g(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(g(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=E(t,Tn,function(t){var e=this.getLayerState();e.managed=!1,e.zIndex=1/0,t.frameState.layerStatesArray.push(e),t.frameState.layerStates[Et(this)]=e},this),this.mapRenderKey_=E(this,w.CHANGE,t.render,t),this.changed())},t.prototype.setSource=function(t){this.set(_s,t)},t}(gs);function bs(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}var Ps=function(u){function t(t){var e=t||{};u.call(this,{element:document.createElement("div"),render:e.render||Fs,target:e.target}),this.ulElement_=document.createElement("UL"),this.collapsed_=void 0===e.collapsed||e.collapsed,this.collapsible_=void 0===e.collapsible||e.collapsible,this.collapsible_||(this.collapsed_=!1);var i=void 0!==e.className?e.className:"ol-attribution",r=void 0!==e.tipLabel?e.tipLabel:"Attributions",n=void 0!==e.collapseLabel?e.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var o=void 0!==e.label?e.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;var s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=r,a.appendChild(s),E(a,w.CLICK,this.handleClick_,this);var h=i+" "+_i+" "+gi+(this.collapsed_&&this.collapsible_?" "+yi:"")+(this.collapsible_?"":" ol-uncollapsible"),l=this.element;l.className=h,l.appendChild(this.ulElement_),l.appendChild(a),this.renderedAttributions_=[],this.renderedVisible_=!0}return u&&(t.__proto__=u),((t.prototype=Object.create(u&&u.prototype)).constructor=t).prototype.getSourceAttributions_=function(t){for(var e={},i=[],r=t.layerStatesArray,n=t.viewState.resolution,o=0,s=r.length;o<s;++o){var a=r[o];if(bs(a,n)){var h=a.layer.getSource();if(h){var l=h.getAttributions();if(l){var u=l(t);if(u)if(Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(i.push(u[c]),e[u[c]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return i},t.prototype.updateElement_=function(t){if(t){var e=this.getSourceAttributions_(t),i=0<e.length;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!fr(e,this.renderedAttributions_)){Ye(this.ulElement_);for(var r=0,n=e.length;r<n;++r){var o=document.createElement("LI");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(yi),this.collapsed_?je(this.collapseLabel_,this.label_):je(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t}(Is);function Fs(t){this.updateElement_(t.frameState)}var Ms=function(h){function t(t){var e=t||{};h.call(this,{element:document.createElement("div"),render:e.render||Os,target:e.target});var i=void 0!==e.className?e.className:"ol-rotate",r=void 0!==e.label?e.label:"⇧";this.label_=null,"string"==typeof r?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=r):(this.label_=r,this.label_.classList.add("ol-compass"));var n=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=i+"-reset",o.setAttribute("type","button"),o.title=n,o.appendChild(this.label_),E(o,w.CLICK,this.handleClick_,this);var s=i+" "+_i+" "+gi,a=this.element;a.className=s,a.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=void 0!==e.duration?e.duration:250,this.autoHide_=void 0===e.autoHide||e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(fi)}return h&&(t.__proto__=h),((t.prototype=Object.create(h&&h.prototype)).constructor=t).prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},t.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(0<this.duration_?t.animate({rotation:0,duration:this.duration_,easing:Yn}):t.setRotation(0))},t}(Is);function Os(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var r="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(fi);n||0!==i?n&&0!==i&&this.element.classList.remove(fi):this.element.classList.add(fi)}this.label_.style.msTransform=r,this.label_.style.webkitTransform=r,this.label_.style.transform=r}this.rotation_=i}}var Ns=function(p){function t(t){var e=t||{};p.call(this,{element:document.createElement("div"),target:e.target});var i=void 0!==e.className?e.className:"ol-zoom",r=void 0!==e.delta?e.delta:1,n=void 0!==e.zoomInLabel?e.zoomInLabel:"+",o=void 0!==e.zoomOutLabel?e.zoomOutLabel:"−",s=void 0!==e.zoomInTipLabel?e.zoomInTipLabel:"Zoom in",a=void 0!==e.zoomOutTipLabel?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i+"-in",h.setAttribute("type","button"),h.title=s,h.appendChild("string"==typeof n?document.createTextNode(n):n),E(h,w.CLICK,this.handleClick_.bind(this,r));var l=document.createElement("button");l.className=i+"-out",l.setAttribute("type","button"),l.title=a,l.appendChild("string"==typeof o?document.createTextNode(o):o),E(l,w.CLICK,this.handleClick_.bind(this,-r));var u=i+" "+_i+" "+gi,c=this.element;c.className=u,c.appendChild(h),c.appendChild(l),this.duration_=void 0!==e.duration?e.duration:250}return p&&(t.__proto__=p),((t.prototype=Object.create(p&&p.prototype)).constructor=t).prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},t.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var r=e.constrainResolution(i,t);0<this.duration_?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:r,duration:this.duration_,easing:Yn})):e.setResolution(r)}}},t}(Is);function As(t){var e=t||{},i=new M;return(void 0===e.zoom||e.zoom)&&i.push(new Ns(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Ms(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Ps(e.attributionOptions)),i}var Gs="active",ks=function(e){function t(t){e.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getActive=function(){return this.get(Gs)},t.prototype.getMap=function(){return this.map_},t.prototype.setActive=function(t){this.set(Gs,t)},t.prototype.setMap=function(t){this.map_=t},t}(R);function Ds(t,e,i,r){js(t,e=t.constrainRotation(e,0),i,r)}function js(t,e,i,r){if(void 0!==e){var n=t.getRotation(),o=t.getCenter();void 0!==n&&o&&0<r?t.animate({rotation:e,anchor:i,duration:r,easing:Yn}):t.rotate(e,i)}}function Us(t,e,i,r,n){Bs(t,e=t.constrainResolution(e,0,n),i,r)}function Ys(t,e,i,r){var n=t.getResolution(),o=t.constrainResolution(n,e,0);if(void 0!==o){var s=t.getResolutions();o=gt(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==o&&o!==n){var a=t.getCenter(),h=t.calculateCenterZoom(o,i);h=t.constrainCenter(h),i=[(o*a[0]-n*h[0])/(o-n),(o*a[1]-n*h[1])/(o-n)]}Bs(t,o,i,r)}function Bs(t,e,i,r){if(e){var n=t.getResolution(),o=t.getCenter();if(void 0!==n&&o&&e!==n&&r)t.animate({resolution:e,anchor:i,duration:r,easing:Yn});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}var Xs=function(i){function t(t){i.call(this,{handleEvent:zs});var e=t||{};this.delta_=e.delta?e.delta:1,this.duration_=void 0!==e.duration?e.duration:250}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(ks);function zs(t){var e=!1,i=t.originalEvent;if(t.type==qn.DBLCLICK){var r=t.map,n=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Ys(r.getView(),o,n,this.duration_),t.preventDefault(),e=!0}return!e}var Vs=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Ws=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ks=y,Hs=function(t){var e=t.originalEvent;return 0==e.button&&!(oi&&si&&e.ctrlKey)},Zs=v,qs=function(t){return"pointermove"==t.type},Js=function(t){return t.type==qn.SINGLECLICK},Qs=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},$s=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ta=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},ea=function(t){return Z(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},ia=function(t){var e=t.pointerEvent;return e.isPrimary&&0===e.button},ra=L,na=v,oa=v,sa=L,aa=function(i){function t(t){var e=t||{};i.call(this,{handleEvent:e.handleEvent||la}),this.handleDownEvent_=e.handleDownEvent?e.handleDownEvent:oa,this.handleDragEvent_=e.handleDragEvent?e.handleDragEvent:ra,this.handleMoveEvent_=e.handleMoveEvent?e.handleMoveEvent:sa,this.handleUpEvent_=e.handleUpEvent?e.handleUpEvent:na,this.handlingDownUpSequence=!1,this.stopDown=e.stopDown?e.stopDown:ua,this.trackedPointers_={},this.targetPointers=[]}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.updateTrackedPointers_=function(t){if((r=t.type)===qn.POINTERDOWN||r===qn.POINTERDRAG||r===qn.POINTERUP){var e=t.pointerEvent,i=e.pointerId.toString();t.type==qn.POINTERUP?delete this.trackedPointers_[i]:t.type==qn.POINTERDOWN?this.trackedPointers_[i]=e:i in this.trackedPointers_&&(this.trackedPointers_[i]=e),this.targetPointers=o(this.trackedPointers_)}var r},t}(ks);function ha(t){for(var e=t.length,i=0,r=0,n=0;n<e;n++)i+=t[n].clientX,r+=t[n].clientY;return[i/e,r/e]}function la(t){if(!(t instanceof Jn))return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==qn.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==qn.POINTERUP){var i=this.handleUpEvent_(t);this.handlingDownUpSequence=i&&0<this.targetPointers.length}}else if(t.type==qn.POINTERDOWN){var r=this.handleDownEvent_(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==qn.POINTERMOVE&&this.handleMoveEvent_(t);return!e}function ua(t){return t}var ca=function(i){function t(t){i.call(this,{handleDownEvent:fa,handleDragEvent:pa,handleUpEvent:da,stopDown:v});var e=t||{};this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.condition_=e.condition?e.condition:Qs,this.noKinetic_=!1}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(aa);function pa(t){var e=this.targetPointers,i=ha(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var r=this.lastCentroid[0]-i[0],n=i[1]-this.lastCentroid[1],o=t.map.getView(),s=[r,n];dn(s,o.getResolution()),pn(s,o.getRotation()),an(s,o.getCenter()),s=o.constrainCenter(s),o.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length}function da(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),o=i.getCenter(),s=e.getPixelFromCoordinate(o),a=e.getCoordinateFromPixel([s[0]-r*Math.cos(n),s[1]-r*Math.sin(n)]);i.animate({center:i.constrainCenter(a),duration:500,easing:Yn})}return i.setHint(rs.INTERACTING,-1),!1}return this.kinetic_&&this.kinetic_.begin(),!(this.lastCentroid=null)}function fa(t){if(0<this.targetPointers.length&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||e.setHint(rs.INTERACTING,1),e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=1<this.targetPointers.length,!0}return!1}var _a=function(i){function t(t){var e=t||{};i.call(this,{handleDownEvent:va,handleDragEvent:ga,handleUpEvent:ya,stopDown:v}),this.condition_=e.condition?e.condition:Ws,this.lastAngle_=void 0,this.duration_=void 0!==e.duration?e.duration:250}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(aa);function ga(t){if(ea(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==es){var r=e.getSize(),n=t.pixel,o=Math.atan2(r[1]/2-n[1],n[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;js(i,i.getRotation()-s)}this.lastAngle_=o}}}function ya(t){if(!ea(t))return!0;var e=t.map.getView();return e.setHint(rs.INTERACTING,-1),Ds(e,e.getRotation(),void 0,this.duration_),!1}function va(t){return!!ea(t)&&(!(!Hs(t)||!this.condition_(t))&&(t.map.getView().setHint(rs.INTERACTING,1),!(this.lastAngle_=void 0)))}var ma=function(e){function t(t){e.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},t.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},t.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Qr([i])},t.prototype.getGeometry=function(){return this.geometry_},t}(t),xa={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},Sa=function(r){function t(t,e,i){r.call(this,t),this.coordinate=e,this.mapBrowserEvent=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),Ca=function(i){function t(t){i.call(this,{handleDownEvent:Ra,handleDragEvent:Ta,handleUpEvent:wa});var e=t||{};this.box_=new ma(e.className||"ol-dragbox"),this.minArea_=void 0!==e.minArea?e.minArea:64,this.onBoxEnd_=e.onBoxEnd?e.onBoxEnd:L,this.startPixel_=null,this.condition_=e.condition?e.condition:Ks,this.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:Ea}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getGeometry=function(){return this.box_.getGeometry()},t}(aa);function Ea(t,e,i){var r=i[0]-e[0],n=i[1]-e[1];return r*r+n*n>=this.minArea_}function Ta(t){ea(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Sa(xa.BOXDRAG,t.coordinate,t)))}function wa(t){return!ea(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new Sa(xa.BOXEND,t.coordinate,t))),!1)}function Ra(t){return!!ea(t)&&(!(!Hs(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Sa(xa.BOXSTART,t.coordinate,t)),!0))}var Ia=function(r){function t(t){var e=t||{},i=e.condition?e.condition:$s;r.call(this,{condition:i,className:e.className||"ol-dragzoom",onBoxEnd:La}),this.duration_=void 0!==e.duration?e.duration:200,this.out_=void 0!==e.out&&e.out}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Ca);function La(){var t=this.getMap(),e=t.getView(),i=t.getSize(),r=this.getGeometry().getExtent();if(this.out_){var n=e.calculateExtent(i),o=W([t.getPixelFromCoordinate(rt(r)),t.getPixelFromCoordinate(ut(r))]);dt(n,1/e.getResolutionForExtent(o,i)),r=n}var s=e.constrainResolution(e.getResolutionForExtent(r,i)),a=ot(r);a=e.constrainCenter(a),e.animate({resolution:s,center:a,duration:this.duration_,easing:Yn})}var ba={LEFT:37,UP:38,RIGHT:39,DOWN:40},Pa=function(i){function t(t){i.call(this,{handleEvent:Fa});var e=t||{};this.defaultCondition_=function(t){return Qs(t)&&ta(t)},this.condition_=void 0!==e.condition?e.condition:this.defaultCondition_,this.duration_=void 0!==e.duration?e.duration:100,this.pixelDelta_=void 0!==e.pixelDelta?e.pixelDelta:128}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(ks);function Fa(t){var e=!1;if(t.type==w.KEYDOWN){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==ba.DOWN||i==ba.LEFT||i==ba.RIGHT||i==ba.UP)){var r=t.map.getView(),n=r.getResolution()*this.pixelDelta_,o=0,s=0;i==ba.DOWN?s=-n:i==ba.LEFT?o=-n:i==ba.RIGHT?o=n:s=n;var a=[o,s];pn(a,r.getRotation()),function(t,e,i){var r=t.getCenter();if(r){var n=t.constrainCenter([r[0]+e[0],r[1]+e[1]]);i?t.animate({duration:i,easing:Xn,center:n}):t.setCenter(n)}}(r,a,this.duration_),t.preventDefault(),e=!0}}return!e}var Ma=function(i){function t(t){i.call(this,{handleEvent:Oa});var e=t||{};this.condition_=e.condition?e.condition:ta,this.delta_=e.delta?e.delta:1,this.duration_=void 0!==e.duration?e.duration:100}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(ks);function Oa(t){var e=!1;if(t.type==w.KEYDOWN||t.type==w.KEYPRESS){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var r=t.map,n=i=="+".charCodeAt(0)?this.delta_:-this.delta_;Ys(r.getView(),n,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}var Na={TRACKPAD:"trackpad",WHEEL:"wheel"},Aa=function(i){function t(t){i.call(this,{handleEvent:Ga});var e=t||{};this.delta_=0,this.duration_=void 0!==e.duration?e.duration:250,this.timeout_=void 0!==e.timeout?e.timeout:80,this.useAnchor_=void 0===e.useAnchor||e.useAnchor,this.constrainResolution_=e.constrainResolution||!1,this.condition_=e.condition?e.condition:Ks,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(rs.INTERACTING,-1)},t.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();Ys(e,-gt(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},t.prototype.setMouseAnchor=function(t){(this.useAnchor_=t)||(this.lastAnchor_=null)},t}(ks);function Ga(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==w.WHEEL&&e!==w.MOUSEWHEEL)return!0;t.preventDefault();var i,r=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==w.WHEEL?(i=n.deltaY,ri&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=ai),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==w.MOUSEWHEEL&&(i=-n.wheelDeltaY,ni&&(i/=3)),0===i)return!1;var o=Date.now();if(void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?Na.TRACKPAD:Na.WHEEL),this.mode_===Na.TRACKPAD){var s=r.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(rs.INTERACTING,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=s.getMinResolution(),l=s.getMaxResolution(),u=0;if(a<h?(a=Math.max(a,h/this.trackpadZoomBuffer_),u=1):l<a&&(a=Math.min(a,l*this.trackpadZoomBuffer_),u=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===u&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,0<i?-1:1),easing:Yn,anchor:this.lastAnchor_,duration:this.duration_}),0<u?s.animate({resolution:h,easing:Yn,anchor:this.lastAnchor_,duration:500}):u<0&&s.animate({resolution:l,easing:Yn,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=i;var p=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),p),!1}var ka=function(i){function t(t){i.call(this,{handleDownEvent:Ua,handleDragEvent:Da,handleUpEvent:ja,stopDown:v});var e=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==e.threshold?e.threshold:.3,this.duration_=void 0!==e.duration?e.duration:250}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(aa);function Da(t){var e=0,i=this.targetPointers[0],r=this.targetPointers[1],n=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=n-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=n;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==es){var h=s.getViewport().getBoundingClientRect(),l=ha(this.targetPointers);if(l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixel(l),this.rotating_){var u=a.getRotation();s.render(),js(a,u+e,this.anchor_)}}}function ja(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(rs.INTERACTING,-1),this.rotating_)Ds(e,e.getRotation(),this.anchor_,this.duration_);return!1}return!0}function Ua(t){if(2<=this.targetPointers.length){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint(rs.INTERACTING,1),!0}return!1}var Ya=function(i){function t(t){i.call(this,{handleDownEvent:za,handleDragEvent:Ba,handleUpEvent:Xa,stopDown:v});var e=t||{};this.constrainResolution_=e.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==e.duration?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(aa);function Ba(t){var e=1,i=this.targetPointers[0],r=this.targetPointers[1],n=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,h=a.getView(),l=h.getResolution(),u=h.getMaxResolution(),c=h.getMinResolution(),p=l*e;u<p?(e=u/l,p=u):p<c&&(e=c/l,p=c),1!=e&&(this.lastScaleDelta_=e);var d=a.getViewport().getBoundingClientRect(),f=ha(this.targetPointers);f[0]-=d.left,f[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(f),a.render(),Bs(h,p,this.anchor_)}function Xa(t){if(this.targetPointers.length<2){var e=t.map.getView();e.setHint(rs.INTERACTING,-1);var i=e.getResolution();if(this.constrainResolution_||i<e.getMinResolution()||i>e.getMaxResolution()){var r=this.lastScaleDelta_-1;Us(e,i,this.anchor_,this.duration_,r)}return!1}return!0}function za(t){if(2<=this.targetPointers.length){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().setHint(rs.INTERACTING,1),!0}return!1}var Va="addfeatures",Wa=function(n){function t(t,e,i,r){n.call(this,t),this.features=i,this.file=e,this.projection=r}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(m),Ka=function(i){function t(t){var e=t||{};i.call(this,{handleEvent:y}),this.formatConstructors_=e.formatConstructors?e.formatConstructors:[],this.projection_=e.projection?ne(e.projection):null,this.dropListenKeys_=null,this.source_=e.source||null,this.target=e.target?e.target:null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.handleResult_=function(t,e){var i=e.target.result,r=this.getMap(),n=this.projection_;n||(n=r.getView().getProjection());for(var o=this.formatConstructors_,s=[],a=0,h=o.length;a<h;++a){var l=new o[a];if((s=this.tryReadFeatures_(l,i,{featureProjection:n}))&&0<s.length)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(s)),this.dispatchEvent(new Wa(Va,t,s,n))},t.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[E(e,w.DROP,Ha,this),E(e,w.DRAGENTER,Za,this),E(e,w.DRAGOVER,Za,this),E(e,w.DROP,Za,this)]}},t.prototype.setActive=function(t){i.prototype.setActive.call(this,t),t?this.registerListeners_():this.unregisterListeners_()},t.prototype.setMap=function(t){this.unregisterListeners_(),i.prototype.setMap.call(this,t),this.getActive()&&this.registerListeners_()},t.prototype.tryReadFeatures_=function(t,e,i){try{return t.readFeatures(e,i)}catch(t){return null}},t.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(g),this.dropListenKeys_=null)},t}(ks);function Ha(t){for(var e=t.dataTransfer.files,i=0,r=e.length;i<r;++i){var n=e.item(i),o=new FileReader;o.addEventListener(w.LOAD,this.handleResult_.bind(this,n)),o.readAsText(n)}}function Za(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}var qa=function(i){function t(t){var e=t||{};i.call(this,{handleDownEvent:$a,handleDragEvent:Ja,handleUpEvent:Qa}),this.condition_=e.condition?e.condition:$s,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=void 0!==e.duration?e.duration:400}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(aa);function Ja(t){if(ea(t)){var e=t.map,i=e.getSize(),r=t.pixel,n=r[0]-i[0]/2,o=i[1]/2-r[1],s=Math.atan2(o,n),a=Math.sqrt(n*n+o*o),h=e.getView();if(h.getConstraints().rotation!==es&&void 0!==this.lastAngle_){var l=s-this.lastAngle_;js(h,h.getRotation()-l)}if(this.lastAngle_=s,void 0!==this.lastMagnitude_)Bs(h,this.lastMagnitude_*(h.getResolution()/a));void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}}function Qa(t){if(!ea(t))return!0;var e=t.map.getView();e.setHint(rs.INTERACTING,-1);var i=this.lastScaleDelta_-1;return Ds(e,e.getRotation()),Us(e,e.getResolution(),void 0,this.duration_,i),this.lastScaleDelta_=0,!1}function $a(t){return!!ea(t)&&(!!this.condition_(t)&&(t.map.getView().setHint(rs.INTERACTING,1),this.lastAngle_=void 0,!(this.lastMagnitude_=void 0)))}var th=function(n){function t(t,e,i){if(n.call(this),void 0!==i&&void 0===e)this.setFlatCoordinates(i,t);else{var r=e||0;this.setCenterAndRadius(t,r,i)}}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.clone=function(){return new t(this.flatCoordinates.slice(),void 0,this.layout)},t.prototype.closestPointXY=function(t,e,i,r){var n=this.flatCoordinates,o=t-n[0],s=e-n[1],a=o*o+s*s;if(a<r){if(0===a)for(var h=0;h<this.stride;++h)i[h]=n[h];else{var l=this.getRadius()/Math.sqrt(a);i[0]=n[0]+l*o,i[1]=n[1]+l*s;for(var u=2;u<this.stride;++u)i[u]=n[u]}return i.length=this.stride,a}return r},t.prototype.containsXY=function(t,e){var i=this.flatCoordinates,r=t-i[0],n=e-i[1];return r*r+n*n<=this.getRadiusSquared_()},t.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return X(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},t.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},t.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},t.prototype.getType=function(){return Lt.CIRCLE},t.prototype.intersectsExtent=function(t){if(wt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||et(t,this.intersectsCoordinate,this))}return!1},t.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+i;for(var n=1;n<e;++n)r[e+n]=t[n];this.setFlatCoordinates(this.layout,r),this.changed()},t.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,n=Ir(r,0,t,this.stride);r[n++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[n++]=r[o];r.length=n,this.changed()},t.prototype.getCoordinates=function(){},t.prototype.setCoordinates=function(t,e){},t.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},t}(vr);th.prototype.transform;var eh=function(l){function r(t,e,i){if(l.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{for(var r=this.getLayout(),n=[],o=[],s=0,a=t.length;s<a;++s){var h=t[s];0===s&&(r=h.getLayout()),pr(n,h.getFlatCoordinates()),o.push(n.length)}this.setFlatCoordinates(r,n),this.ends_=o}}return l&&(r.__proto__=l),((r.prototype=Object.create(l&&l.prototype)).constructor=r).prototype.appendLineString=function(t){this.flatCoordinates?pr(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},r.prototype.clone=function(){return new r(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},r.prototype.closestPointXY=function(t,e,i,r){return r<D(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Rr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))},r.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=yr.XYM&&this.layout!=yr.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,r,n,o,s){if(s)return mn(t,e,i[i.length-1],r,n,o);var a;if(n<t[r-1])return o?((a=t.slice(0,r))[r-1]=n,a):null;if(t[t.length-1]<n)return o?((a=t.slice(t.length-r))[r-1]=n,a):null;for(var h=0,l=i.length;h<l;++h){var u=i[h];if(e!=u){if(n<t[e+r-1])return null;if(n<=t[u-1])return mn(t,e,u,r,n,!1);e=u}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,n)},r.prototype.getCoordinates=function(){return Fr(this.flatCoordinates,0,this.ends_,this.stride)},r.prototype.getEnds=function(){return this.ends_},r.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Sn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},r.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,i=this.layout,r=[],n=0,o=0,s=e.length;o<s;++o){var a=e[o],h=new Sn(t.slice(n,a),i);r.push(h),n=a}return r},r.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];pr(t,vn(e,i,a,n,.5)),i=a}return t},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];return e.length=function(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=Or(t,e,u,r,n,o,s),a.push(s),e=u}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new r(e,yr.XY,i)},r.prototype.getType=function(){return Lt.MULTI_LINE_STRING},r.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){if(Vr(t,e,i[o],r,n))return!0;e=i[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=br(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},r}(vr),ih=function(i){function t(t,e){i.call(this),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.appendPoint=function(t){this.flatCoordinates?pr(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(t,e,i,r){if(r<D(this.getExtent(),t,e))return r;for(var n=this.flatCoordinates,o=this.stride,s=0,a=n.length;s<a;s+=o){var h=mt(t,e,n[s],n[s+1]);if(h<r){r=h;for(var l=0;l<o;++l)i[l]=n[s+l];i.length=o}}return r},t.prototype.getCoordinates=function(){return Pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Dr(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,r=[],n=0,o=t.length;n<o;n+=i){var s=new Dr(t.slice(n,n+i),e);r.push(s)}return r},t.prototype.getType=function(){return Lt.MULTI_POINT},t.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,r=0,n=e.length;r<n;r+=i){if(U(t,e[r],e[r+1]))return!0}return!1},t.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Lr(this.flatCoordinates,0,t,this.stride),this.changed()},t}(vr);function rh(t,e,i,r){for(var n=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var h=i[s];o=K(t,e,h[0],r),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=h[h.length-1]}return n}var nh=function(d){function r(t,e,i){if(d.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){for(var r=this.getLayout(),n=[],o=[],s=0,a=t.length;s<a;++s){var h=t[s];0===s&&(r=h.getLayout());for(var l=n.length,u=h.getEnds(),c=0,p=u.length;c<p;++c)u[c]+=l;pr(n,h.getFlatCoordinates()),o.push(u)}e=r,t=n,i=o}void 0!==e&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}return d&&(r.__proto__=d),((r.prototype=Object.create(d&&d.prototype)).constructor=r).prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;pr(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,n=(e=t.getEnds().slice()).length;r<n;++r)e[r]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},r.prototype.clone=function(){for(var t=this.endss_.length,e=new Array(t),i=0;i<t;++i)e[i]=this.endss_[i].slice();return new r(this.flatCoordinates.slice(),this.layout,e)},r.prototype.closestPointXY=function(t,e,i,r){return r<D(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];n=Tr(t,e,a,r,n),e=a[a.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,r,n,o,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=Rr(t,e,f,r,n,o,s,a,h,l,c),e=f[f.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,r))},r.prototype.containsXY=function(t,e){return function(t,e,i,r,n,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var h=i[s];if(Yr(t,e,h,r,n,o))return!0;e=h[h.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},r.prototype.getArea=function(){return function(t,e,i,r){for(var n=0,o=0,s=i.length;o<s;++o){var a=i[o];n+=Sr(t,e,a,r),e=a[a.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},r.prototype.getCoordinates=function(t){var e;return void 0!==t?Jr(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Mr(e,0,this.endss_,this.stride)},r.prototype.getEndss=function(){return this.endss_},r.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=rh(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Xr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},r.prototype.getInteriorPoints=function(){return new ih(this.getFlatInteriorPoints().slice(),yr.XYM)},r.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o)if(!Zr(t,e,i[o],r,n))return!1;return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Jr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},r.prototype.getSimplifiedGeometryInternal=function(t){var e=[],i=[];return e.length=function(t,e,i,r,n,o,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h],c=[];s=Gr(t,e,u,r,n,o,s,c),a.push(c),e=u[u.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new r(e,yr.XY,i)},r.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 r=this.endss_[t].slice(),n=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Qr(this.flatCoordinates.slice(e,n),this.layout,r)},r.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],n=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),h=a[a.length-1];if(0!==n)for(var l=0,u=a.length;l<u;++l)a[l]-=n;var c=new Qr(e.slice(n,h),t,a);r.push(c),n=h}return r},r.prototype.getType=function(){return Lt.MULTI_POLYGON},r.prototype.intersectsExtent=function(t){return function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(Wr(t,e,a,r,n))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},r.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,r,n){for(var o=n||[],s=0,a=0,h=i.length;a<h;++a){var l=br(t,e,i[a],r,o[s]);e=(o[s++]=l)[l.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},r}(vr),oh={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"},sh="image",ah="vector",hh="renderOrder",lh=function(r){function t(t){var e=t||{},i=C({},e);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,r.call(this,i),this.declutter_=void 0!==e.declutter&&e.declutter,this.renderBuffer_=void 0!==e.renderBuffer?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=void 0!==e.updateWhileAnimating&&e.updateWhileAnimating,this.updateWhileInteracting_=void 0!==e.updateWhileInteracting&&e.updateWhileInteracting,this.renderMode_=e.renderMode||ah,this.type=oh.VECTOR}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.getDeclutter=function(){return this.declutter_},t.prototype.setDeclutter=function(t){this.declutter_=t},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(hh)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.setRenderOrder=function(t){this.set(hh,t)},t.prototype.setStyle=function(t){var e,i,r;this.style_=void 0!==t?t:Hi,this.styleFunction_=null===t?void 0:("function"==typeof(e=this.style_)?i=e:(Array.isArray(e)?r=e:(Z(e instanceof Wi,41),r=[e]),i=function(){return r}),i),this.changed()},t.prototype.getRenderMode=function(){return this.renderMode_},t}(Ls);lh.prototype.getSource;var uh={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};function ch(i,o,s,a){return function(t,e,r){var n=new XMLHttpRequest;n.open("GET","function"==typeof i?i(t,e,r):i,!0),o.getType()==uh.ARRAY_BUFFER&&(n.responseType="arraybuffer"),n.onload=function(t){if(!n.status||200<=n.status&&n.status<300){var e,i=o.getType();i==uh.JSON||i==uh.TEXT?e=n.responseText:i==uh.XML?(e=n.responseXML)||(e=(new DOMParser).parseFromString(n.responseText,"application/xml")):i==uh.ARRAY_BUFFER&&(e=n.response),e?s.call(this,o.readFeatures(e,{featureProjection:r}),o.readProjection(e),o.getLastExtent()):a.call(this)}else a.call(this)}.bind(this),n.onerror=function(){a.call(this)}.bind(this),n.send()}}function ph(t,e){return ch(t,e,function(t,e){this.addFeatures(t)},L)}function dh(t,e){return[[-1/0,-1/0,1/0,1/0]]}var fh=function(e){function t(t){e.call(this),this.projection_=ne(t.projection),this.attributions_=this.adaptAttributions_(t.attributions),this.state_=void 0!==t.state?t.state:ms,this.wrapX_=void 0!==t.wrapX&&t.wrapX}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.adaptAttributions_=function(e){return e?Array.isArray(e)?function(t){return e}:"function"==typeof e?e:function(t){return[e]}:null},t.prototype.getAttributions=function(){return this.attributions_},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolutions=function(){},t.prototype.getState=function(){return this.state_},t.prototype.getWrapX=function(){return this.wrapX_},t.prototype.refresh=function(){this.changed()},t.prototype.setAttributions=function(t){this.attributions_=this.adaptAttributions_(t),this.changed()},t.prototype.setState=function(t){this.state_=t,this.changed()},t}(R);fh.prototype.forEachFeatureAtCoordinate=L;var _h="addfeature",gh="changefeature",yh="clear",vh="removefeature";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var mh,xh=(function(t,e){t.exports=function(){function g(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function o(t,e){return t<e?-1:e<t?1:0}return function(t,e,i,r,n){!function t(e,i,r,n,o){for(;r<n;){if(600<n-r){var s=n-r+1,a=i-r+1,h=Math.log(s),l=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*l*(s-l)/s)*(a-s/2<0?-1:1),c=Math.max(r,Math.floor(i-a*l/s+u)),p=Math.min(n,Math.floor(i+(s-a)*l/s+u));t(e,i,c,p,o)}var d=e[i],f=r,_=n;for(g(e,r,i),0<o(e[n],d)&&g(e,r,n);f<_;){for(g(e,f,_),f++,_--;o(e[f],d)<0;)f++;for(;0<o(e[_],d);)_--}0===o(e[r],d)?g(e,r,_):g(e,++_,n),_<=i&&(r=_+1),i<=_&&(n=_-1)}}(t,e,i||0,r||t.length-1,n||o)}}()}(mh={exports:{}},mh.exports),mh.exports),Sh=Eh,Ch=Eh;function Eh(t,e){if(!(this instanceof Eh))return new Eh(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Th(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function wh(t,e){Rh(t,0,t.children.length,e,t)}function Rh(t,e,i,r,n){n||(n=Nh(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o,s=e;s<i;s++)o=t.children[s],Ih(n,t.leaf?r(o):o);return n}function Ih(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 Lh(t,e){return t.minX-e.minX}function bh(t,e){return t.minY-e.minY}function Ph(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Fh(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Mh(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Oh(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Nh(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ah(t,e,i,r,n){for(var o,s=[e,i];s.length;)(i=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((i-e)/r/2)*r,xh(t,o,e,i,n),s.push(e,o,o,i))}Eh.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!Oh(t,e))return i;for(var n,o,s,a,h=[];e;){for(n=0,o=e.children.length;n<o;n++)s=e.children[n],Oh(t,a=e.leaf?r(s):s)&&(e.leaf?i.push(s):Mh(t,a)?this._all(s,i):h.push(s));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!Oh(t,e))return!1;for(var r,n,o,s,a=[];e;){for(r=0,n=e.children.length;r<n;r++)if(o=e.children[r],Oh(t,s=e.leaf?i(o):o)){if(e.leaf||Mh(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=Nh([]),this},remove:function(t,e){if(!t)return this;for(var i,r,n,o,s=this.data,a=this.toBBox(t),h=[],l=[];s||h.length;){if(s||(s=h.pop(),r=h[h.length-1],i=l.pop(),o=!0),s.leaf&&-1!==(n=Th(t,s.children,e)))return s.children.splice(n,1),h.push(s),this._condense(h),this;o||s.leaf||!Mh(s,a)?r?(i++,s=r.children[i],o=!1):s=null:(h.push(s),l.push(i),i=0,s=(r=s).children[0])}return this},toBBox:function(t){return t},compareMinX:Lh,compareMinY:bh,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,r){var n,o=i-e+1,s=this._maxEntries;if(o<=s)return wh(n=Nh(t.slice(e,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(n=Nh([])).leaf=!1,n.height=r;var a,h,l,u,c=Math.ceil(o/s),p=c*Math.ceil(Math.sqrt(s));for(Ah(t,e,i,p,this.compareMinX),a=e;a<=i;a+=p)for(Ah(t,a,l=Math.min(a+p-1,i),c,this.compareMinY),h=a;h<=l;h+=c)u=Math.min(h+c-1,l),n.children.push(this._build(t,h,u,r-1));return wh(n,this.toBBox),n},_chooseSubtree:function(t,e,i,r){for(var n,o,s,a,h,l,u,c,p,d;r.push(e),!e.leaf&&r.length-1!==i;){for(u=c=1/0,n=0,o=e.children.length;n<o;n++)h=Ph(s=e.children[n]),p=t,d=s,(l=(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-h)<c?(c=l,u=h<u?h:u,a=s):l===c&&h<u&&(u=h,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var r=this.toBBox,n=i?t:r(t),o=[],s=this._chooseSubtree(n,this.data,e,o);for(s.children.push(t),Ih(s,n);0<=e&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},_split:function(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),s=Nh(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,wh(i,this.toBBox),wh(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},_splitRoot:function(t,e){this.data=Nh([t,e]),this.data.height=t.height+1,this.data.leaf=!1,wh(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,n,o,s,a,h,l,u,c,p,d,f,_,g;for(h=l=1/0,r=e;r<=i-e;r++)n=Rh(t,0,r,this.toBBox),o=Rh(t,r,i,this.toBBox),c=n,p=o,void 0,d=Math.max(c.minX,p.minX),f=Math.max(c.minY,p.minY),_=Math.min(c.maxX,p.maxX),g=Math.min(c.maxY,p.maxY),s=Math.max(0,_-d)*Math.max(0,g-f),a=Ph(n)+Ph(o),s<h?(h=s,u=r,l=a<l?a:l):s===h&&a<l&&(l=a,u=r);return u},_chooseSplitAxis:function(t,e,i){var r=t.leaf?this.compareMinX:Lh,n=t.leaf?this.compareMinY:bh;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)},_allDistMargin:function(t,e,i,r){t.children.sort(r);var n,o,s=this.toBBox,a=Rh(t,0,e,s),h=Rh(t,i-e,i,s),l=Fh(a)+Fh(h);for(n=e;n<i-e;n++)o=t.children[n],Ih(a,t.leaf?s(o):o),l+=Fh(a);for(n=i-e-1;e<=n;n--)o=t.children[n],Ih(h,t.leaf?s(o):o),l+=Fh(h);return l},_adjustParentBBoxes:function(t,e,i){for(var r=i;0<=r;r--)Ih(e[r],t)},_condense:function(t){for(var e,i=t.length-1;0<=i;i--)0===t[i].children.length?0<i?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():wh(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},Sh.default=Ch;var Gh=function(t){this.rbush_=Sh(t,void 0),this.items_={}};Gh.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_[Et(e)]=i},Gh.prototype.load=function(t,e){for(var i=new Array(e.length),r=0,n=e.length;r<n;r++){var o=t[r],s=e[r],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[r]=a,this.items_[Et(s)]=a}this.rbush_.load(i)},Gh.prototype.remove=function(t){var e=Et(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},Gh.prototype.update=function(t,e){var i=this.items_[Et(e)];$([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},Gh.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},Gh.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})},Gh.prototype.forEach=function(t,e){return this.forEach_(this.getAll(),t,e)},Gh.prototype.forEachInExtent=function(t,e,i){return this.forEach_(this.getInExtent(t),e,i)},Gh.prototype.forEach_=function(t,e,i){for(var r,n=0,o=t.length;n<o;n++)if(r=e.call(i,t[n]))return r;return r},Gh.prototype.isEmpty=function(){return Tt(this.items_)},Gh.prototype.clear=function(){this.rbush_.clear(),this.items_={}},Gh.prototype.getExtent=function(t){var e=this.rbush_.data;return X(e.minX,e.minY,e.maxX,e.maxY,t)},Gh.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|e]=t.items_[0|e]};var kh=function(i){function t(t,e){i.call(this,t),this.feature=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(m),Dh=function(o){function t(t){var e=t||{};o.call(this,{attributions:e.attributions,projection:void 0,state:ms,wrapX:void 0===e.wrapX||e.wrapX}),this.loader_=L,this.format_=e.format,this.overlaps_=null==e.overlaps||e.overlaps,this.url_=e.url,void 0!==e.loader?this.loader_=e.loader:void 0!==this.url_&&(Z(this.format_,7),this.loader_=ph(this.url_,this.format_)),this.strategy_=void 0!==e.strategy?e.strategy:dh;var i,r,n=void 0===e.useSpatialIndex||e.useSpatialIndex;this.featuresRtree_=n?new Gh:null,this.loadedExtentsRtree_=new Gh,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,e.features instanceof M?r=(i=e.features).getArray():Array.isArray(e.features)&&(r=e.features),n||void 0!==i||(i=new M(r)),void 0!==r&&this.addFeaturesInternal(r),void 0!==i&&this.bindFeaturesCollection_(i)}return o&&(t.__proto__=o),(t.prototype=Object.create(o&&o.prototype)).constructor=t}(fh);Dh.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},Dh.prototype.addFeatureInternal=function(t){var e=Et(t).toString();if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new kh(_h,t))}},Dh.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[E(e,w.CHANGE,this.handleFeatureChange_,this),E(e,a,this.handleFeatureChange_,this)]},Dh.prototype.addToIndex_=function(t,e){var i=!0,r=e.getId();return void 0!==r?r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=e:(Z(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=e),i},Dh.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},Dh.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],r=[],n=0,o=t.length;n<o;n++){var s=t[n],a=Et(s).toString();this.addToIndex_(a,s)&&i.push(s)}for(var h=0,l=i.length;h<l;h++){var u=i[h],c=Et(u).toString();this.setupChangeEvents_(c,u);var p=u.getGeometry();if(p){var d=p.getExtent();e.push(d),r.push(u)}else this.nullGeometryFeatures_[c]=u}this.featuresRtree_&&this.featuresRtree_.load(e,r);for(var f=0,_=i.length;f<_;f++)this.dispatchEvent(new kh(_h,i[f]))},Dh.prototype.bindFeaturesCollection_=function(e){var i=!1;E(this,_h,function(t){i||(i=!0,e.push(t.feature),i=!1)}),E(this,vh,function(t){i||(i=!0,e.remove(t.feature),i=!1)}),E(e,h,function(t){i||(i=!0,this.addFeature(t.element),i=!1)},this),E(e,l,function(t){i||(i=!0,this.removeFeature(t.element),i=!1)},this),this.featuresCollection_=e},Dh.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(g)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var r=new kh(yh);this.dispatchEvent(r),this.changed()},Dh.prototype.forEachFeature=function(t){return this.featuresRtree_?this.featuresRtree_.forEach(t):this.featuresCollection_?this.featuresCollection_.forEach(t):void 0},Dh.prototype.forEachFeatureAtCoordinateDirect=function(e,i){var t=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(t,function(t){return t.getGeometry().intersectsCoordinate(e)?i(t):void 0})},Dh.prototype.forEachFeatureInExtent=function(t,e){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,e):this.featuresCollection_?this.featuresCollection_.forEach(e):void 0},Dh.prototype.forEachFeatureIntersectingExtent=function(i,r){return this.forEachFeatureInExtent(i,function(t){if(t.getGeometry().intersectsExtent(i)){var e=r(t);if(e)return e}})},Dh.prototype.getFeaturesCollection=function(){return this.featuresCollection_},Dh.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Tt(this.nullGeometryFeatures_)||pr(t,o(this.nullGeometryFeatures_))),t},Dh.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e},Dh.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},Dh.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],o=t[1],s=null,a=[NaN,NaN],h=1/0,l=[-1/0,-1/0,1/0,1/0],u=e||y;return this.featuresRtree_.forEachInExtent(l,function(t){if(u(t)){var e=t.getGeometry(),i=h;if((h=e.closestPointXY(n,o,a,h))<i){s=t;var r=Math.sqrt(h);l[0]=n-r,l[1]=o-r,l[2]=n+r,l[3]=o+r}}}),s},Dh.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},Dh.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},Dh.prototype.getFormat=function(){return this.format_},Dh.prototype.getOverlaps=function(){return this.overlaps_},Dh.prototype.getResolutions=function(){},Dh.prototype.getUrl=function(){return this.url_},Dh.prototype.handleFeatureChange_=function(t){var e=t.target,i=Et(e).toString(),r=e.getGeometry();if(r){var n=r.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 o=e.getId();if(void 0!==o){var s=o.toString();i in this.undefIdIndex_?(delete this.undefIdIndex_[i],this.idIndex_[s]=e):this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else i in this.undefIdIndex_||(this.removeFromIdIndex_(e),this.undefIdIndex_[i]=e);this.changed(),this.dispatchEvent(new kh(gh,e))},Dh.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Et(t).toString()in this.undefIdIndex_},Dh.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Tt(this.nullGeometryFeatures_)},Dh.prototype.loadFeatures=function(t,r,n){for(var o=this,s=this.loadedExtentsRtree_,a=this.strategy_(t,r),e=function(t,e){var i=a[t];s.forEachInExtent(i,function(t){return Q(t.extent,i)})||(o.loader_.call(o,i,r,n),s.insert(i,{extent:i.slice()}))},i=0,h=a.length;i<h;++i)e(i)},Dh.prototype.removeLoadedExtent=function(e){var i,t=this.loadedExtentsRtree_;t.forEachInExtent(e,function(t){if($(t.extent,e))return i=t,!0}),i&&t.remove(i)},Dh.prototype.removeFeature=function(t){var e=Et(t).toString();e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},Dh.prototype.removeFeatureInternal=function(t){var e=Et(t).toString();this.featureChangeKeys_[e].forEach(g),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i?delete this.idIndex_[i.toString()]:delete this.undefIdIndex_[e],this.dispatchEvent(new kh(vh,t))},Dh.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},Dh.prototype.setLoader=function(t){this.loader_=t};var jh={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},Uh="drawstart",Yh="drawend",Bh=function(i){function t(t,e){i.call(this,t),this.feature=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(m),Xh=function(o){function t(t){o.call(this,{handleDownEvent:Vh,handleEvent:zh,handleUpEvent:Wh,stopDown:v}),this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){var e;t===Lt.POINT||t===Lt.MULTI_POINT?e=jh.POINT:t===Lt.LINE_STRING||t===Lt.MULTI_LINE_STRING?e=jh.LINE_STRING:t===Lt.POLYGON||t===Lt.MULTI_POLYGON?e=jh.POLYGON:t===Lt.CIRCLE&&(e=jh.CIRCLE);return e}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:this.mode_===jh.POLYGON?3:2,this.maxPoints_=t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:y;var i,e=t.geometryFunction;if(!e)if(this.type_===Lt.CIRCLE)e=function(t,e){var i=e||new th([NaN,NaN]),r=fn(t[0],t[1]);return i.setCenterAndRadius(t[0],Math.sqrt(r)),i};else{var r,n=this.mode_;n===jh.POINT?r=Dr:n===jh.LINE_STRING?r=Sn:n===jh.POLYGON&&(r=Qr),e=function(t,e){var i=e;return i?n===jh.POLYGON?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new r(t),i}}this.geometryFunction_=e,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new lh({source:new Dh({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:(i=Zi(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:Qs,this.freehandCondition_,t.freehand?this.freehandCondition_=Ks:this.freehandCondition_=t.freehandCondition?t.freehandCondition:$s,E(this,b(Gs),this.updateState_,this)}return o&&(t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).prototype.setMap=function(t){o.prototype.setMap.call(this,t),this.updateState_()},t.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,r=e[0]-i[0],n=e[1]-i[1],o=r*r+n*n;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},t.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,r=[this.finishCoordinate_];if(this.mode_===jh.LINE_STRING?i=this.sketchCoords_.length>this.minPoints_:this.mode_===jh.POLYGON&&(i=this.sketchCoords_[0].length>this.minPoints_,r=[this.sketchCoords_[0][0],this.sketchCoords_[0][this.sketchCoords_[0].length-2]]),i)for(var n=t.map,o=0,s=r.length;o<s;o++){var a=r[o],h=n.getPixelFromCoordinate(a),l=t.pixel,u=l[0]-h[0],c=l[1]-h[1],p=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(u*u+c*c)<=p){this.finishCoordinate_=a;break}}}return e},t.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Ji(new Dr(e)),this.updateSketchFeatures_())},t.prototype.startDrawing_=function(t){var e=t.coordinate;this.finishCoordinate_=e,this.mode_===jh.POINT?this.sketchCoords_=e.slice():this.mode_===jh.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Ji(new Sn(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_);this.sketchFeature_=new Ji,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Bh(Uh,this.sketchFeature_))},t.prototype.modifyDrawing_=function(t){var e,i,r,n=t.coordinate,o=this.sketchFeature_.getGeometry();(this.mode_===jh.POINT?i=this.sketchCoords_:this.mode_===jh.POLYGON?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(n=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=n[0],i[1]=n[1],this.geometryFunction_(this.sketchCoords_,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(n);if(o instanceof Qr&&this.mode_!==jh.POLYGON){this.sketchLine_||(this.sketchLine_=new Ji);var s=o.getLinearRing(0);(r=this.sketchLine_.getGeometry())?(r.setFlatCoordinates(s.getLayout(),s.getFlatCoordinates()),r.changed()):(r=new Sn(s.getFlatCoordinates(),s.getLayout()),this.sketchLine_.setGeometry(r))}else this.sketchLineCoords_&&(r=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},t.prototype.addToDrawing_=function(t){var e,i,r=t.coordinate,n=this.sketchFeature_.getGeometry();this.mode_===jh.LINE_STRING?(this.finishCoordinate_=r.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),this.geometryFunction_(i,n)):this.mode_===jh.POLYGON&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(r.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry();this.mode_===jh.LINE_STRING?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e),2<=t.length&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===jh.POLYGON&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e)),0===t.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry();this.mode_===jh.LINE_STRING?(e.pop(),this.geometryFunction_(e,i)):this.mode_===jh.POLYGON&&(e[0].pop(),this.geometryFunction_(e,i),e=i.getCoordinates()),this.type_===Lt.MULTI_POINT?t.setGeometry(new ih([e])):this.type_===Lt.MULTI_LINE_STRING?t.setGeometry(new eh([e])):this.type_===Lt.MULTI_POLYGON&&t.setGeometry(new nh([e])),this.dispatchEvent(new Bh(Yh,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return t&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),t},t.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.updateSketchFeatures_(),this.dispatchEvent(new Bh(Uh,this.sketchFeature_))},t.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)},t.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing_(),this.overlay_.setMap(e?t:null)},t}(aa);function zh(t){t.originalEvent.type===w.CONTEXTMENU&&t.preventDefault(),this.freehand_=this.mode_!==jh.POINT&&this.freehandCondition_(t);var e=t.type===qn.POINTERMOVE,i=!0;this.lastDragTime_&&t.type===qn.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&t.type===qn.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t),i=!1):this.freehand_&&t.type===qn.POINTERDOWN?i=!1:e?(i=t.type===qn.POINTERMOVE)&&this.freehand_?i=this.handlePointerMove_(t):(t.pointerEvent.pointerType==ho||t.type===qn.POINTERDRAG&&!this.downTimeout_)&&this.handlePointerMove_(t):t.type===qn.DBLCLICK&&(i=!1),la.call(this,t)&&i}function Vh(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):!!this.condition_(t)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Jn(qn.POINTERMOVE,t.map,t.pointerEvent,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0)}function Wh(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===jh.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t):(this.startDrawing_(t),this.mode_===jh.POINT&&this.finishDrawing()),e=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!e&&this.stopClick_&&t.stopPropagation(),e}var Kh="extentchanged",Hh=function(e){function t(t){e.call(this,Kh),this.extent=t}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(m),Zh=function(n){function t(t){n.call(this,{handleDownEvent:Jh,handleDragEvent:Qh,handleEvent:qh,handleUpEvent:$h});var i,r,e=t||{};this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,t||(t={}),this.extentOverlay_=new lh({source:new Dh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:(i=Zi(),function(t,e){return i[Lt.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new lh({source:new Dh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:(r=Zi(),function(t,e){return r[Lt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&this.setExtent(t.extent)}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.snapToVertex_=function(t,e){var i,r=e.getCoordinateFromPixel(t),n=this.getExtent();if(n){var o=[[[(i=n)[0],i[1]],[i[0],i[3]]],[[i[0],i[3]],[i[2],i[3]]],[[i[2],i[3]],[i[2],i[1]]],[[i[2],i[1]],[i[0],i[1]]]];o.sort(function(t,e){return gn(r,t)-gn(r,e)});var s=o[0],a=hn(r,s),h=e.getPixelFromCoordinate(a);if(_n(t,h)<=this.pixelTolerance_){var l=e.getPixelFromCoordinate(s[0]),u=e.getPixelFromCoordinate(s[1]),c=fn(h,l),p=fn(h,u),d=Math.sqrt(Math.min(c,p));return this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(a=p<c?s[1]:s[0]),a}}return null},t.prototype.handlePointerMove_=function(t){var e=t.pixel,i=t.map,r=this.snapToVertex_(e,i);r||(r=i.getCoordinateFromPixel(e)),this.createOrUpdatePointerFeature_(r)},t.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(tn(t)):e.setGeometry(void 0):(e=new Ji(t?tn(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},t.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new Ji(new Dr(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},t.prototype.setMap=function(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),n.prototype.setMap.call(this,t)},t.prototype.getExtent=function(){return this.extent_},t.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new Hh(this.extent_))},t}(aa);function qh(t){return!(t instanceof Jn)||(t.type!=qn.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),la.call(this,t),!1)}function Jh(t){var e=t.pixel,i=t.map,r=this.getExtent(),n=this.snapToVertex_(e,i),o=function(t){var e=null,i=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==e&&null!==i?[e,i]:null};if(n&&r){var s=n[0]==r[0]||n[0]==r[2]?n[0]:null,a=n[1]==r[1]||n[1]==r[3]?n[1]:null;null!==s&&null!==a?this.pointerHandler_=tl(o(n)):null!==s?this.pointerHandler_=el(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.pointerHandler_=el(o([r[0],a]),o([r[2],a])))}else n=i.getCoordinateFromPixel(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=tl(n);return!0}function Qh(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}return!0}function $h(t){this.pointerHandler_=null;var e=this.getExtent();return e&&0!==it(e)||this.setExtent(null),!1}function tl(e){return function(t){return A([e,t])}}function el(e,i){return e[0]==i[0]?function(t){return A([e,[t[0],i[1]]])}:e[1]==i[1]?function(t){return A([e,[i[0],t[1]]])}:null}var il=0,rl=1,nl={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"},ol=function(r){function t(t,e,i){r.call(this,t),this.features=e,this.mapBrowserEvent=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),sl=function(r){function t(t){var i,e;if(r.call(this,{handleDownEvent:hl,handleDragEvent:ll,handleEvent:cl,handleUpEvent:ul}),this.condition_=t.condition?t.condition:ia,this.defaultDeleteCondition_=function(t){return Vs(t)&&Js(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Ks,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.modified_=!1,this.rBush_=new Gh,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new lh({source:new Dh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:(i=Zi(),function(t,e){return i[Lt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,Circle:this.writeCircleGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_},this.source_=null,t.source?(this.source_=t.source,e=new M(this.source_.getFeatures()),E(this.source_,_h,this.handleSourceAdd_,this),E(this.source_,vh,this.handleSourceRemove_,this)):e=t.features,!e)throw new Error("The modify interaction requires features or a source");this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),E(this.features_,h,this.handleFeatureAdd_,this),E(this.features_,l,this.handleFeatureRemove_,this),this.lastPointerEvent_=null}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.addFeature_=function(t){var e=t.getGeometry();e&&e.getType()in this.SEGMENT_WRITERS_&&this.SEGMENT_WRITERS_[e.getType()].call(this,t,e);var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),E(t,w.CHANGE,this.handleFeatureChange_,this)},t.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new ol(nl.MODIFYSTART,this.features_,t)))},t.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d(t,w.CHANGE,this.handleFeatureChange_,this)},t.prototype.removeFeatureSegmentData_=function(e){var t=this.rBush_,i=[];t.forEach(function(t){e===t.feature&&i.push(t)});for(var r=i.length-1;0<=r;--r)t.remove(i[r])},t.prototype.setActive=function(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),r.prototype.setActive.call(this,t)},t.prototype.setMap=function(t){this.overlay_.setMap(t),r.prototype.setMap.call(this,t)},t.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},t.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},t.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},t.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},t.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},t.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},t.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},t.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(A(o),s)}},t.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(A(h),l)}},t.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,geometry:e,depth:[r],index:s,segment:h};this.rBush_.insert(A(h),l)}},t.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var c=h.slice(l,l+2),p={feature:t,geometry:e,depth:[s,r],index:l,segment:c};this.rBush_.insert(A(c),p)}},t.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),r={feature:t,geometry:e,index:il,segment:[i,i]},n={feature:t,geometry:e,index:rl,segment:[i,i]},o=[r,n];r.featureSegments=n.featureSegments=o,this.rBush_.insert(V(i),r),this.rBush_.insert(e.getExtent(),n)},t.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r)this.SEGMENT_WRITERS_[i[r].getType()].call(this,t,i[r])},t.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new Ji(new Dr(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},t.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},t.prototype.handlePointerAtPixel_=function(t,e){var i=e.getCoordinateFromPixel(t),r=G(V(i),e.getView().getResolution()*this.pixelTolerance_),n=this.rBush_.getInExtent(r);if(0<n.length){n.sort(function(t,e){return pl(i,t)-pl(i,e)});var o=n[0],s=o.segment,a=dl(i,o),h=e.getPixelFromCoordinate(a),l=_n(t,h);if(l<=this.pixelTolerance_){var u={};if(o.geometry.getType()===Lt.CIRCLE&&o.index===rl)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(a);else{var c=e.getPixelFromCoordinate(s[0]),p=e.getPixelFromCoordinate(s[1]),d=fn(h,c),f=fn(h,p);l=Math.sqrt(Math.min(d,f)),this.snappedToVertex_=l<=this.pixelTolerance_,this.snappedToVertex_&&(a=f<d?s[1]:s[0]),this.createOrUpdateVertexFeature_(a);for(var _=1,g=n.length;_<g;++_){var y=n[_].segment;if(!(cn(s[0],y[0])&&cn(s[1],y[1])||cn(s[0],y[1])&&cn(s[1],y[0])))break;u[Et(y)]=!0}}return u[Et(s)]=!0,void(this.vertexSegments_=u)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},t.prototype.insertVertex_=function(t,e){for(var i,r=t.segment,n=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Lt.MULTI_LINE_STRING:case Lt.POLYGON:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case Lt.MULTI_POLYGON:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case Lt.LINE_STRING:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var h=this.rBush_;h.remove(t),this.updateSegmentIndices_(o,a,s,1);var l={segment:[r[0],e],feature:n,geometry:o,depth:s,index:a};h.insert(A(l.segment),l),this.dragSegments_.push([l,1]);var u={segment:[e,r[1]],feature:n,geometry:o,depth:s,index:a+1};h.insert(A(u.segment),u),this.dragSegments_.push([u,0]),this.ignoreNextSingleClick_=!0},t.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=qn.POINTERDRAG){var t=this.lastPointerEvent_;return this.willModifyFeatures_(t),this.removeVertex_(),this.dispatchEvent(new ol(nl.MODIFYEND,this.features_,t)),!(this.modified_=!1)}return!1},t.prototype.removeVertex_=function(){var t,e,i,r,n,o,s,a,h,l,u,c=this.dragSegments_,p={},d=!1;for(n=c.length-1;0<=n;--n)u=Et((l=(i=c[n])[0]).feature),l.depth&&(u+="-"+l.depth.join("-")),u in p||(p[u]={}),0===i[1]?(p[u].right=l,p[u].index=l.index):1==i[1]&&(p[u].left=l,p[u].index=l.index+1);for(u in p){switch(h=p[u].right,s=p[u].left,(a=(o=p[u].index)-1)<0&&(a=0),t=e=(r=(l=void 0!==s?s:h).geometry).getCoordinates(),d=!1,r.getType()){case Lt.MULTI_LINE_STRING:2<e[l.depth[0]].length&&(e[l.depth[0]].splice(o,1),d=!0);break;case Lt.LINE_STRING:2<e.length&&(e.splice(o,1),d=!0);break;case Lt.MULTI_POLYGON:t=t[l.depth[1]];case Lt.POLYGON:4<(t=t[l.depth[0]]).length&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(r,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==h&&(this.rBush_.remove(h),f.push(h.segment[1])),void 0!==s&&void 0!==h){var _={depth:l.depth,feature:l.feature,geometry:l.geometry,index:a,segment:f};this.rBush_.insert(A(_.segment),_)}this.updateSegmentIndices_(r,o,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return d},t.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},t.prototype.updateSegmentIndices_=function(e,i,r,n){this.rBush_.forEachInExtent(e.getExtent(),function(t){t.geometry===e&&(void 0===r||void 0===t.depth||fr(t.depth,r))&&t.index>i&&(t.index+=n)})},t}(aa);function al(t,e){return t.index-e.index}function hl(t){if(!this.condition_(t))return!1;this.handlePointerAtPixel_(t.pixel,t.map);var e=t.map.getCoordinateFromPixel(t.pixel);this.dragSegments_.length=0,this.modified_=!1;var i=this.vertexFeature_;if(i){var r=[],n=i.getGeometry().getCoordinates(),o=A([n]),s=this.rBush_.getInExtent(o),a={};s.sort(al);for(var h=0,l=s.length;h<l;++h){var u=s[h],c=u.segment,p=Et(u.feature),d=u.depth;if(d&&(p+="-"+d.join("-")),a[p]||(a[p]=new Array(2)),u.geometry.getType()===Lt.CIRCLE&&u.index===rl)cn(dl(e,u),n)&&!a[p][0]&&(this.dragSegments_.push([u,0]),a[p][0]=u);else if(cn(c[0],n)&&!a[p][0])this.dragSegments_.push([u,0]),a[p][0]=u;else if(cn(c[1],n)&&!a[p][1]){if((u.geometry.getType()===Lt.LINE_STRING||u.geometry.getType()===Lt.MULTI_LINE_STRING)&&a[p][0]&&0===a[p][0].index)continue;this.dragSegments_.push([u,1]),a[p][1]=u}else this.insertVertexCondition_(t)&&Et(c)in this.vertexSegments_&&!a[p][0]&&!a[p][1]&&r.push([u,n])}r.length&&this.willModifyFeatures_(t);for(var f=r.length-1;0<=f;--f)this.insertVertex_.apply(this,r[f])}return!!this.vertexFeature_}function ll(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,i=0,r=this.dragSegments_.length;i<r;++i){for(var n=this.dragSegments_[i],o=n[0],s=o.depth,a=o.geometry,h=void 0,l=o.segment,u=n[1];e.length<a.getStride();)e.push(l[u][e.length]);switch(a.getType()){case Lt.POINT:h=e,l[0]=l[1]=e;break;case Lt.MULTI_POINT:(h=a.getCoordinates())[o.index]=e,l[0]=l[1]=e;break;case Lt.LINE_STRING:(h=a.getCoordinates())[o.index+u]=e,l[u]=e;break;case Lt.MULTI_LINE_STRING:case Lt.POLYGON:(h=a.getCoordinates())[s[0]][o.index+u]=e,l[u]=e;break;case Lt.MULTI_POLYGON:(h=a.getCoordinates())[s[1]][s[0]][o.index+u]=e,l[u]=e;break;case Lt.CIRCLE:l[0]=l[1]=e,o.index===il?(this.changingFeature_=!0,a.setCenter(e)):(this.changingFeature_=!0,a.setRadius(_n(a.getCenter(),e))),this.changingFeature_=!1}h&&this.setGeometryCoordinates_(a,h)}this.createOrUpdateVertexFeature_(e)}function ul(t){for(var e=this.dragSegments_.length-1;0<=e;--e){var i=this.dragSegments_[e][0],r=i.geometry;if(r.getType()===Lt.CIRCLE){var n=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=o.segment[1]=n,s.segment[0]=s.segment[1]=n,this.rBush_.update(V(n),o),this.rBush_.update(r.getExtent(),s)}else this.rBush_.update(A(i.segment),i)}return this.modified_&&(this.dispatchEvent(new ol(nl.MODIFYEND,this.features_,t)),this.modified_=!1),!1}function cl(t){return!(t instanceof Jn)||((this.lastPointerEvent_=t).map.getView().getInteracting()||t.type!=qn.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(e=!(t.type!=qn.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==qn.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),la.call(this,t)&&!e);var e}function pl(t,e){var i=e.geometry;if(i.getType()===Lt.CIRCLE){var r=i;if(e.index===rl){var n=fn(r.getCenter(),t),o=Math.sqrt(n)-r.getRadius();return o*o}}return gn(t,e.segment)}function dl(t,e){var i=e.geometry;return i.getType()===Lt.CIRCLE&&e.index===rl?i.getClosestPoint(t):hn(t,e.segment)}var fl={SELECT:"select"},_l=function(n){function t(t,e,i,r){n.call(this,t),this.selected=e,this.deselected=i,this.mapBrowserEvent=r}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(m),gl=function(a){function t(t){a.call(this,{handleEvent:yl});var e=t||{};this.condition_=e.condition?e.condition:Js,this.addCondition_=e.addCondition?e.addCondition:Zs,this.removeCondition_=e.removeCondition?e.removeCondition:Zs,this.toggleCondition_=e.toggleCondition?e.toggleCondition:$s,this.multi_=!!e.multi&&e.multi,this.filter_=e.filter?e.filter:y,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0;var i,r,n=new lh({source:new Dh({useSpatialIndex:!1,features:e.features,wrapX:e.wrapX}),style:e.style?e.style:(i=Zi(),pr(i[Lt.POLYGON],i[Lt.LINE_STRING]),pr(i[Lt.GEOMETRY_COLLECTION],i[Lt.LINE_STRING]),function(t,e){return t.getGeometry()?i[t.getGeometry().getType()]:null}),updateWhileAnimating:!0,updateWhileInteracting:!0});if(this.featureOverlay_=n,e.layers)if("function"==typeof e.layers)r=e.layers;else{var o=e.layers;r=function(t){return lr(o,t)}}else r=y;this.layerFilter_=r,this.featureLayerAssociation_={};var s=this.featureOverlay_.getSource().getFeaturesCollection();E(s,h,this.addFeature_,this),E(s,l,this.removeFeature_,this)}return a&&(t.__proto__=a),((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.addFeatureLayerAssociation_=function(t,e){var i=Et(t);this.featureLayerAssociation_[i]=e},t.prototype.getFeatures=function(){return this.featureOverlay_.getSource().getFeaturesCollection()},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.getLayer=function(t){var e=Et(t);return this.featureLayerAssociation_[e]},t.prototype.setHitTolerance=function(t){this.hitTolerance_=t},t.prototype.setMap=function(t){var e=this.getMap(),i=this.featureOverlay_.getSource().getFeaturesCollection();e&&i.forEach(e.unskipFeature.bind(e)),a.prototype.setMap.call(this,t),this.featureOverlay_.setMap(t),t&&i.forEach(t.skipFeature.bind(t))},t.prototype.addFeature_=function(t){var e=this.getMap();e&&e.skipFeature(t.element)},t.prototype.removeFeature_=function(t){var e=this.getMap();e&&e.unskipFeature(t.element)},t.prototype.removeFeatureLayerAssociation_=function(t){var e=Et(t);delete this.featureLayerAssociation_[e]},t}(ks);function yl(t){if(!this.condition_(t))return!0;var i=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),e=!i&&!r&&!n,o=t.map,s=this.featureOverlay_.getSource().getFeaturesCollection(),a=[],h=[];if(e){_(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return h.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=s.getLength()-1;0<=l;--l){var u=s.item(l),c=h.indexOf(u);-1<c?h.splice(c,1):(s.remove(u),a.push(u))}0!==h.length&&s.extend(h)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return!i&&!n||lr(s.getArray(),t)?(r||n)&&lr(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(h.push(t),this.addFeatureLayerAssociation_(t,e)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=a.length-1;0<=p;--p)s.remove(a[p]);s.extend(h)}return(0<h.length||0<a.length)&&this.dispatchEvent(new _l(fl.SELECT,h,a,t)),qs(t)}var vl=function(n){function t(t){n.call(this,{handleEvent:ml,handleDownEvent:y,handleUpEvent:xl,stopDown:v});var e=t||{};this.source_=e.source?e.source:null,this.vertex_=void 0===e.vertex||e.vertex,this.edge_=void 0===e.edge||e.edge,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelCoordinate_=null,this.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,this.sortByDistance_=function(t,e){var i=gn(this.pixelCoordinate_,t.segment),r=gn(this.pixelCoordinate_,e.segment);return i-r}.bind(this),this.rBush_=new Gh,this.SEGMENT_WRITERS_={Point:this.writePointGeometry_,LineString:this.writeLineStringGeometry_,LinearRing:this.writeLineStringGeometry_,Polygon:this.writePolygonGeometry_,MultiPoint:this.writeMultiPointGeometry_,MultiLineString:this.writeMultiLineStringGeometry_,MultiPolygon:this.writeMultiPolygonGeometry_,GeometryCollection:this.writeGeometryCollectionGeometry_,Circle:this.writeCircleGeometry_}}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.addFeature=function(t,e){var i=void 0===e||e,r=Et(t),n=t.getGeometry();if(n){var o=this.SEGMENT_WRITERS_[n.getType()];o&&(this.indexedFeaturesExtents_[r]=n.getExtent([1/0,1/0,-1/0,-1/0]),o.call(this,t,n))}i&&(this.featureChangeListenerKeys_[r]=E(t,w.CHANGE,this.handleFeatureChange_,this))},t.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},t.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},t.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},t.prototype.handleFeatureAdd_=function(t){var e;t instanceof kh?e=t.feature:t instanceof F&&(e=t.element),this.addFeature(e)},t.prototype.handleFeatureRemove_=function(t){var e;t instanceof kh?e=t.feature:t instanceof F&&(e=t.element),this.removeFeature(e)},t.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=Et(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},t.prototype.removeFeature=function(e,t){var i=void 0===t||t,r=Et(e),n=this.indexedFeaturesExtents_[r];if(n){var o=this.rBush_,s=[];o.forEachInExtent(n,function(t){e===t.feature&&s.push(t)});for(var a=s.length-1;0<=a;--a)o.remove(s[a])}i&&(g(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},t.prototype.setMap=function(t){var e=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();e&&(i.forEach(g),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),n.prototype.setMap.call(this,t),t&&(this.features_?i.push(E(this.features_,h,this.handleFeatureAdd_,this),E(this.features_,l,this.handleFeatureRemove_,this)):this.source_&&i.push(E(this.source_,_h,this.handleFeatureAdd_,this),E(this.source_,vh,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},t.prototype.snapTo=function(t,e,i){var r=A([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(r);this.vertex_&&!this.edge_&&(n=n.filter(function(t){return t.feature.getGeometry().getType()!==Lt.CIRCLE}));var o,s,a,h,l=!1,u=null,c=null;if(0<n.length){this.pixelCoordinate_=e,n.sort(this.sortByDistance_);var p=n[0].segment,d=n[0].feature.getGeometry().getType()===Lt.CIRCLE;this.vertex_&&!this.edge_?(o=i.getPixelFromCoordinate(p[0]),s=i.getPixelFromCoordinate(p[1]),a=fn(t,o),h=fn(t,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(l=!0,u=h<a?p[1]:p[0],c=i.getPixelFromCoordinate(u))):this.edge_&&(u=d?function(t,e){var i=e.getRadius(),r=e.getCenter(),n=r[0],o=r[1],s=t[0]-n,a=t[1]-o;0===s&&0===a&&(s=1);var h=Math.sqrt(s*s+a*a);return[n+i*s/h,o+i*a/h]}(e,n[0].feature.getGeometry()):hn(e,p),_n(t,c=i.getPixelFromCoordinate(u))<=this.pixelTolerance_&&(l=!0,this.vertex_&&!d&&(o=i.getPixelFromCoordinate(p[0]),s=i.getPixelFromCoordinate(p[1]),a=fn(c,o),h=fn(c,s),Math.sqrt(Math.min(a,h))<=this.pixelTolerance_&&(u=h<a?p[1]:p[0],c=i.getPixelFromCoordinate(u))))),l&&(c=[Math.round(c[0]),Math.round(c[1])])}return{snapped:l,vertex:u,vertexPixel:c}},t.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},t.prototype.writeCircleGeometry_=function(t,e){for(var i=en(e).getCoordinates()[0],r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(A(o),s)}},t.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),r=0;r<i.length;++r){var n=this.SEGMENT_WRITERS_[i[r].getType()];n&&n.call(this,t,i[r])}},t.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length-1;r<n;++r){var o=i.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(A(o),s)}},t.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(A(h),l)}},t.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r){var o=i[r],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},t.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length;s<a;++s)for(var h=o[s],l=0,u=h.length-1;l<u;++l){var c=h.slice(l,l+2),p={feature:t,segment:c};this.rBush_.insert(A(c),p)}},t.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),r={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),r)},t.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),r=0,n=i.length;r<n;++r)for(var o=i[r],s=0,a=o.length-1;s<a;++s){var h=o.slice(s,s+2),l={feature:t,segment:h};this.rBush_.insert(A(h),l)}},t}(aa);function ml(t){var e=this.snapTo(t.pixel,t.coordinate,t.map);return e.snapped&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel),la.call(this,t)}function xl(t){var e=o(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}var Sl={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"},Cl=function(r){function t(t,e,i){r.call(this,t),this.features=e,this.coordinate=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),El=function(n){function t(t){n.call(this,{handleDownEvent:Tl,handleDragEvent:Rl,handleMoveEvent:Il,handleUpEvent:wl});var e,i=t||{};if(this.lastCoordinate_=null,this.features_=void 0!==i.features?i.features:null,i.layers)if("function"==typeof i.layers)e=i.layers;else{var r=i.layers;e=function(t){return lr(r,t)}}else e=y;this.layerFilter_=e,this.hitTolerance_=i.hitTolerance?i.hitTolerance:0,this.lastFeature_=null,E(this,b(Gs),this.handleActiveChanged_,this)}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t){if(!this.features_||lr(this.features_.getArray(),t))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},t.prototype.getHitTolerance=function(){return this.hitTolerance_},t.prototype.setHitTolerance=function(t){this.hitTolerance_=t},t.prototype.setMap=function(t){var e=this.getMap();n.prototype.setMap.call(this,t),this.updateState_(e)},t.prototype.handleActiveChanged_=function(){this.updateState_(null)},t.prototype.updateState_=function(t){var e=this.getMap(),i=this.getActive();e&&i||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},t}(aa);function Tl(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.lastCoordinate_=t.coordinate,Il.call(this,t);var e=this.features_||new M([this.lastFeature_]);return this.dispatchEvent(new Cl(Sl.TRANSLATESTART,e,t.coordinate)),!0}return!1}function wl(t){if(this.lastCoordinate_){this.lastCoordinate_=null,Il.call(this,t);var e=this.features_||new M([this.lastFeature_]);return this.dispatchEvent(new Cl(Sl.TRANSLATEEND,e,t.coordinate)),!0}return!1}function Rl(t){if(this.lastCoordinate_){var e=t.coordinate,i=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],n=this.features_||new M([this.lastFeature_]);n.forEach(function(t){var e=t.getGeometry();e.translate(i,r),t.setGeometry(e)}),this.lastCoordinate_=e,this.dispatchEvent(new Cl(Sl.TRANSLATING,n,e))}}function Il(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}function Ll(t){var e=t||{},i=new M,r=new Kn(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new _a),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Xs({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new ca({kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new ka),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Ya({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Pa),i.push(new Ma({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Aa({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Ia({duration:e.zoomDuration})),i}var bl=function(s){function t(t,e,i,r,n){var o=void 0!==n?di.IDLE:di.LOADED;s.call(this,t,e,i,o),this.loader_=void 0!==n?n:null,this.canvas_=r,this.error_=null}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.getError=function(){return this.error_},t.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=di.ERROR):this.state=di.LOADED,this.changed()},t.prototype.load=function(){this.state==di.IDLE&&(this.state=di.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},t.prototype.getImage=function(){return this.canvas_},t}(Mn),Pl=function(o){function t(t,e,i,r,n){o.call(this,t),this.vectorContext=e,this.frameState=i,this.context=r,this.glContext=n}return o&&(t.__proto__=o),(t.prototype=Object.create(o&&o.prototype)).constructor=t}(m),Fl=function(){};Fl.prototype.drawCustom=function(t,e,i){},Fl.prototype.drawGeometry=function(t){},Fl.prototype.setStyle=function(t){},Fl.prototype.drawCircle=function(t,e){},Fl.prototype.drawFeature=function(t,e){},Fl.prototype.drawGeometryCollection=function(t,e){},Fl.prototype.drawLineString=function(t,e){},Fl.prototype.drawMultiLineString=function(t,e){},Fl.prototype.drawMultiPoint=function(t,e){},Fl.prototype.drawMultiPolygon=function(t,e){},Fl.prototype.drawPoint=function(t,e){},Fl.prototype.drawPolygon=function(t,e){},Fl.prototype.drawText=function(t,e){},Fl.prototype.setFillStrokeStyle=function(t,e){},Fl.prototype.setImageStyle=function(t,e){},Fl.prototype.setTextStyle=function(t,e){};var Ml=function(o){function t(t,e,i,r,n){o.call(this),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=r,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return o&&(t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).prototype.drawImages_=function(t,e,i,r){var n=this;if(this.image_){var o=Rt(t,e,i,2,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.tmpLocalTransform_,h=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=h*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,c=o.length;u<c;u+=2){var p=o[u]-n.imageAnchorX_,d=o[u+1]-n.imageAnchorY_;if(n.imageSnapToPixel_&&(p=Math.round(p),d=Math.round(d)),0!==l||1!=n.imageScale_){var f=p+n.imageAnchorX_,_=d+n.imageAnchorY_;Te(a,f,_,n.imageScale_,n.imageScale_,l,-f,-_),s.setTransform.apply(s,a)}s.drawImage(n.image_,n.imageOriginX_,n.imageOriginY_,n.imageWidth_,n.imageHeight_,p,d,n.imageWidth_,n.imageHeight_)}0===l&&1==this.imageScale_||s.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(s.globalAlpha=h)}},t.prototype.drawText_=function(t,e,i,r){var n=this;if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=Rt(t,e,i,r,this.transform_,this.pixelCoordinates_),s=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=r){var h=o[e]+n.textOffsetX_,l=o[e+1]+n.textOffsetY_;if(0!==a||1!=n.textScale_){var u=Te(n.tmpLocalTransform_,h,l,n.textScale_,n.textScale_,a,-h,-l);s.setTransform.apply(s,u)}n.textStrokeState_&&s.strokeText(n.text_,h,l),n.textFillState_&&s.fillText(n.text_,h,l)}0===a&&1==this.textScale_||s.setTransform(1,0,0,1,0,0)}},t.prototype.moveToLineTo_=function(t,e,i,r,n){var o=this.context_,s=Rt(t,e,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;n&&(a-=2);for(var h=2;h<a;h+=2)o.lineTo(s[h],s[h+1]);return n&&o.closePath(),i},t.prototype.drawRings_=function(t,e,i,r){for(var n=0,o=i.length;n<o;++n)e=this.moveToLineTo_(t,e,i[n],r,!0);return e},t.prototype.drawCircle=function(t){if(wt(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 r=t.getFlatCoordinates();if(r){var n=t.getStride();return Rt(r,0,r.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],r=e[3]-e[1],n=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},t.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},t.prototype.drawGeometry=function(t){switch(t.getType()){case Lt.POINT:this.drawPoint(t);break;case Lt.LINE_STRING:this.drawLineString(t);break;case Lt.POLYGON:this.drawPolygon(t);break;case Lt.MULTI_POINT:this.drawMultiPoint(t);break;case Lt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Lt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Lt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Lt.CIRCLE:this.drawCircle(t)}},t.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&wt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},t.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,r=e.length;i<r;++i)this.drawGeometry(e[i])},t.prototype.drawPoint=function(t){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)},t.prototype.drawMultiPoint=function(t){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)},t.prototype.drawLineString=function(t){if(wt(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 r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},t.prototype.drawMultiLineString=function(t){var e=t.getExtent();if(wt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,r=t.getFlatCoordinates(),n=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,h=o.length;a<h;++a)n=this.moveToLineTo_(r,n,o[a],s,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},t.prototype.drawPolygon=function(t){if(wt(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)}}},t.prototype.drawMultiPolygon=function(t){if(wt(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(),r=0,n=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=n.length;s<a;++s){var h=n[s];r=this.drawRings_(i,r,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},t.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},t.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=e.lineCap=t.lineCap),hi&&(fr(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,hi&&(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})},t.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,r=t.textAlign?t.textAlign:Ri;i?(i.font!=t.font&&(i.font=e.font=t.font),i.textAlign!=r&&(i.textAlign=e.textAlign=r),i.textBaseline!=t.textBaseline&&(i.textBaseline=e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},t.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:ke(i||Si)}}else this.fillState_=null;if(e){var r=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),h=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:Ci,lineDash:o||Ei,lineDashOffset:s||0,lineJoin:void 0!==a?a:Ti,lineWidth:this.pixelRatio_*(void 0!==h?h:1),miterLimit:void 0!==l?l:10,strokeStyle:ke(r||wi)}}else this.strokeState_=null},t.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getOrigin(),n=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=n[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null},t.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:ke(i||Si)}}else this.textFillState_=null;var r=t.getStroke();if(r){var n=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),h=r.getLineJoin(),l=r.getWidth(),u=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Ci,lineDash:s||Ei,lineDashOffset:a||0,lineJoin:void 0!==h?h:Ti,lineWidth:void 0!==l?l:1,miterLimit:void 0!==u?u:10,strokeStyle:ke(n||wi)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:xi,textAlign:void 0!==v?v:Ri,textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==_?_:0,this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},t}(Fl),Ol=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function Nl(t,e,i){return e+":"+t+":"+(i?Pe(i):"null")}Ol.prototype.clear=function(){this.cache_={},this.cacheSize_=0},Ol.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){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_)}}},Ol.prototype.get=function(t,e,i){var r=Nl(t,e,i);return r in this.cache_?this.cache_[r]:null},Ol.prototype.set=function(t,e,i,r){var n=Nl(t,e,i);this.cache_[n]=r,++this.cacheSize_},Ol.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Al=new Ol,Gl=function(e){function t(t){e.call(this),this.map_=t,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},t.prototype.getLayerRendererConstructors=function(){return this.layerRendererConstructors_},t.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Te(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),we(me(r,i))},t.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},t.prototype.forEachFeatureAtCoordinate=function(t,n,e,o,s,i,r){var a,h=n.viewState,l=h.resolution;function u(t,e){var i=Et(t).toString(),r=n.layerStates[Et(e)].managed;if(!(i in n.skippedFeatureUids)||r)return o.call(s,t,r?e:null)}var c=h.projection,p=t;if(c.canWrapX()){var d=c.getExtent(),f=ct(d),_=t[0];if(_<d[0]||_>d[2])p=[_+f*Math.ceil((d[0]-_)/f),t[1]]}var g,y=n.layerStatesArray;for(g=y.length-1;0<=g;--g){var v=y[g],m=v.layer;if(bs(v,l)&&i.call(r,m)){var x=this.getLayerRenderer(m);if(m.getSource()&&(a=x.forEachFeatureAtCoordinate(m.getSource().getWrapX()?p:t,n,e,u,s)),a)return a}}},t.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){},t.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,y,this,r,n)},t.prototype.getLayerRenderer=function(t){var e=Et(t).toString();if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,r=0,n=this.layerRendererConstructors_.length;r<n;++r){var o=this.layerRendererConstructors_[r];if(o.handles(t)){i=o.create(this,t);break}}if(!i)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[e]=i,this.layerRendererListeners_[e]=E(i,w.CHANGE,this.handleLayerRendererChange_,this),i},t.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},t.prototype.getLayerRenderers=function(){return this.layerRenderers_},t.prototype.getMap=function(){return this.map_},t.prototype.handleLayerRendererChange_=function(){this.map_.render()},t.prototype.removeLayerRendererByKey_=function(t){var e=this.layerRenderers_[t];return delete this.layerRenderers_[t],g(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],e},t.prototype.removeUnusedLayerRenderers_=function(t,e){for(var i in this.layerRenderers_)e&&i in e.layerStates||this.removeLayerRendererByKey_(i).dispose()},t.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(kl)},t.prototype.scheduleRemoveUnusedLayerRenderers=function(t){for(var e in this.layerRenderers_)if(!(e in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},t}(t);function kl(t,e){Al.expire()}function Dl(t,e){return t.zIndex-e.zIndex}Gl.prototype.renderFrame=L;var jl=[],Ul=function(n){function t(t){n.call(this,t);var e=t.getViewport();this.context_=De(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=_i,e.insertBefore(this.canvas_,e.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.dispatchComposeEvent_=function(t,e){var i=this.getMap(),r=this.context_;if(i.hasListener(t)){var n=e.extent,o=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),h=new Ml(r,o,n,a,s),l=new Pl(t,h,e,r,null);i.dispatchEvent(l)}},t.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,r=this.canvas_.height/2,n=t.pixelRatio/e.resolution,o=-n,s=-e.rotation,a=-e.center[0],h=-e.center[1];return Te(this.transform_,i,r,n,o,s,a,h)},t.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,r=Math.round(t.size[0]*i),n=Math.round(t.size[1]*i);this.canvas_.width!=r||this.canvas_.height!=n?(this.canvas_.width=r,this.canvas_.height=n):e.clearRect(0,0,r,n);var o=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(Tn,t);var s=t.layerStatesArray;_r(s,Dl),o&&(e.save(),Di(e,o,r/2,n/2));var a,h,l,u,c,p=t.viewState.resolution;for(a=0,h=s.length;a<h;++a)l=(c=s[a]).layer,u=this.getLayerRenderer(l),bs(c,p)&&c.sourceState==ms&&u.prepareFrame(t,c)&&u.composeFrame(t,c,e);o&&e.restore(),this.dispatchComposeEvent_(En,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},t.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){var a,h,l=e.viewState.resolution,u=e.layerStatesArray,c=u.length,p=xe(e.pixelToCoordinateTransform,t.slice());for(h=c-1;0<=h;--h){var d=u[h],f=d.layer;if(bs(d,l)&&o.call(s,f))if(a=this.getLayerRenderer(f).forEachLayerAtCoordinate(p,e,i,r,n))return a}},t.prototype.registerLayerRenderers=function(t){n.prototype.registerLayerRenderers.call(this,t);for(var e=0,i=t.length;e<i;++e){var r=t[e];lr(jl,r)||jl.push(r)}},t}(Gl),Yl=function(e){function t(t){e.call(this),this.layer_=t}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.createLoadedTileFinder=function(i,r,n){return function(e,t){return i.forEachLoadedTile(r,e,t,function(t){n[e]||(n[e]={}),n[e][t.tileCoord.toString()]=t})}},t.prototype.getLayer=function(){return this.layer_},t.prototype.handleImageChange_=function(t){t.target.getState()===di.LOADED&&this.renderIfReadyAndVisible()},t.prototype.loadImage=function(t){var e=t.getState();return e!=di.LOADED&&e!=di.ERROR&&E(t,w.CHANGE,this.handleImageChange_,this),e==di.IDLE&&(t.load(),e=t.getState()),e==di.LOADED},t.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==ms&&this.changed()},t.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var r=Et(t).toString();r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(i)}},t.prototype.updateUsedTiles=function(t,e,i,r){var n=Et(e).toString(),o=i.toString();n in t?o in t[n]?t[n][o].extend(r):t[n][o]=r:(t[n]={},t[n][o]=r)},t.prototype.manageTilePyramid=function(t,e,i,r,n,o,s,a,h,l){var u=Et(e).toString();u in t.wantedTiles||(t.wantedTiles[u]={});var c,p,d,f,_,g,y=t.wantedTiles[u],v=t.tileQueue;for(g=i.getMinZoom();g<=s;++g)for(p=i.getTileRangeForExtentAndZ(o,g,p),d=i.getResolution(g),f=p.minX;f<=p.maxX;++f)for(_=p.minY;_<=p.maxY;++_)s-g<=a?((c=e.getTile(g,f,_,r,n)).getState()==Nn&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,u,i.getTileCoordCenter(c.tileCoord),d])),void 0!==h&&h.call(l,c)):e.useTile(g,f,_,n)},t}(S);Yl.prototype.forEachFeatureAtCoordinate=L,Yl.prototype.hasFeatureAtCoordinate=v;var Bl=function(e){function t(t){e.call(this,t),this.renderedResolution,this.transform_=[1,0,0,1,0,0]}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.clip=function(t,e,i){var r=e.pixelRatio,n=e.size[0]*r,o=e.size[1]*r,s=e.viewState.rotation,a=lt(i),h=ut(i),l=nt(i),u=rt(i);xe(e.coordinateToPixelTransform,a),xe(e.coordinateToPixelTransform,h),xe(e.coordinateToPixelTransform,l),xe(e.coordinateToPixelTransform,u),t.save(),Di(t,-s,n/2,o/2),t.beginPath(),t.moveTo(a[0]*r,a[1]*r),t.lineTo(h[0]*r,h[1]*r),t.lineTo(l[0]*r,l[1]*r),t.lineTo(u[0]*r,u[1]*r),t.clip(),Di(t,s,n/2,o/2)},t.prototype.dispatchComposeEvent_=function(t,e,i,r){var n=this.getLayer();if(n.hasListener(t)){var o=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,a=i.viewState.rotation;Di(e,-a,o/2,s/2);var h=void 0!==r?r:this.getTransform(i,0),l=new Ml(e,i.pixelRatio,i.extent,h,i.viewState.rotation),u=new Pl(t,l,i,e,null);n.dispatchEvent(u),Di(e,a,o/2,s/2)}},t.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){return this.forEachFeatureAtCoordinate(t,e,i,y,this)?r.call(n,this.getLayer(),null):void 0},t.prototype.postCompose=function(t,e,i,r){this.dispatchComposeEvent_(En,t,e,r)},t.prototype.preCompose=function(t,e,i){this.dispatchComposeEvent_(Tn,t,e,i)},t.prototype.dispatchRenderEvent=function(t,e,i){this.dispatchComposeEvent_(wn,t,e,i)},t.prototype.getTransform=function(t,e){var i=t.viewState,r=t.pixelRatio,n=r*t.size[0]/2,o=r*t.size[1]/2,s=r/i.resolution,a=-s,h=-i.rotation,l=-i.center[0]+e,u=-i.center[1];return Te(this.transform_,n,o,s,a,h,l,u)},t.prototype.composeFrame=function(t,e,i){},t.prototype.prepareFrame=function(t,e){},t}(Yl),Xl=function(a){function t(t){a.call(this,t),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null}return a&&(t.__proto__=a),((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.composeFrame=function(t,e,i){this.preCompose(i,t);var r=this.getImage();if(r){var n=e.extent,o=void 0!==n&&!Q(n,t.extent)&&wt(n,t.extent);o&&this.clip(i,t,n);var s=this.getImageTransform(),a=i.globalAlpha;i.globalAlpha=e.opacity;var h=s[4],l=s[5],u=r.width*s[0],c=r.height*s[3];i.drawImage(r,0,0,+r.width,+r.height,Math.round(h),Math.round(l),Math.round(u),Math.round(c)),i.globalAlpha=a,o&&i.restore()}this.postCompose(i,t,e)},t.prototype.getImage=function(){},t.prototype.getImageTransform=function(){},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource(),a=e.viewState.resolution,h=e.viewState.rotation,l=e.skippedFeatureUids;return s.forEachFeatureAtCoordinate(t,a,h,i,l,function(t){return r.call(n,t,o)})},t.prototype.forEachLayerAtCoordinate=function(t,e,i,r,n){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==L)return a.prototype.forEachLayerAtCoordinate.apply(this,arguments);var o=xe(this.coordinateToCanvasPixelTransform,t.slice());dn(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=De(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return 0<s[3]?r.call(n,this.getLayer(),s):void 0}},t}(Bl),zl=function(o){function n(t){if(o.call(this,t),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,t.getType()===oh.VECTOR)for(var e=0,i=jl.length;e<i;++e){var r=jl[e];if(r!==n&&r.handles(t)){this.vectorRenderer_=new r(t);break}}}return o&&(n.__proto__=o),((n.prototype=Object.create(o&&o.prototype)).constructor=n).prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose(),o.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.image_?this.image_.getImage():null},n.prototype.getImageTransform=function(){return this.imageTransform_},n.prototype.prepareFrame=function(t,e){var i,r=t.pixelRatio,n=t.size,o=t.viewState,s=o.center,a=o.resolution,h=this.getLayer().getSource(),l=t.viewHints,u=this.vectorRenderer_,c=t.extent;if(u||void 0===e.extent||(c=ht(c,e.extent)),!l[rs.ANIMATING]&&!l[rs.INTERACTING]&&!pt(c)){var p=o.projection,d=this.skippedFeatures_;if(u){var f=u.context,_=C({},t,{size:[ct(c)/a,at(c)/a],viewState:C({},t.viewState,{rotation:0})}),g=Object.keys(_.skippedFeatureUids).sort();i=new bl(c,a,r,f.canvas,function(t){!u.prepareFrame(_,e)||!u.replayGroupChanged&&fr(d,g)||(f.canvas.width=_.size[0]*r,f.canvas.height=_.size[1]*r,u.compose(f,_,e),d=g,t())})}else i=h.getImage(c,a,r,p);i&&this.loadImage(i)&&(this.image_=i,this.skippedFeatures_=d)}if(this.image_){var y=(i=this.image_).getExtent(),v=i.getResolution(),m=i.getPixelRatio(),x=r*v/(a*m),S=Te(this.imageTransform_,r*n[0]/2,r*n[1]/2,x,x,0,m*(y[0]-s[0])/v,m*(s[1]-y[3])/v);Te(this.coordinateToCanvasPixelTransform,r*n[0]/2-S[4],r*n[1]/2-S[5],r/a,-r/a,0,-s[0],-s[1]),this.renderedResolution=v*r/m}return!!this.image_},n.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,e,i,r,n):o.prototype.forEachFeatureAtCoordinate.call(this,t,e,i,r,n)},n}(Xl);zl.handles=function(t){return t.getType()===oh.IMAGE||t.getType()===oh.VECTOR&&t.getRenderMode()===sh},zl.create=function(t,e){return new zl(e)};var Vl=function(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r};function Wl(t,e,i,r,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=r,n):new Vl(t,e,i,r)}Vl.prototype.contains=function(t){return this.containsXY(t[1],t[2])},Vl.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},Vl.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},Vl.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},Vl.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)},Vl.prototype.getHeight=function(){return this.maxY-this.minY+1},Vl.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Vl.prototype.getWidth=function(){return this.maxX-this.minX+1},Vl.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Kl=function(i){function t(t,e){i.call(this,t),this.context=e?null:De(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new Vl(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.isDrawableTile_=function(t){var e=t.getState(),i=this.getLayer().getUseInterimTilesOnError();return e==Gn||e==Dn||e==kn&&!i},t.prototype.getTile=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource().getTile(t,e,i,r,n);return s.getState()==kn&&(o.getUseInterimTilesOnError()?0<o.getPreload()&&(this.newTiles_=!0):s.setState(Gn)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},t.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,r=t.size,n=t.viewState,o=n.projection,s=n.resolution,a=n.center,h=this.getLayer(),l=h.getSource(),u=l.getRevision(),c=l.getTileGridForProjection(o),p=c.getZForResolution(s,this.zDirection),d=c.getResolution(p),f=Math.round(s/d)||1,_=t.extent;if(void 0!==e.extent&&(_=ht(_,e.extent)),pt(_))return!1;var g=c.getTileRangeForExtentAndZ(_,p),y=c.getTileRangeExtent(p,g),v=l.getTilePixelRatio(i),m={};m[p]={};var x,S,C,E=this.createLoadedTileFinder(l,o,m),T=t.viewHints,w=T[rs.ANIMATING]||T[rs.INTERACTING],R=this.tmpExtent,I=this.tmpTileRange_;for(this.newTiles_=!1,S=g.minX;S<=g.maxX;++S)for(C=g.minY;C<=g.maxY;++C)if(!(16<Date.now()-t.time&&w)){if(x=this.getTile(p,S,C,i,o),this.isDrawableTile_(x)){var L=Et(this);if(x.getState()==Gn){var b=(m[p][x.tileCoord.toString()]=x).inTransition(L);this.newTiles_||!b&&-1!==this.renderedTiles.indexOf(x)||(this.newTiles_=!0)}if(1===x.getAlpha(L,t.time))continue}var P=c.getTileCoordChildTileRange(x.tileCoord,I,R),F=!1;P&&(F=E(p+1,P)),F||c.forEachTileCoordParentTileRange(x.tileCoord,E,null,I,R)}var M=d*i/v*f;if(!(this.renderedResolution&&16<Date.now()-t.time&&w)&&(this.newTiles_||!this.renderedExtent_||!Q(this.renderedExtent_,_)||this.renderedRevision!=u||f!=this.oversampling_||!w&&M!=this.renderedResolution)){var O=this.context;if(O){var N=l.getTilePixelSize(p,i,o),A=Math.round(g.getWidth()*N[0]/f),G=Math.round(g.getHeight()*N[1]/f),k=O.canvas;k.width!=A||k.height!=G?(this.oversampling_=f,k.width=A,k.height=G):(this.renderedExtent_&&!$(y,this.renderedExtent_)&&O.clearRect(0,0,A,G),f=this.oversampling_)}this.renderedTiles.length=0;var D,j,U,Y,B,X,z,V,W,K,H=Object.keys(m).map(Number);for(H.sort(function(t,e){return t===p?1:e===p?-1:e<t?1:t<e?-1:0}),Y=0,B=H.length;Y<B;++Y)for(var Z in U=H[Y],j=l.getTilePixelSize(U,i,o),D=c.getResolution(U)/d,z=v*l.getGutter(o),V=m[U])x=V[Z],S=((X=c.getTileCoordExtent(x.getTileCoord(),R))[0]-y[0])/d*v/f,C=(y[3]-X[3])/d*v/f,W=j[0]*D/f,K=j[1]*D/f,this.drawTileImage(x,t,e,S,C,W,K,z,p===U),this.renderedTiles.push(x);this.renderedRevision=u,this.renderedResolution=d*i/v*f,this.renderedExtent_=y}var q=this.renderedResolution/s,J=Te(this.imageTransform_,i*r[0]/2,i*r[1]/2,q,q,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*i,(a[1]-this.renderedExtent_[3])/this.renderedResolution*i);return Te(this.coordinateToCanvasPixelTransform,i*r[0]/2-J[4],i*r[1]/2-J[5],i/s,-i/s,0,-a[0],-a[1]),this.updateUsedTiles(t.usedTiles,l,p,g),this.manageTilePyramid(t,l,c,i,o,_,p,h.getPreload()),this.scheduleExpireCache(t,l),0<this.renderedTiles.length},t.prototype.drawTileImage=function(t,e,i,r,n,o,s,a,h){var l=t.getImage(this.getLayer());if(l){var u=Et(this),c=h?t.getAlpha(u,e.time):1;1!==c||this.getLayer().getSource().getOpaque(e.viewState.projection)||this.context.clearRect(r,n,o,s);var p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,r,n,o,s),p&&this.context.restore(),1!==c?e.animate=!0:h&&t.endTransition(u)}},t.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},t.prototype.getImageTransform=function(){return this.imageTransform_},t}(Xl);Kl.handles=function(t){return t.getType()===oh.TILE},Kl.create=function(t,e){return new Kl(e)},Kl.prototype.getLayer;var Hl=function(){};Hl.prototype.getReplay=function(t,e){},Hl.prototype.isEmpty=function(){};var Zl={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function ql(t,e,i,r,n,o,s,a){for(var h,l,u,c=[],p=t[e]>t[i-r],d=n.length,f=t[e],_=t[e+1],g=t[e+=r],y=t[e+1],v=0,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-_,2)),x="",S=0,C=0;C<d;++C){l=p?d-C-1:C;var E=n.charAt(l),T=o(x=p?E+x:x+E)-S;S+=T;for(var w=s+T/2;e<i-r&&v+m<w;)f=g,_=y,g=t[e+=r],y=t[e+1],v+=m,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-_,2));var R=w-v,I=Math.atan2(y-_,g-f);if(p&&(I+=0<I?-Math.PI:Math.PI),void 0!==u){var L=I-u;if(L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>a)return null}var b=R/m,P=It(f,g,b),F=It(_,y,b);u==I?(p&&(h[0]=P,h[1]=F,h[2]=T/2),h[4]=x):(h=[P,F,(S=T)/2,I,x=E],p?c.unshift(h):c.push(h),u=I),s+=T}return c}var Jl=0,Ql=1,$l=2,tu=3,eu=4,iu=5,ru=6,nu=7,ou=8,su=9,au=10,hu=11,lu=12,uu=[ou],cu=[lu],pu=[Ql],du=[tu],fu=[Zl.POLYGON,Zl.CIRCLE,Zl.LINE_STRING,Zl.IMAGE,Zl.TEXT,Zl.DEFAULT],_u={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},gu=[1/0,1/0,-1/0,-1/0],yu=[1,0,0,1,0,0],vu=function(s){function t(t,e,i,r,n,o){s.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=e,this.overlaps=n,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.replayTextBackground_=function(t,e,i,r,n,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.replayImage_=function(t,e,i,r,n,o,s,a,h,l,u,c,p,d,f,_,g,y){var v=g||y;e-=n*=p,i-=o*=p;var m,x,S,C,E=f+l>r.width?r.width-l:f,T=a+u>r.height?r.height-u:a,w=_[3]+E*p+_[1],R=_[0]+T*p+_[2],I=e-_[3],L=i-_[0];(v||0!==c)&&(m=[I,L],x=[I+w,L],S=[I+w,L+R],C=[I,L+R]);var b=null;if(0!==c){var P=e+n,F=i+o;b=Te(yu,P,F,1,1,c,-P,-F),z(gu),q(gu,xe(yu,m)),q(gu,xe(yu,x)),q(gu,xe(yu,S)),q(gu,xe(yu,C))}else X(I,L,I+w,L+R,gu);var M=t.canvas,O=y?y[2]*p/2:0,N=gu[0]-O<=M.width&&0<=gu[2]+O&&gu[1]-O<=M.height&&0<=gu[3]+O;if(d&&(e=Math.round(e),i=Math.round(i)),s){if(!N&&1==s[4])return;H(s,gu);var A=N?[t,b?b.slice(0):null,h,r,l,u,E,T,e,i,p]:null;A&&v&&A.push(g,y,m,x,S,C),s.push(A)}else N&&(v&&this.replayTextBackground_(t,m,x,S,C,g,y),Ui(t,b,h,r,l,u,E,T,e,i,p))},t.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},t.prototype.appendFlatCoordinates=function(t,e,i,r,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=r);var h,l,u,c=[t[e],t[e+1]],p=[NaN,NaN],d=!0;for(h=e+r;h<i;h+=r)p[0]=t[h],p[1]=t[h+1],(u=Y(a,p))!==l?(d&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):u===N.INTERSECTING?(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):d=!0,c[0]=p[0],c[1]=p[1],l=u;return(n&&d||h===e+r)&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),s},t.prototype.drawCustomCoordinates_=function(t,e,i,r,n){for(var o=0,s=i.length;o<s;++o){var a=i[o],h=this.appendFlatCoordinates(t,e,a,r,!1,!1);n.push(h),e=a}return e},t.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var r,n,o,s,a,h=t.getType(),l=t.getStride(),u=this.coordinates.length;if(h==Lt.MULTI_POLYGON){r=(t=t).getOrientedFlatCoordinates(),s=[];for(var c=t.getEndss(),p=a=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(r,a,c[p],l,f),s.push(f)}this.instructions.push([eu,u,s,t,i,Mr])}else h==Lt.POLYGON||h==Lt.MULTI_LINE_STRING?(o=[],r=h==Lt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(r,0,t.getEnds(),l,o),this.instructions.push([eu,u,o,t,i,Fr])):h==Lt.LINE_STRING||h==Lt.MULTI_POINT?(r=t.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,l,!1,!1),this.instructions.push([eu,u,n,t,i,Pr])):h==Lt.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([eu,u,n,t,i]));this.endGeometry(t,e)},t.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Jl,e,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Jl,e,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.fill_=function(t){if(this.alignFill_){var e=xe(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.setTransform.apply(t,ji)},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],hi&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter_=function(t,e){if(t&&5<t.length){var i=t[4];if(1==i||i==t.length-5){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=5,o=t.length;n<o;++n){var s=t[n];s&&(11<s.length&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),Ui.apply(void 0,s))}}t.length=5,z(t)}}},t.prototype.replay_=function(t,e,i,r,n,o){var s,a=this;this.pixelCoordinates_&&fr(e,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=Rt(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),me(this.renderedTransform_,e));for(var h,l,u,c,p,d,f,_,g,y,v,m,x=!Tt(i),S=0,C=r.length,E=0,T=0,w=0,R=null,I=null,L=this.coordinateCache_,b=this.viewRotation_,P={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:b},F=this.instructions!=r||this.overlaps?0:200;S<C;){var M=r[S];switch(M[0]){case Jl:y=M[1],x&&i[Et(y).toString()]||!y.getGeometry()?S=M[2]:void 0===o||wt(o,y.getGeometry().getExtent())?++S:S=M[2]+1;break;case Ql:F<T&&(a.fill_(t),T=0),F<w&&(t.stroke(),w=0),T||w||(t.beginPath(),c=p=NaN),++S;break;case $l:var O=s[E=M[1]],N=s[E+1],A=s[E+2]-O,G=s[E+3]-N,k=Math.sqrt(A*A+G*G);t.moveTo(O+k,N),t.arc(O,N,k,0,2*Math.PI,!0),++S;break;case tu:t.closePath(),++S;break;case eu:E=M[1],h=M[2];var D=M[3],j=M[4],U=6==M.length?M[5]:void 0;P.geometry=D,P.feature=y,S in L||(L[S]=[]);var Y=L[S];U?U(s,E,h,2,Y):(Y[0]=s[E],Y[1]=s[E+1],Y.length=2),j(Y,P),++S;break;case ru:E=M[1],h=M[2],g=M[3],l=M[4],u=M[5],_=n?null:M[6];var B=M[7],X=M[8],z=M[9],V=M[10],W=M[11],K=M[12],H=M[13],Z=M[14],q=M[15],J=void 0,Q=void 0,$=void 0;for(16<M.length?(J=M[16],Q=M[17],$=M[18]):(J=Ii,Q=$=!1),W&&(K+=b);E<h;E+=2)a.replayImage_(t,s[E],s[E+1],g,l,u,_,B,X,z,V,K,H,Z,q,J,Q?R:null,$?I:null);a.renderDeclutter_(_,y),++S;break;case iu:var tt=M[1],et=M[2],it=M[3];_=n?null:M[4];var rt=M[5],nt=M[6],ot=M[7],st=M[8],at=M[9],ht=M[10],lt=M[11],ut=M[12],ct=M[13],pt=M[14],dt=xn(s,tt,et,2),ft=st(ut);if(rt||ft<=dt){var _t=a.textStates[ct].textAlign,gt=ql(s,tt,et,2,ut,st,(dt-ft)*_u[_t],ot);if(gt){var yt=void 0,vt=void 0,mt=void 0,xt=void 0,St=void 0;if(ht)for(yt=0,vt=gt.length;yt<vt;++yt)mt=(St=gt[yt])[4],xt=a.getImage(mt,ct,"",ht),l=St[2]+lt,u=it*xt.height+2*(.5-it)*lt-at,a.replayImage_(t,St[0],St[1],xt,l,u,_,xt.height,1,0,0,St[3],pt,!1,xt.width,Ii,null,null);if(nt)for(yt=0,vt=gt.length;yt<vt;++yt)mt=(St=gt[yt])[4],xt=a.getImage(mt,ct,nt,""),l=St[2],u=it*xt.height-at,a.replayImage_(t,St[0],St[1],xt,l,u,_,xt.height,1,0,0,St[3],pt,!1,xt.width,Ii,null,null)}}a.renderDeclutter_(_,y),++S;break;case nu:if(void 0!==n){var Ct=n(y=M[1]);if(Ct)return Ct}++S;break;case ou:F?T++:a.fill_(t),++S;break;case su:for(E=M[1],h=M[2],v=s[E],f=(m=s[E+1])+.5|0,(d=v+.5|0)===c&&f===p||(t.moveTo(v,m),c=d,p=f),E+=2;E<h;E+=2)d=(v=s[E])+.5|0,f=(m=s[E+1])+.5|0,E!=h-2&&d===c&&f===p||(t.lineTo(v,m),c=d,p=f);++S;break;case au:R=M,a.alignFill_=M[2],T&&(a.fill_(t),T=0,w&&(t.stroke(),w=0)),t.fillStyle=M[1],++S;break;case hu:I=M,w&&(t.stroke(),w=0),a.setStrokeStyle_(t,M),++S;break;case lu:F?w++:t.stroke(),++S;break;default:++S}}T&&this.fill_(t),w&&t.stroke()},t.prototype.replay=function(t,e,i,r){this.viewRotation_=i,this.replay_(t,e,r,this.instructions,void 0,void 0)},t.prototype.replayHitDetection=function(t,e,i,r,n,o){return this.viewRotation_=i,this.replay_(t,e,r,this.hitDetectionInstructions,n,o)},t.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==nu?o=t:r==Jl&&(i[2]=t,cr(this.hitDetectionInstructions,o,t),o=-1)},t.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var r=t.getColor();i.fillStyle=ke(r||Si)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=ke(n||wi);var o=e.getLineCap();i.lineCap=void 0!==o?o:Ci;var s=e.getLineDash();i.lineDash=s?s.slice():Ei;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:Ti;var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u: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},t.prototype.createFill=function(t,e){var i=t.fillStyle,r=[au,i];return"string"!=typeof i&&r.push(!0),r},t.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},t.prototype.createStroke=function(t){return[hu,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(t,e,i){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!fr(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=h)},t.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[nu,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=k(this.maxExtent),0<this.maxLineWidth)){var t=this.resolution*(this.maxLineWidth+1)/2;G(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(Fl);vu.prototype.finish=L;var mu=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,i,r,n,o),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.drawCoordinates_=function(t,e,i,r){return this.appendFlatCoordinates(t,e,i,r,!1,!1)},t.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ru,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([ru,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},t.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ru,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([ru,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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.snapToPixel_=void 0,this.width_=void 0},t.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),r=t.getSize(),n=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=r[0]},t}(vu),xu=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,i,r,n,o)}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.drawFlatCoordinates_=function(t,e,i,r){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,i,r,!1,!1),s=[su,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},t.prototype.drawLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([hu,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],pu);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(cu),this.endGeometry(t,e)}},t.prototype.drawMultiLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([hu,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],pu);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinates_(s,h,o[l],a);this.hitDetectionInstructions.push(cu),this.endGeometry(t,e)}},t.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(cu),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(cu),t.lastStroke=this.coordinates.length),t.lastStroke=0,s.prototype.applyStroke.call(this,t),this.instructions.push(pu)},t}(vu),Su=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,i,r,n,o)}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.drawFlatCoordinatess_=function(t,e,i,r){var n=this.state,o=void 0!==n.fillStyle,s=null!=n.strokeStyle,a=i.length;this.instructions.push(pu),this.hitDetectionInstructions.push(pu);for(var h=0;h<a;++h){var l=i[h],u=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,r,!0,!s),p=[su,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(du),this.hitDetectionInstructions.push(du)),e=l}return o&&(this.instructions.push(uu),this.hitDetectionInstructions.push(uu)),s&&(this.instructions.push(cu),this.hitDetectionInstructions.push(cu)),e},t.prototype.drawCircle=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([au,Pe(Si)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([hu,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,s,!1,!1);var h=[$l,a];this.instructions.push(pu,h),this.hitDetectionInstructions.push(pu,h),this.hitDetectionInstructions.push(uu),void 0!==i.fillStyle&&this.instructions.push(uu),void 0!==i.strokeStyle&&(this.instructions.push(cu),this.hitDetectionInstructions.push(cu)),this.endGeometry(t,e)}},t.prototype.drawPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([au,Pe(Si)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([hu,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(t,e)}},t.prototype.drawMultiPolygon=function(t,e){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([au,Pe(Si)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([hu,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),h=0,l=0,u=o.length;l<u;++l)h=this.drawFlatCoordinatess_(s,h,o[l],a);this.endGeometry(t,e)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t)for(var e=this.coordinates,i=0,r=e.length;i<r;++i)e[i]=Nr(e[i],t)},t.prototype.setFillStrokeStyles_=function(t){var e=this.state;void 0!==e.fillStyle&&this.updateFillStyle(e,this.createFill,t),void 0!==e.strokeStyle&&this.updateStrokeStyle(e,this.applyStroke)},t}(vu);function Cu(t,e,i,r,n){var o,s,a,h,l,u,c,p,d,f=i,_=i,g=0,y=0,v=i;for(o=i;o<r;o+=n){var m=e[o],x=e[o+1];void 0!==h&&(p=m-h,d=x-l,a=Math.sqrt(p*p+d*d),void 0!==u&&(y+=s,t<Math.acos((u*p+c*d)/(s*a))&&(g<y&&(g=y,f=v,_=o),y=0,v=o-n)),s=a,u=p,c=d),h=m,l=x}return g<(y+=a)?[v,o]:[f,_]}var Eu={Circle:Su,Default:vu,Image:mu,LineString:xu,Polygon:Su,Text:function(s){function t(t,e,i,r,n,o){s.call(this,t,e,i,r,n,o),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Li.prune()}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.drawText=function(t,e){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o,s,a=this.coordinates.length,h=t.getType(),l=null,u=2,c=2;if(n.placement===In){if(!wt(this.getBufferedMaxExtent(),t.getExtent()))return;var p;if(l=t.getFlatCoordinates(),c=t.getStride(),h==Lt.LINE_STRING)p=[l.length];else if(h==Lt.MULTI_LINE_STRING)p=t.getEnds();else if(h==Lt.POLYGON)p=t.getEnds().slice(0,1);else if(h==Lt.MULTI_POLYGON){var d=t.getEndss();for(p=[],o=0,s=d.length;o<s;++o)p.push(d[o][0])}this.beginGeometry(t,e);for(var f,_=n.textAlign,g=0,y=0,v=p.length;y<v;++y){if(null==_){var m=Cu(n.maxAngle,l,g,p[y],c);g=m[0],f=m[1]}else f=p[y];for(o=g;o<f;o+=c)this.coordinates.push(l[o],l[o+1]);u=this.coordinates.length,g=p[y],this.drawChars_(a,u,this.declutterGroup_),a=u}this.endGeometry(t,e)}else{var x=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),S=x.width/this.pixelRatio;switch(h){case Lt.POINT:case Lt.MULTI_POINT:u=(l=t.getFlatCoordinates()).length;break;case Lt.LINE_STRING:l=t.getFlatMidpoint();break;case Lt.CIRCLE:l=t.getCenter();break;case Lt.MULTI_LINE_STRING:u=(l=t.getFlatMidpoints()).length;break;case Lt.POLYGON:if(l=t.getFlatInteriorPoint(),!n.overflow&&l[2]/this.resolution<S)return;c=3;break;case Lt.MULTI_POLYGON:var C=t.getFlatInteriorPoints();for(l=[],o=0,s=C.length;o<s;o+=3)(n.overflow||C[o+2]/this.resolution>=S)&&l.push(C[o],C[o+1]);if(0==(u=l.length))return}u=this.appendFlatCoordinates(l,0,u,c,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(x,a,u),this.endGeometry(t,e)}}},t.prototype.getImage=function(t,e,i,r){var n,o=r+e+t+i+this.pixelRatio;if(!Li.containsKey(o)){var s=r?this.strokeStates[r]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[e]||this.textState_,l=this.pixelRatio,u=h.scale*l,c=_u[h.textAlign||Ri],p=r&&s.lineWidth?s.lineWidth:0,d=t.split("\n"),f=d.length,_=[],g=function(t,e,i){for(var r=e.length,n=0,o=0;o<r;++o){var s=ki(t,e[o]);n=Math.max(n,s),i.push(s)}return n}(h.font,d,_),y=Gi(h.font),v=y*f,m=g+p,x=De(Math.ceil(m*u),Math.ceil((v+p)*u));n=x.canvas,Li.set(o,n),1!=u&&x.scale(u,u),x.font=h.font,r&&(x.strokeStyle=s.strokeStyle,x.lineWidth=p,x.lineCap=s.lineCap,x.lineJoin=s.lineJoin,x.miterLimit=s.miterLimit,hi&&s.lineDash.length&&(x.setLineDash(s.lineDash),x.lineDashOffset=s.lineDashOffset)),i&&(x.fillStyle=a.fillStyle),x.textBaseline="middle",x.textAlign="center";var S,C=.5-c,E=c*n.width/u+C*p;if(r)for(S=0;S<f;++S)x.strokeText(d[S],E+C*_[S],.5*(p+y)+S*y);if(i)for(S=0;S<f;++S)x.fillText(d[S],E+C*_[S],.5*(p+y)+S*y)}return Li.get(o)},t.prototype.drawTextImage_=function(t,e,i){var r=this.textState_,n=this.textStrokeState_,o=this.pixelRatio,s=_u[r.textAlign||Ri],a=_u[r.textBaseline],h=n&&n.lineWidth?n.lineWidth:0,l=s*t.width/o+2*(.5-s)*h,u=a*t.height/o+2*(.5-a)*h;this.instructions.push([ru,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,r.padding==Ii?Ii:r.padding.map(function(t){return t*o}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ru,e,i,t,(l-this.textOffsetX_)*o,(u-this.textOffsetY_)*o,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/o,!0,t.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(t,e,i){var r=this.textStrokeState_,n=this.textState_,o=this.textFillState_,s=this.strokeKey_;r&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||Ri,scale:n.scale});var h=this.fillKey_;o&&(h in this.fillStates||(this.fillStates[h]={fillStyle:o.fillStyle}));var l=this.pixelRatio,u=_u[n.textBaseline],c=this.textOffsetY_*l,p=this.text_,d=n.font,f=n.scale,_=r?r.lineWidth*f/2:0,g=this.widths_[d];g||(this.widths_[d]=g={}),this.instructions.push([iu,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=g[t];return e||(e=g[t]=ki(d,t)),e*f*l},c,s,_*l,p,a,1]),this.hitDetectionInstructions.push([iu,t,e,u,i,n.overflow,h,n.maxAngle,function(t){var e=g[t];return e||(e=g[t]=ki(d,t)),e*f},c,s,_,p,a,1/l])},t.prototype.setTextStyle=function(t,e){var i,r,n;if(t){this.declutterGroup_=e;var o=t.getFill();o?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=ke(o.getColor()||Si)):r=this.textFillState_=null;var s=t.getStroke();if(s){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var a=s.getLineDash(),h=s.getLineDashOffset(),l=s.getWidth(),u=s.getMiterLimit();n.lineCap=s.getLineCap()||Ci,n.lineDash=a?a.slice():Ei,n.lineDashOffset=void 0===h?0:h,n.lineJoin=s.getLineJoin()||Ti,n.lineWidth=void 0===l?1:l,n.miterLimit=void 0===u?10:u,n.strokeStyle=ke(s.getColor()||wi)}else n=this.textStrokeState_=null;i=this.textState_;var c=t.getFont()||xi;Mi(c);var p=t.getScale();i.overflow=t.getOverflow(),i.font=c,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()||Ii,i.scale=void 0===p?1:p;var d=t.getOffsetX(),f=t.getOffsetY(),_=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===g?0:g,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Et(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+Et(r.fillStyle):""}else this.text_=""},t}(vu)},Tu=function(a){function t(t,e,i,r,n,o,s){a.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=e,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=i,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=De(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return a&&(t.__proto__=a),((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.addDeclutter=function(t){var e=null;return this.declutterTree_&&(t?(e=this.declutterGroup_)[4]++:(e=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),e},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.hasReplays=function(t){for(var e in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[e],r=0,n=t.length;r<n;++r)if(t[r]in i)return!0;return!1},t.prototype.finish=function(){for(var t in this.replaysByZIndex_){var e=this.replaysByZIndex_[t];for(var i in e)e[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a,h=2*(r=Math.round(r))+1,l=Te(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-i,-t[0],-t[1]),u=this.hitDetectionContext_;u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.renderBuffer_&&(q(a=[1/0,1/0,-1/0,-1/0],t),G(a,e*(this.renderBuffer_+r),a));var c,p,d=function(t){if(void 0!==wu[t])return wu[t];for(var e=2*t+1,i=new Array(e),r=0;r<e;r++)i[r]=new Array(e);var n=t,o=0,s=0;for(;o<=n;)Ru(i,t+n,t+o),Ru(i,t+o,t+n),Ru(i,t-o,t+n),Ru(i,t-n,t+o),Ru(i,t-n,t-o),Ru(i,t-o,t-n),Ru(i,t+o,t-n),Ru(i,t+n,t-o),0<2*((s+=1+2*++o)-n)+1&&(s+=1-2*(n-=1));return wu[t]=i}(r);function f(t){for(var e=u.getImageData(0,0,h,h).data,i=0;i<h;i++)for(var r=0;r<h;r++)if(d[i][r]&&0<e[4*(r*h+i)+3]){var n=void 0;return(!c||p!=Zl.IMAGE&&p!=Zl.TEXT||-1!==c.indexOf(t))&&(n=o(t)),n||void u.clearRect(0,0,h,h)}}this.declutterTree_&&(c=this.declutterTree_.all().map(function(t){return t.value}));var _,g,y,v,m,x=Object.keys(this.replaysByZIndex_).map(Number);for(x.sort(hr),_=x.length-1;0<=_;--_){var S=x[_].toString();for(y=this.replaysByZIndex_[S],g=fu.length-1;0<=g;--g)if(void 0!==(v=y[p=fu[g]]))if(!s||p!=Zl.IMAGE&&p!=Zl.TEXT){if(m=v.replayHitDetection(u,l,i,n,f,a))return m}else{var C=s[S];C?C.push(v,l.slice(0)):s[S]=[v,l.slice(0)]}}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],r=e[1],n=e[2],o=e[3],s=[i,r,i,o,n,o,n,r];return Rt(s,0,8,2,t,s),s},t.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new Eu[e](this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[e]=n);return n},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return Tt(this.replaysByZIndex_)},t.prototype.replay=function(t,e,i,r,n,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(hr),t.save(),this.clip(t,e);var a,h,l,u,c,p,d=n||fu;for(a=0,h=s.length;a<h;++a){var f=s[a].toString();for(c=this.replaysByZIndex_[f],l=0,u=d.length;l<u;++l){var _=d[l];if(p=c[_],void 0!==p)if(!o||_!=Zl.IMAGE&&_!=Zl.TEXT)p.replay(t,e,i,r);else{var g=o[f];g?g.push(p,e.slice(0)):o[f]=[p,e.slice(0)]}}}t.restore()},t}(Hl),wu={0:[[!0]]};function Ru(t,e,i){var r,n=Math.floor(t.length/2);if(n<=e)for(r=n;r<e;r++)t[r][i]=!0;else if(e<n)for(r=e+1;r<n;r++)t[r][i]=!0}var Iu=.5,Lu={Point:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=di.LOADED)return;var o=t.getReplay(i.getZIndex(),Zl.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Zl.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},LineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),Zl.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Zl.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},Polygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),Zl.POLYGON);s.setFillStrokeStyle(n,o),s.drawPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Zl.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},MultiPoint:function(t,e,i,r){var n=i.getImage();if(n){if(n.getImageState()!=di.LOADED)return;var o=t.getReplay(i.getZIndex(),Zl.IMAGE);o.setImageStyle(n,t.addDeclutter(!1)),o.drawMultiPoint(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Zl.TEXT);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,r)}},MultiLineString:function(t,e,i,r){var n=i.getStroke();if(n){var o=t.getReplay(i.getZIndex(),Zl.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawMultiLineString(e,r)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),Zl.TEXT);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,r)}},MultiPolygon:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(o||n){var s=t.getReplay(i.getZIndex(),Zl.POLYGON);s.setFillStrokeStyle(n,o),s.drawMultiPolygon(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Zl.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}},GeometryCollection:function(t,e,i,r){var n,o,s=e.getGeometriesArray();for(n=0,o=s.length;n<o;++n){var a=Lu[s[n].getType()];a(t,s[n],i,r)}},Circle:function(t,e,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var s=t.getReplay(i.getZIndex(),Zl.CIRCLE);s.setFillStrokeStyle(n,o),s.drawCircle(e,r)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),Zl.TEXT);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,r)}}};function bu(t,e){return Et(t)-Et(e)}function Pu(t,e){var i=Fu(t,e);return i*i}function Fu(t,e){return Iu*t/e}function Mu(t,e,i,r,n,o){var s=!1,a=i.getImage();if(a){var h=a.getImageState();h==di.LOADED||h==di.ERROR?a.unlistenImageChange(n,o):(h==di.IDLE&&a.load(),h=a.getImageState(),a.listenImageChange(n,o),s=!0)}return function(t,e,i,r){var n=i.getGeometryFunction()(e);if(!n)return;var o=n.getSimplifiedGeometry(r);if(i.getRenderer())!function t(e,i,r,n){if(i.getType()==Lt.GEOMETRY_COLLECTION){for(var o=i.getGeometries(),s=0,a=o.length;s<a;++s)t(e,o[s],r,n);return}var h=e.getReplay(r.getZIndex(),Zl.DEFAULT);h.drawCustom(i,n,r.getRenderer())}(t,o,i,e);else{var s=Lu[o.getType()];s(t,o,i,e)}}(t,e,i,r),s}var Ou=function(e){function t(t){e.call(this,t),this.declutterTree_=t.getDeclutter()?Sh(9,void 0):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=De(),E(Li,w.CLEAR,this.handleFontsChanged_,this)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.disposeInternal=function(){d(Li,w.CLEAR,this.handleFontsChanged_,this),e.prototype.disposeInternal.call(this)},t.prototype.compose=function(t,e,i){var r=e.extent,n=e.pixelRatio,o=i.managed?e.skippedFeatureUids:{},s=e.viewState,a=s.projection,h=s.rotation,l=a.getExtent(),u=this.getLayer().getSource(),c=this.getTransform(e,0),p=i.extent,d=void 0!==p;d&&this.clip(t,e,p);var f=this.replayGroup_;if(f&&!f.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var _,g=this.getLayer(),y=0,v=0,m=1!==i.opacity,x=g.hasListener(wn);if(m||x){var S=t.canvas.width,C=t.canvas.height;if(h){var E=Math.round(Math.sqrt(S*S+C*C));y=(E-S)/2,v=(E-C)/2,S=C=E}this.context.canvas.width=S,this.context.canvas.height=C,_=this.context}else _=t;var T=_.globalAlpha;m||(_.globalAlpha=i.opacity),_!=t&&_.translate(y,v);var w=e.size[0]*n,R=e.size[1]*n;if(Di(_,-h,w/2,R/2),f.replay(_,c,h,o),u.getWrapX()&&a.canWrapX()&&!Q(l,r)){for(var I,L=r[0],b=ct(l),P=0;L<l[0];)I=b*--P,c=this.getTransform(e,I),f.replay(_,c,h,o),L+=b;for(P=0,L=r[2];L>l[2];)I=b*++P,c=this.getTransform(e,I),f.replay(_,c,h,o),L-=b}if(Di(_,h,w/2,R/2),x&&this.dispatchRenderEvent(_,e,c),_!=t){if(m){var F=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(_.canvas,-y,-v),t.globalAlpha=F}else t.drawImage(_.canvas,-y,-v);_.translate(-y,-v)}m||(_.globalAlpha=T)}d&&t.restore()},t.prototype.composeFrame=function(t,e,i){var r=this.getTransform(t,0);this.preCompose(i,t,r),this.compose(i,t,e),this.postCompose(i,t,e,r)},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_){var o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),h={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,i,{},function(t){var e=Et(t).toString();if(!(e in h))return h[e]=!0,r.call(n,t,a)},null)}},t.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},t.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(t,e){var n=this.getLayer(),i=n.getSource(),r=t.viewHints[rs.ANIMATING],o=t.viewHints[rs.INTERACTING],s=n.getUpdateWhileAnimating(),a=n.getUpdateWhileInteracting();if(!this.dirty_&&!s&&r||!a&&o)return!0;var h=t.extent,l=t.viewState,u=l.projection,c=l.resolution,p=t.pixelRatio,d=n.getRevision(),f=n.getRenderBuffer(),_=n.getRenderOrder();void 0===_&&(_=bu);var g=G(h,f*c),y=l.projection.getExtent();if(i.getWrapX()&&l.projection.canWrapX()&&!Q(y,t.extent)){var v=ct(y),m=Math.max(ct(g)/2,v);g[0]=y[0]-m,g[2]=y[2]+m}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&Q(this.renderedExtent_,g))return!(this.replayGroupChanged=!1);this.replayGroup_=null,this.dirty_=!1;var x=new Tu(Fu(c,p),g,c,p,i.getOverlaps(),this.declutterTree_,n.getRenderBuffer());i.loadFeatures(g,c,u);var S=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,c)),e){var r=this.renderFeature(t,c,p,e,x);this.dirty_=this.dirty_||r}}.bind(this);if(_){var C=[];i.forEachFeatureInExtent(g,function(t){C.push(t)},this),C.sort(_);for(var E=0,T=C.length;E<T;++E)S(C[E])}else i.forEachFeatureInExtent(g,S,this);return x.finish(),this.renderedResolution_=c,this.renderedRevision_=d,this.renderedRenderOrder_=_,this.renderedExtent_=g,this.replayGroup_=x,this.replayGroupChanged=!0},t.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=Mu(n,t,r[s],Pu(e,i),this.handleStyleImageChange_,this)||o;else o=Mu(n,t,r,Pu(e,i),this.handleStyleImageChange_,this);return o},t}(Bl);Ou.handles=function(t){return t.getType()===oh.VECTOR},Ou.create=function(t,e){return new Ou(e)};var Nu="image",Au="hybrid",Gu="vector",ku={image:[Zl.POLYGON,Zl.CIRCLE,Zl.LINE_STRING,Zl.IMAGE,Zl.TEXT],hybrid:[Zl.POLYGON,Zl.LINE_STRING]},Du={image:[Zl.DEFAULT],hybrid:[Zl.IMAGE,Zl.TEXT,Zl.DEFAULT],vector:fu},ju=function(F){function t(t){F.call(this,t,!0),this.declutterTree_=t.getDeclutter()?Sh(9,void 0):null,this.dirty_=!1,this.renderedLayerRevision_,this.tmpTransform_=[1,0,0,1,0,0],this.zDirection=t.getRenderMode()==Gu?1:0,E(Li,w.CLEAR,this.handleFontsChanged_,this)}return F&&(t.__proto__=F),((t.prototype=Object.create(F&&F.prototype)).constructor=t).prototype.disposeInternal=function(){d(Li,w.CLEAR,this.handleFontsChanged_,this),F.prototype.disposeInternal.call(this)},t.prototype.getTile=function(t,e,i,r,n){var o=F.prototype.getTile.call(this,t,e,i,r,n);return o.getState()===Gn&&(this.createReplayGroup_(o,r,n),this.context&&this.renderTileImage_(o,r,n)),o},t.prototype.prepareFrame=function(t,e){var i=this.getLayer(),r=i.getRevision();if(this.renderedLayerRevision_!=r){this.renderedTiles.length=0;var n=i.getRenderMode();this.context||n==Gu||(this.context=De()),this.context&&n==Gu&&(this.context=null)}return this.renderedLayerRevision_=r,F.prototype.prepareFrame.apply(this,arguments)},t.prototype.createReplayGroup_=function(y,v,m){var x=this,S=this.getLayer(),t=S.getRevision(),C=S.getRenderOrder()||null,E=y.getReplayState(S);if(E.dirty||E.renderedRevision!=t||E.renderedRenderOrder!=C){for(var T=S.getSource(),w=T.getTileGrid(),R=T.getTileGridForProjection(m).getResolution(y.tileCoord[0]),I=y.extent,e=function(t,e){var i=y.getTile(y.tileKeys[t]);if(i.getState()==Gn){var r=i.tileCoord,n=w.getTileCoordExtent(r),o=ht(I,n),s=$(n,o)?null:G(o,S.getRenderBuffer()*R,x.tmpExtent),a=i.getProjection(),h=!1;ue(m,a)||(h=!0,i.setProjection(m)),E.dirty=!1;var l=new Tu(0,o,R,v,T.getOverlaps(),x.declutterTree_,S.getRenderBuffer()),u=Pu(R,v),c=function(t){var e,i=t.getStyleFunction()||S.getStyleFunction();if(i&&(e=i(t,R)),e){var r=this.renderFeature(t,u,e,l);this.dirty_=this.dirty_||r,E.dirty=E.dirty||r}},p=i.getFeatures();C&&C!==E.renderedRenderOrder&&p.sort(C);for(var d=0,f=p.length;d<f;++d){var _=p[d];h&&(a.getUnits()==Ot.TILE_PIXELS&&(a.setWorldExtent(n),a.setExtent(i.getExtent())),_.getGeometry().transform(a,m)),s&&!wt(s,_.getGeometry().getExtent())||c.call(x,_)}for(var g in l.finish(),l.getReplays());i.setReplayGroup(S,y.tileCoord.toString(),l)}},i=0,r=y.tileKeys.length;i<r;++i)e(i);E.renderedRevision=t,E.renderedRenderOrder=C}},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var a,h,l,u,c,p=this.getLayer(),d={},f=this.renderedTiles;for(l=0,u=f.length;l<u;++l){var _=f[l];if(j(a=G(_.extent,i*o,a),t))for(var g=0,y=_.tileKeys.length;g<y;++g){var v=_.getTile(_.tileKeys[g]);v.getState()==Gn&&(c=v.getReplayGroup(p,_.tileCoord.toString()),h=h||c.forEachFeatureAtCoordinate(t,o,s,i,{},function(t){var e=Et(t).toString();if(!(e in d))return d[e]=!0,r.call(n,t,p)},null))}}return h},t.prototype.getReplayTransform_=function(t,e){var i=this.getLayer().getSource().getTileGrid(),r=t.tileCoord,n=i.getResolution(r[0]),o=e.viewState,s=e.pixelRatio,a=o.resolution/s,h=i.getTileCoordExtent(r,this.tmpExtent),l=o.center,u=lt(h),c=e.size,p=Math.round(s*c[0]/2),d=Math.round(s*c[1]/2);return Te(this.tmpTransform_,p,d,n/a,n/a,o.rotation,(u[0]-l[0])/n,(l[1]-u[1])/n)},t.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},t.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},t.prototype.postCompose=function(t,e,i){var r=this.getLayer(),n=r.getRenderMode();if(n!=Nu){var o,s,a=r.getDeclutter()?{}:null,h=r.getSource(),l=Du[n],u=e.pixelRatio,c=e.viewState.rotation,p=e.size;c&&Di(t,-c,o=Math.round(u*p[0]/2),s=Math.round(u*p[1]/2)),a&&this.declutterTree_.clear();for(var d=this.renderedTiles,f=h.getTileGridForProjection(e.viewState.projection),_=[],g=[],y=d.length-1;0<=y;--y){var v=d[y];if(v.getState()!=jn)for(var m=v.tileCoord,x=f.getTileCoordExtent(m,this.tmpExtent)[0]-v.extent[0],S=void 0,C=0,E=v.tileKeys.length;C<E;++C){var T=v.getTile(v.tileKeys[C]);if(T.getState()==Gn){var w=T.getReplayGroup(r,m.toString());if(w&&w.hasReplays(l)){S||(S=this.getTransform(e,x));var R=T.tileCoord[0],I=w.getClipCoords(S);t.save(),t.globalAlpha=i.opacity;for(var L=0,b=_.length;L<b;++L){var P=_[L];R<g[L]&&(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.moveTo(P[6],P[7]),t.lineTo(P[4],P[5]),t.lineTo(P[2],P[3]),t.lineTo(P[0],P[1]),t.clip())}w.replay(t,S,c,{},l,a),t.restore(),_.push(I),g.push(R)}}}}a&&function(t,e,i){for(var r=Object.keys(t).map(Number).sort(hr),n={},o=0,s=r.length;o<s;++o)for(var a=t[r[o].toString()],h=0,l=a.length;h<l;){var u=a[h++],c=a[h++];u.replay(e,c,i,n)}}(a,t,c),c&&Di(t,c,o,s)}F.prototype.postCompose.apply(this,arguments)},t.prototype.renderFeature=function(t,e,i,r){if(!i)return!1;var n=!1;if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)n=Mu(r,t,i[o],e,this.handleStyleImageChange_,this)||n;else n=Mu(r,t,i,e,this.handleStyleImageChange_,this);return n},t.prototype.renderTileImage_=function(t,e,i){var r=this.getLayer(),n=t.getReplayState(r),o=r.getRevision(),s=ku[r.getRenderMode()];if(s&&n.renderedTileRevision!==o){n.renderedTileRevision=o;var a=t.wrappedTileCoord,h=a[0],l=r.getSource(),u=l.getTileGridForProjection(i),c=u.getResolution(h),p=t.getContext(r),d=l.getTilePixelSize(h,e,i);p.canvas.width=d[0],p.canvas.height=d[1];for(var f=u.getTileCoordExtent(a,this.tmpExtent),_=0,g=t.tileKeys.length;_<g;++_){var y=t.getTile(t.tileKeys[_]);if(y.getState()==Gn){var v=e/c,m=ge(this.tmpTransform_);Ce(m,v,-v),Ee(m,-f[0],-f[3]),y.getReplayGroup(r,t.tileCoord.toString()).replay(p,m,0,{},s)}}}},t}(Kl);ju.handles=function(t){return t.getType()===oh.VECTOR_TILE},ju.create=function(t,e){return new ju(e)};var Uu,Yu=function(e){function t(t){(t=C({},t)).controls||(t.controls=As()),t.interactions||(t.interactions=Ll()),e.call(this,t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.createRenderer=function(){var t=new Ul(this);return t.registerLayerRenderers([zl,Kl,Ou,ju]),t},t}(Rs),Bu="bottom-left",Xu="bottom-center",zu="bottom-right",Vu="center-left",Wu="center-center",Ku="center-right",Hu="top-left",Zu="top-center",qu="top-right",Ju="element",Qu="map",$u="offset",tc="position",ec="positioning",ic=function(e){function t(t){e.call(this),this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("DIV"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.autoPanAnimation=t.autoPanAnimation||{},this.autoPanMargin=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,E(this,b(Ju),this.handleElementChanged,this),E(this,b(Qu),this.handleMapChanged,this),E(this,b($u),this.handleOffsetChanged,this),E(this,b(tc),this.handlePositionChanged,this),E(this,b(ec),this.handlePositioningChanged,this),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(void 0!==t.positioning?t.positioning:Hu),void 0!==t.position&&this.setPosition(t.position)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getElement=function(){return this.get(Ju)},t.prototype.getId=function(){return this.id},t.prototype.getMap=function(){return this.get(Qu)},t.prototype.getOffset=function(){return this.get($u)},t.prototype.getPosition=function(){return this.get(tc)},t.prototype.getPositioning=function(){return this.get(ec)},t.prototype.handleElementChanged=function(){Ye(this.element);var t=this.getElement();t&&this.element.appendChild(t)},t.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Ue(this.element),g(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=E(t,Wo,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element)}},t.prototype.render=function(){this.updatePixelPosition()},t.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},t.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(tc)&&this.autoPan&&this.panIntoView()},t.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},t.prototype.setElement=function(t){this.set(Ju,t)},t.prototype.setMap=function(t){this.set(Qu,t)},t.prototype.setOffset=function(t){this.set($u,t)},t.prototype.setPosition=function(t){this.set(tc,t)},t.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var e,i,r,n,o,s,a=this.getRect(t.getTargetElement(),t.getSize()),h=this.getElement(),l=this.getRect(h,[(n=h,o=n.offsetWidth,s=getComputedStyle(n),o+=parseInt(s.marginLeft,10)+parseInt(s.marginRight,10)),(e=h,i=e.offsetHeight,r=getComputedStyle(e),i+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10))]),u=this.autoPanMargin;if(!Q(a,l)){var c=l[0]-a[0],p=a[2]-l[2],d=l[1]-a[1],f=a[3]-l[3],_=[0,0];if(c<0?_[0]=c-u:p<0&&(_[0]=Math.abs(p)+u),d<0?_[1]=d-u:f<0&&(_[1]=Math.abs(f)+u),0!==_[0]||0!==_[1]){var g=t.getView().getCenter(),y=t.getPixelFromCoordinate(g),v=[y[0]+_[0],y[1]+_[1]];t.getView().animate({center:t.getCoordinateFromPixel(v),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},t.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,n=i.top+window.pageYOffset;return[r,n,r+e[0],n+e[1]]},t.prototype.setPositioning=function(t){this.set(ec,t)},t.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},t.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var i=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},t.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,r=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var o=r[0],s=r[1];if(n==zu||n==Ku||n==qu){""!==this.rendered.left_&&(this.rendered.left_=i.left="");var a=Math.round(e[0]-t[0]-o)+"px";this.rendered.right_!=a&&(this.rendered.right_=i.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=i.right=""),n!=Xu&&n!=Wu&&n!=Zu||(o-=this.element.offsetWidth/2);var h=Math.round(t[0]+o)+"px";this.rendered.left_!=h&&(this.rendered.left_=i.left=h)}if(n==Bu||n==Xu||n==zu){""!==this.rendered.top_&&(this.rendered.top_=i.top="");var l=Math.round(e[1]-t[1]-s)+"px";this.rendered.bottom_!=l&&(this.rendered.bottom_=i.bottom=l)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=i.bottom=""),n!=Vu&&n!=Wu&&n!=Ku||(s-=this.element.offsetHeight/2);var u=Math.round(t[1]+s)+"px";this.rendered.top_!=u&&(this.rendered.top_=i.top=u)}},t.prototype.getOptions=function(){return this.options},t}(R),rc=[0,0,4096,4096],nc=function(s){function t(t,e,i,r,n,o){s.call(this,t,e,o),this.consumers=0,this.extent_=null,this.format_=r,this.features_=null,this.loader_,this.projection_=null,this.replayGroups_={},this.tileLoadFunction_=n,this.url_=i}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.disposeInternal=function(){this.features_=null,this.replayGroups_={},this.state=jn,this.changed(),s.prototype.disposeInternal.call(this)},t.prototype.getExtent=function(){return this.extent_||rc},t.prototype.getFormat=function(){return this.format_},t.prototype.getFeatures=function(){return this.features_},t.prototype.getKey=function(){return this.url_},t.prototype.getProjection=function(){return this.projection_},t.prototype.getReplayGroup=function(t,e){return this.replayGroups_[Et(t)+","+e]},t.prototype.load=function(){this.state==Nn&&(this.setState(An),this.tileLoadFunction_(this,this.url_),this.loader_(null,NaN,null))},t.prototype.onLoad=function(t,e,i){this.setProjection(e),this.setFeatures(t),this.setExtent(i)},t.prototype.onError=function(){this.setState(kn)},t.prototype.setExtent=function(t){this.extent_=t},t.prototype.setFeatures=function(t){this.features_=t,this.setState(Gn)},t.prototype.setProjection=function(t){this.projection_=t},t.prototype.setReplayGroup=function(t,e,i){this.replayGroups_[Et(t)+","+e]=i},t.prototype.setLoader=function(t){this.loader_=t},t}(zn),oc=function(){if(!Uu){var t=document.body;t.webkitRequestFullscreen?Uu="webkitfullscreenchange":t.mozRequestFullScreen?Uu="mozfullscreenchange":t.msRequestFullscreen?Uu="MSFullscreenChange":t.requestFullscreen&&(Uu="fullscreenchange")}return Uu},sc=function(h){function t(t){var e=t||{};h.call(this,{element:document.createElement("div"),target:e.target}),this.cssClassName_=void 0!==e.className?e.className:"ol-full-screen";var i=void 0!==e.label?e.label:"⤢";this.labelNode_="string"==typeof i?document.createTextNode(i):i;var r=void 0!==e.labelActive?e.labelActive:"×";this.labelActiveNode_="string"==typeof r?document.createTextNode(r):r;var n=e.tipLabel?e.tipLabel:"Toggle full-screen",o=document.createElement("button");o.className=this.cssClassName_+"-"+hc(),o.setAttribute("type","button"),o.title=n,o.appendChild(this.labelNode_),E(o,w.CLICK,this.handleClick_,this);var s=this.cssClassName_+" "+_i+" "+gi+" "+(ac()?"":"ol-unsupported"),a=this.element;a.className=s,a.appendChild(o),this.keys_=void 0!==e.keys&&e.keys,this.source_=e.source}return h&&(t.__proto__=h),((t.prototype=Object.create(h&&h.prototype)).constructor=t).prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},t.prototype.handleFullScreen_=function(){if(ac()){var t,e,i=this.getMap();if(i)if(hc())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:i.getTargetElement(),this.keys_?(e=t).mozRequestFullScreenWithKeys?e.mozRequestFullScreenWithKeys():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):lc(e):lc(t)}},t.prototype.handleFullScreenChange_=function(){var t=this.element.firstElementChild,e=this.getMap();hc()?(t.className=this.cssClassName_+"-true",je(this.labelActiveNode_,this.labelNode_)):(t.className=this.cssClassName_+"-false",je(this.labelNode_,this.labelActiveNode_)),e&&e.updateSize()},t.prototype.setMap=function(t){h.prototype.setMap.call(this,t),t&&this.listenerKeys.push(E(document,oc(),this.handleFullScreenChange_,this))},t}(Is);function ac(){var t=document.body;return!!(t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function hc(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function lc(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var uc=function(y){function t(t){var e=t||{};y.call(this,{element:document.createElement("div"),render:e.render||cc,target:e.target}),this.collapsed_=void 0===e.collapsed||e.collapsed,this.collapsible_=void 0===e.collapsible||e.collapsible,this.collapsible_||(this.collapsed_=!1);var i=void 0!==e.className?e.className:"ol-overviewmap",r=void 0!==e.tipLabel?e.tipLabel:"Overview map",n=void 0!==e.collapseLabel?e.collapseLabel:"«";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var o=void 0!==e.label?e.label:"»";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;var s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=r,a.appendChild(s),E(a,w.CLICK,this.handleClick_,this),this.ovmapDiv_=document.createElement("DIV"),this.ovmapDiv_.className="ol-overviewmap-map",this.ovmap_=new Yu({controls:new M,interactions:new M,view:e.view});var h=this.ovmap_;e.layers&&e.layers.forEach(function(t){h.addLayer(t)}.bind(this));var l=document.createElement("DIV");l.className="ol-overviewmap-box",l.style.boxSizing="border-box",this.boxOverlay_=new ic({position:[0,0],positioning:Bu,element:l}),this.ovmap_.addOverlay(this.boxOverlay_);var u=i+" "+_i+" "+gi+(this.collapsed_&&this.collapsible_?" "+yi:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=u,c.appendChild(this.ovmapDiv_),c.appendChild(a);var p=this,d=this.boxOverlay_,f=this.boxOverlay_.getElement(),_=function(t){var e,i=h.getEventCoordinate({clientX:(e=t).clientX-f.offsetWidth/2,clientY:e.clientY+f.offsetHeight/2});d.setPosition(i)},g=function(t){var e=h.getEventCoordinate(t);p.getMap().getView().setCenter(e),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",g)};f.addEventListener("mousedown",function(){window.addEventListener("mousemove",_),window.addEventListener("mouseup",g)})}return y&&(t.__proto__=y),((t.prototype=Object.create(y&&y.prototype)).constructor=t).prototype.setMap=function(t){var e=this.getMap();if(t!==e){if(e){var i=e.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(y.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(E(t,a,this.handleMapPropertyChange_,this)),0===this.ovmap_.getLayers().getLength()&&this.ovmap_.setLayerGroup(t.getLayerGroup());var r=t.getView();r&&(this.bindView_(r),r.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},t.prototype.handleMapPropertyChange_=function(t){if(t.key===Zo.VIEW){var e=t.oldValue;e&&this.unbindView_(e);var i=this.getMap().getView();this.bindView_(i)}},t.prototype.bindView_=function(t){E(t,b(ss),this.handleRotationChanged_,this)},t.prototype.unbindView_=function(t){d(t,b(ss),this.handleRotationChanged_,this)},t.prototype.handleRotationChanged_=function(){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},t.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getSize(),o=e.getView().calculateExtent(n),s=e.getPixelFromCoordinate(lt(r)),a=e.getPixelFromCoordinate(nt(r)),h=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),u=n[0],c=n[1];h<.1*u||l<.1*c||.75*u<h||.75*c<l?this.resetExtent_():Q(o,r)||this.recenter_()}},t.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getSize(),r=t.getView().calculateExtent(i),n=e.getView(),o=Math.log(7.5)/Math.LN2;dt(r,1/(.1*Math.pow(2,o/2))),n.fit(r)},t.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenter(i.getCenter())},t.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),r=t.getView(),n=e.getView(),o=r.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),h=r.calculateExtent(i),l=n.getResolution(),u=rt(h),c=ut(h),p=this.calculateCoordinateRotate_(o,u);s.setPosition(p),a&&(a.style.width=Math.abs((u[0]-c[0])/l)+"px",a.style.height=Math.abs((c[1]-u[1])/l)+"px")}},t.prototype.calculateCoordinateRotate_=function(t,e){var i,r=this.getMap().getView().getCenter();return r&&(pn(i=[e[0]-r[0],e[1]-r[1]],t),an(i,r)),i},t.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(yi),this.collapsed_?je(this.collapseLabel_,this.label_):je(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;this.collapsed_||t.isRendered()||(t.updateSize(),this.resetExtent_(),p(t,Wo,function(t){this.updateBox_()},this))},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t.prototype.getOverviewMap=function(){return this.ovmap_},t}(Is);function cc(t){this.validateExtent_(),this.updateBox_()}var pc="units",dc="degrees",fc="imperial",_c="nautical",gc="metric",yc="us",vc=[1,2,5],mc=function(r){function t(t){var e=t||{},i=void 0!==e.className?e.className:"ol-scale-line";r.call(this,{element:document.createElement("DIV"),render:e.render||xc,target:e.target}),this.innerElement_=document.createElement("DIV"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+_i,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==e.minWidth?e.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",E(this,b(pc),this.handleUnitsChanged_,this),this.setUnits(e.units||gc)}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.getUnits=function(){return this.get(pc)},t.prototype.handleUnitsChanged_=function(){this.updateElement_()},t.prototype.setUnits=function(t){this.set(pc,t)},t.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,r=this.getUnits(),n=r==dc?Ot.DEGREES:Ot.METERS,o=oe(i,t.resolution,e,n);i.getUnits()!=Ot.DEGREES&&i.getMetersPerUnit()&&n==Ot.METERS&&(o*=i.getMetersPerUnit());var s=this.minWidth_*o,a="";if(r==dc){var h=Nt[Ot.DEGREES];i.getUnits()==Ot.DEGREES?s*=h:o/=h,s<h/60?(a="″",o*=3600):s<h?(a="′",o*=60):a="°"}else r==fc?s<.9144?(a="in",o/=.0254):s<1609.344?(a="ft",o/=.3048):(a="mi",o/=1609.344):r==_c?(o/=1852,a="nm"):r==gc?s<.001?(a="μm",o*=1e6):s<1?(a="mm",o*=1e3):s<1e3?a="m":(a="km",o/=1e3):r==yc?s<.9144?(a="in",o*=39.37):s<1609.344?(a="ft",o/=.30480061):(a="mi",o/=1609.3472):Z(!1,33);for(var l,u,c=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10));;){if(l=vc[(c%3+3)%3]*Math.pow(10,Math.floor(c/3)),u=Math.round(l/o),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++c}var p=l+" "+a;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},t}(Is);function xc(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}var Sc=0,Cc=1,Ec=function(o){function t(t){var e=t||{};o.call(this,{element:document.createElement("div"),render:e.render||Tc}),this.currentResolution_=void 0,this.direction_=Sc,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.previousX_,this.previousY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==e.duration?e.duration:200;var i=void 0!==e.className?e.className:"ol-zoomslider",r=document.createElement("button");r.setAttribute("type","button"),r.className=i+"-thumb "+_i;var n=this.element;n.className=i+" "+_i+" "+gi,n.appendChild(r),this.dragger_=new zo(n),E(this.dragger_,$n,this.handleDraggerStart_,this),E(this.dragger_,Qn,this.handleDraggerDrag_,this),E(this.dragger_,to,this.handleDraggerEnd_,this),E(n,w.CLICK,this.handleContainerClick_,this),E(r,w.CLICK,x)}return o&&(t.__proto__=o),((t.prototype=Object.create(o&&o.prototype)).constructor=t).prototype.disposeInternal=function(){this.dragger_.dispose(),o.prototype.disposeInternal.call(this)},t.prototype.setMap=function(t){o.prototype.setMap.call(this,t),t&&t.render()},t.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,r=t.firstElementChild,n=getComputedStyle(r),o=r.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=r.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);this.thumbSize_=[o,s],i<e?(this.direction_=Cc,this.widthLimit_=e-o):(this.direction_=Sc,this.heightLimit_=i-s),this.sliderInitialized_=!0},t.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i);e.animate({resolution:e.constrainResolution(r),duration:this.duration_,easing:Yn})},t.prototype.handleDraggerStart_=function(t){this.dragging_||t.originalEvent.target!==this.element.firstElementChild||(this.getMap().getView().setHint(rs.INTERACTING,1),this.previousX_=t.clientX,this.previousY_=t.clientY,this.dragging_=!0)},t.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=this.element.firstElementChild,i=t.clientX-this.previousX_+parseInt(e.style.left,10),r=t.clientY-this.previousY_+parseInt(e.style.top,10),n=this.getRelativePosition_(i,r);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_),this.setThumbPosition_(this.currentResolution_),this.previousX_=t.clientX,this.previousY_=t.clientY}},t.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.setHint(rs.INTERACTING,-1),e.animate({resolution:e.constrainResolution(this.currentResolution_),duration:this.duration_,easing:Yn}),this.dragging_=!1,this.previousX_=void 0,this.previousY_=void 0}},t.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==Cc?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},t.prototype.getRelativePosition_=function(t,e){return gt(this.direction_===Cc?t/this.widthLimit_:e/this.heightLimit_,0,1)},t.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},t.prototype.getPositionForResolution_=function(t){return 1-this.getMap().getView().getValueForResolutionFunction()(t)},t}(Is);function Tc(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;e!==this.currentResolution_&&(this.currentResolution_=e,this.setThumbPosition_(e))}}var wc=function(h){function t(t){var e=t||{};h.call(this,{element:document.createElement("div"),target:e.target}),this.extent=e.extent?e.extent:null;var i=void 0!==e.className?e.className:"ol-zoom-extent",r=void 0!==e.label?e.label:"E",n=void 0!==e.tipLabel?e.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=n,o.appendChild("string"==typeof r?document.createTextNode(r):r),E(o,w.CLICK,this.handleClick_,this);var s=i+" "+_i+" "+gi,a=this.element;a.className=s,a.appendChild(o)}return h&&(t.__proto__=h),((t.prototype=Object.create(h&&h.prototype)).constructor=t).prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},t.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fit(e)},t}(Is),Rc=function(t){this.source_=t};Rc.prototype.getType=function(){},Rc.prototype.getSource=function(){return this.source_},Rc.prototype.isAnimated=v;var Ic=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getType=function(){return 35632},t}(Rc),Lc=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getType=function(){return 35633},t}(Rc),bc=new Ic("precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n"),Pc=new Lc("varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n"),Fc=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_fillColor=t.getUniformLocation(e,"u_fillColor"),this.u_strokeColor=t.getUniformLocation(e,"u_strokeColor"),this.u_size=t.getUniformLocation(e,"u_size"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_instruction=t.getAttribLocation(e,"a_instruction"),this.a_radius=t.getAttribLocation(e,"a_radius")};function Mc(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var Oc=function(i){function t(t,e){i.call(this),this.tolerance=t,this.maxExtent=e,this.origin=ot(e),this.projectionMatrix_=[1,0,0,1,0,0],this.offsetRotateMatrix_=[1,0,0,1,0,0],this.offsetScaleMatrix_=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getDeleteResourcesFunction=function(t){},t.prototype.finish=function(t){},t.prototype.setUpProgram=function(t,e,i,r){},t.prototype.shutDownProgram=function(t,e){},t.prototype.drawReplay=function(t,e,i,r){},t.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){},t.prototype.drawHitDetectionReplay=function(t,e,i,r,n,o){return n?this.drawHitDetectionReplayOneByOne(t,e,i,r,o):this.drawHitDetectionReplayAll(t,e,i,r)},t.prototype.drawHitDetectionReplayAll=function(t,e,i,r){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,e,i,!0);var n=r(null);return n||void 0},t.prototype.replay=function(t,e,i,r,n,o,s,a,h,l,u){var c,p,d,f,_,g,y,v,m=t.getGL();this.lineStringReplay&&(c=m.isEnabled(m.STENCIL_TEST),p=m.getParameter(m.STENCIL_FUNC),d=m.getParameter(m.STENCIL_VALUE_MASK),f=m.getParameter(m.STENCIL_REF),_=m.getParameter(m.STENCIL_WRITEMASK),g=m.getParameter(m.STENCIL_FAIL),y=m.getParameter(m.STENCIL_PASS_DEPTH_PASS),v=m.getParameter(m.STENCIL_PASS_DEPTH_FAIL),m.enable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilMask(255),m.stencilFunc(m.ALWAYS,1,255),m.stencilOp(m.KEEP,m.KEEP,m.REPLACE),this.lineStringReplay.replay(t,e,i,r,n,o,s,a,h,l,u),m.stencilMask(0),m.stencilFunc(m.NOTEQUAL,1,255)),t.bindBuffer(ze,this.verticesBuffer),t.bindBuffer(34963,this.indicesBuffer);var x=this.setUpProgram(m,t,n,o),S=ge(this.projectionMatrix_);Ce(S,2/(i*n[0]),2/(i*n[1])),Se(S,-r),Ee(S,-(e[0]-this.origin[0]),-(e[1]-this.origin[1]));var C=ge(this.offsetScaleMatrix_);Ce(C,2/n[0],2/n[1]);var E,T=ge(this.offsetRotateMatrix_);return 0!==r&&Se(T,-r),m.uniformMatrix4fv(x.u_projectionMatrix,!1,Mc(this.tmpMat4_,S)),m.uniformMatrix4fv(x.u_offsetScaleMatrix,!1,Mc(this.tmpMat4_,C)),m.uniformMatrix4fv(x.u_offsetRotateMatrix,!1,Mc(this.tmpMat4_,T)),m.uniform1f(x.u_opacity,s),void 0===h?this.drawReplay(m,t,a,!1):E=this.drawHitDetectionReplay(m,t,a,h,l,u),this.shutDownProgram(m,x),this.lineStringReplay&&(c||m.disable(m.STENCIL_TEST),m.clear(m.STENCIL_BUFFER_BIT),m.stencilFunc(p,f,d),m.stencilMask(_),m.stencilOp(g,v,y)),E},t.prototype.drawElements=function(t,e,i,r){var n=e.hasOESElementIndexUint?5125:5123,o=r-i,s=i*(e.hasOESElementIndexUint?4:2);t.drawElements(4,o,n,s)},t}(Fl),Nc=[0,0,0,1],Ac=[],Gc=[0,0,0,1],kc=Number.EPSILON||2220446049250313e-31,Dc=function(t,e,i,r,n,o){var s=(i-t)*(o-e)-(n-t)*(r-e);return s<=kc&&-kc<=s?void 0:0<s},jc=35044,Uc=function(t,e){this.arr_=void 0!==t?t:[],this.usage_=void 0!==e?e:jc};Uc.prototype.getArray=function(){return this.arr_},Uc.prototype.getUsage=function(){return this.usage_};var Yc=function(i){function t(t,e){i.call(this,t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.drawCoordinates_=function(t,e,i,r){var n,o,s=this,a=this.vertices.length,h=this.indices.length,l=a/4;for(n=e,o=i;n<o;n+=r)s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=0,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=1,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=2,s.vertices[a++]=s.radius_,s.vertices[a++]=t[n],s.vertices[a++]=t[n+1],s.vertices[a++]=3,s.vertices[a++]=s.radius_,s.indices[h++]=l,s.indices[h++]=l+1,s.indices[h++]=l+2,s.indices[h++]=l+2,s.indices[h++]=l+3,s.indices[h++]=l,l+=4},t.prototype.drawCircle=function(t,e){var i=t.getRadius(),r=t.getStride();if(i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=i;var n=t.getFlatCoordinates();n=_t(n,0,2,r,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,r)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var o=this.styles_[this.styles_.length-1];this.state_.fillColor=o[0],this.state_.strokeColor=o[1],this.state_.lineWidth=o[2],this.state_.changed=!1}},t.prototype.finish=function(t){this.verticesBuffer=new Uc(this.vertices),this.indicesBuffer=new Uc(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},t.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},t.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(bc,Pc);return this.defaultLocations_?n=this.defaultLocations_:(n=new Fc(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ve,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,Ve,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,Ve,!1,16,12),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},t.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_instruction),t.disableVertexAttribArray(e.a_radius)},t.prototype.drawReplay=function(t,e,i,r){var n,o,s,a;if(Tt(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a[0]),this.setStrokeStyle_(t,a[1],a[2]),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i)},t.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setFillStyle_(t,h[0]),this.setStrokeStyle_(t,h[1],h[2]),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[Et(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||wt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},t.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setFillStyle_(t,s[0]),this.setStrokeStyle_(t,s[1],s[2]),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[Et(this.startIndicesFeature[h]).toString()]&&(n!==o&&this.drawElements(t,e,n,o),o=l),h--,n=l;n!==o&&this.drawElements(t,e,n,o),n=o=a}},t.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_fillColor,e)},t.prototype.setStrokeStyle_=function(t,e,i){t.uniform4fv(this.defaultLocations_.u_strokeColor,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i)},t.prototype.setFillStrokeStyle=function(t,e){var i,r;if(e){var n=e.getLineDash();this.state_.lineDash=n||Ac;var o=e.getLineDashOffset();this.state_.lineDashOffset=o||0,i=(i=e.getColor())instanceof CanvasGradient||i instanceof CanvasPattern?Gc:Ne(i).map(function(t,e){return 3!=e?t/255:t})||Gc,r=void 0!==(r=e.getWidth())?r:1}else i=[0,0,0,0],r=0;var s=t?t.getColor():[0,0,0,0];s=s instanceof CanvasGradient||s instanceof CanvasPattern?Nc:Ne(s).map(function(t,e){return 3!=e?t/255:t})||Nc,this.state_.strokeColor&&fr(this.state_.strokeColor,i)&&this.state_.fillColor&&fr(this.state_.fillColor,s)&&this.state_.lineWidth===r||(this.state_.changed=!0,this.state_.fillColor=s,this.state_.strokeColor=i,this.state_.lineWidth=r,this.styles_.push([s,i,r]))},t}(Oc),Bc=new Ic("precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),Xc=new Lc("varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n"),zc=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_image=t.getUniformLocation(e,"u_image"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord"),this.a_offsets=t.getAttribLocation(e,"a_offsets"),this.a_opacity=t.getAttribLocation(e,"a_opacity"),this.a_rotateWithView=t.getAttribLocation(e,"a_rotateWithView")},Vc="webglcontextlost",Wc="webglcontextrestored",Kc=function(i){function t(t,e){i.call(this),this.canvas_=t,this.gl_=e,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=lr(Xe,"OES_element_index_uint"),this.hasOESElementIndexUint&&e.getExtension("OES_element_index_uint"),E(this.canvas_,Vc,this.handleWebGLContextLost,this),E(this.canvas_,Wc,this.handleWebGLContextRestored,this)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.bindBuffer=function(t,e){var i=this.getGL(),r=e.getArray(),n=String(Et(e));if(n in this.bufferCache_){var o=this.bufferCache_[n];i.bindBuffer(t,o.buffer)}else{var s,a=i.createBuffer();i.bindBuffer(t,a),t==ze?s=new Float32Array(r):34963==t&&(s=this.hasOESElementIndexUint?new Uint32Array(r):new Uint16Array(r)),i.bufferData(t,s,e.getUsage()),this.bufferCache_[n]={buf:e,buffer:a}}},t.prototype.deleteBuffer=function(t){var e=this.getGL(),i=String(Et(t)),r=this.bufferCache_[i];e.isContextLost()||e.deleteBuffer(r.buffer),delete this.bufferCache_[i]},t.prototype.disposeInternal=function(){f(this.canvas_);var t=this.getGL();if(!t.isContextLost()){for(var e in this.bufferCache_)t.deleteBuffer(this.bufferCache_[e].buffer);for(var i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(var r in this.shaderCache_)t.deleteShader(this.shaderCache_[r]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},t.prototype.getCanvas=function(){return this.canvas_},t.prototype.getGL=function(){return this.gl_},t.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},t.prototype.getShader=function(t){var e=String(Et(t));if(e in this.shaderCache_)return this.shaderCache_[e];var i=this.getGL(),r=i.createShader(t.getType());return i.shaderSource(r,t.getSource()),i.compileShader(r),this.shaderCache_[e]=r},t.prototype.getProgram=function(t,e){var i=Et(t)+"/"+Et(e);if(i in this.programCache_)return this.programCache_[i];var r=this.getGL(),n=r.createProgram();return r.attachShader(n,this.getShader(t)),r.attachShader(n,this.getShader(e)),r.linkProgram(n),this.programCache_[i]=n},t.prototype.handleWebGLContextLost=function(){_(this.bufferCache_),_(this.shaderCache_),_(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},t.prototype.handleWebGLContextRestored=function(){},t.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var i=Zc(t,1,1),r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,r),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=e,this.hitDetectionTexture_=i,this.hitDetectionRenderbuffer_=r},t.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},t}(t);function Hc(t,e,i){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==e&&t.texParameteri(He,We,e),void 0!==i&&t.texParameteri(He,Ke,i),r}function Zc(t,e,i,r,n){var o=Hc(t,r,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),o}function qc(t,e,i,r){var n=Hc(t,i,r);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),n}var Jc=function(i){function t(t,e){i.call(this,t,e),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getDeleteResourcesFunction=function(i){var r=this.verticesBuffer,n=this.indicesBuffer,o=this.getTextures(!0),s=i.getGL();return function(){var t,e;if(!s.isContextLost())for(t=0,e=o.length;t<e;++t)s.deleteTexture(o[t]);i.deleteBuffer(r),i.deleteBuffer(n)}},t.prototype.drawCoordinates=function(t,e,i,r){var n,o,s,a,h,l,u=this,c=this.anchorX,p=this.anchorY,d=this.height,f=this.imageHeight,_=this.imageWidth,g=this.opacity,y=this.originX,v=this.originY,m=this.rotateWithView?1:0,x=-this.rotation,S=this.scale,C=this.width,E=Math.cos(x),T=Math.sin(x),w=this.indices.length,R=this.vertices.length;for(n=e;n<i;n+=r)h=t[n]-u.origin[0],l=t[n+1]-u.origin[1],o=R/8,s=-S*c,a=-S*(d-p),u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*E-a*T,u.vertices[R++]=s*T+a*E,u.vertices[R++]=y/_,u.vertices[R++]=(v+d)/f,u.vertices[R++]=g,u.vertices[R++]=m,s=S*(C-c),a=-S*(d-p),u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*E-a*T,u.vertices[R++]=s*T+a*E,u.vertices[R++]=(y+C)/_,u.vertices[R++]=(v+d)/f,u.vertices[R++]=g,u.vertices[R++]=m,s=S*(C-c),a=S*p,u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*E-a*T,u.vertices[R++]=s*T+a*E,u.vertices[R++]=(y+C)/_,u.vertices[R++]=v/f,u.vertices[R++]=g,u.vertices[R++]=m,s=-S*c,a=S*p,u.vertices[R++]=h,u.vertices[R++]=l,u.vertices[R++]=s*E-a*T,u.vertices[R++]=s*T+a*E,u.vertices[R++]=y/_,u.vertices[R++]=v/f,u.vertices[R++]=g,u.vertices[R++]=m,u.indices[w++]=o,u.indices[w++]=o+1,u.indices[w++]=o+2,u.indices[w++]=o,u.indices[w++]=o+2,u.indices[w++]=o+3;return R},t.prototype.createTextures=function(t,e,i,r){var n,o,s,a,h=e.length;for(a=0;a<h;++a)(s=Et(o=e[a]).toString())in i?n=i[s]:(n=qc(r,o,Ze,Ze),i[s]=n),t[a]=n},t.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(Bc,Xc);return this.defaultLocations?n=this.defaultLocations:(n=new zc(t,o),this.defaultLocations=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ve,!1,32,0),t.enableVertexAttribArray(n.a_offsets),t.vertexAttribPointer(n.a_offsets,2,Ve,!1,32,8),t.enableVertexAttribArray(n.a_texCoord),t.vertexAttribPointer(n.a_texCoord,2,Ve,!1,32,16),t.enableVertexAttribArray(n.a_opacity),t.vertexAttribPointer(n.a_opacity,1,Ve,!1,32,24),t.enableVertexAttribArray(n.a_rotateWithView),t.vertexAttribPointer(n.a_rotateWithView,1,Ve,!1,32,28),n},t.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_offsets),t.disableVertexAttribArray(e.a_texCoord),t.disableVertexAttribArray(e.a_opacity),t.disableVertexAttribArray(e.a_rotateWithView)},t.prototype.drawReplay=function(t,e,i,r){var n,o,s,a=r?this.getHitDetectionTextures():this.getTextures(),h=r?this.hitDetectionGroupIndices:this.groupIndices;if(Tt(i))for(n=0,o=a.length,s=0;n<o;++n){t.bindTexture(He,a[n]);var l=h[n];this.drawElements(t,e,s,l),s=l}else this.drawReplaySkipping(t,e,i,a,h)},t.prototype.drawReplaySkipping=function(t,e,i,r,n){var o,s,a=0;for(o=0,s=r.length;o<s;++o){t.bindTexture(He,r[o]);for(var h=0<o?n[o-1]:0,l=n[o],u=h,c=h;a<this.startIndices.length&&this.startIndices[a]<=l;){void 0!==i[Et(this.startIndicesFeature[a]).toString()]?(u!==c&&this.drawElements(t,e,u,c),c=u=a===this.startIndices.length-1?l:this.startIndices[a+1]):c=a===this.startIndices.length-1?l:this.startIndices[a+1],a++}u!==c&&this.drawElements(t,e,u,c)}},t.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u=this.startIndices.length-1,c=this.getHitDetectionTextures();for(o=c.length-1;0<=o;--o)for(t.bindTexture(He,c[o]),s=0<o?this.hitDetectionGroupIndices[o-1]:0,h=this.hitDetectionGroupIndices[o];0<=u&&this.startIndices[u]>=s;){if(a=this.startIndices[u],void 0===i[Et(l=this.startIndicesFeature[u]).toString()]&&l.getGeometry()&&(void 0===n||wt(n,l.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,a,h);var p=r(l);if(p)return p}h=a,u--}},t.prototype.finish=function(t){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},t.prototype.getTextures=function(t){},t.prototype.getHitDetectionTextures=function(){},t}(Oc),Qc=function(n){function t(t,e){n.call(this,t,e),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.drawMultiPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},t.prototype.drawPoint=function(t,e){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var i=t.getFlatCoordinates(),r=t.getStride();this.drawCoordinates(i,0,i.length,r)},t.prototype.finish=function(t){var e=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Uc(this.vertices);var i=this.indices;this.indicesBuffer=new Uc(i);var r={};this.createTextures(this.textures_,this.images_,r,e),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,r,e),this.images_=null,this.hitDetectionImages_=null,n.prototype.finish.call(this,t)},t.prototype.setImageStyle=function(t){var e=t.getAnchor(),i=t.getImage(1),r=t.getImageSize(),n=t.getHitDetectionImage(1),o=t.getOpacity(),s=t.getOrigin(),a=t.getRotateWithView(),h=t.getRotation(),l=t.getSize(),u=t.getScale();0===this.images_.length?this.images_.push(i):Et(this.images_[this.images_.length-1])!=Et(i)&&(this.groupIndices.push(this.indices.length),this.images_.push(i)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):Et(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=Et(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=e[0],this.anchorY=e[1],this.height=l[1],this.imageHeight=r[1],this.imageWidth=r[0],this.opacity=o,this.originX=s[0],this.originY=s[1],this.rotation=h,this.rotateWithView=a,this.scale=u,this.width=l[0]},t.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},t.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_},t}(Jc);function $c(t,e,i,r){var n=i-r;return t[e]===t[n]&&t[e+1]===t[n+1]&&3<(i-e)/r&&!!xr(t,e,i,r)}var tp=new Ic("precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),ep=new Lc("varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n"),ip=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_lineWidth=t.getUniformLocation(e,"u_lineWidth"),this.u_miterLimit=t.getUniformLocation(e,"u_miterLimit"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_size=t.getUniformLocation(e,"u_size"),this.u_pixelRatio=t.getUniformLocation(e,"u_pixelRatio"),this.a_lastPos=t.getAttribLocation(e,"a_lastPos"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_nextPos=t.getAttribLocation(e,"a_nextPos"),this.a_direction=t.getAttribLocation(e,"a_direction")},rp=3,np=5,op=7,sp=11,ap=13,hp=17,lp=19,up=23,cp=function(i){function t(t,e){i.call(this,t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.drawCoordinates_=function(t,e,i,r){var n,o,s,a,h,l,u,c,p=this,d=this.vertices.length,f=this.indices.length,_="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,g="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,y=$c(t,e,i,r),v=f,m=1;for(n=e,o=i;n<o;n+=r){if(h=d/7,l=u,u=c||[t[n],t[n+1]],n===e){if(c=[t[n+r],t[n+r+1]],i-e==2*r&&fr(u,c))break;if(!y){g&&(d=p.addVertices_([0,0],u,c,m*op*g,d),d=p.addVertices_([0,0],u,c,-m*op*g,d),p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=h+1,p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h+2),d=p.addVertices_([0,0],u,c,m*rp*(g||1),d),v=(d=p.addVertices_([0,0],u,c,-m*rp*(g||1),d))/7-1;continue}l=[t[i-2*r],t[i-2*r+1]],s=c}else{if(n===i-r){if(y){c=s;break}l=l||[0,0],d=p.addVertices_(l,u,[0,0],m*np*(g||1),d),d=p.addVertices_(l,u,[0,0],-m*np*(g||1),d),p.indices[f++]=h,p.indices[f++]=v-1,p.indices[f++]=v,p.indices[f++]=v,p.indices[f++]=h+1,p.indices[f++]=h,g&&(d=p.addVertices_(l,u,[0,0],m*sp*g,d),d=p.addVertices_(l,u,[0,0],-m*sp*g,d),p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=h+1,p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h+2);break}c=[t[n+r],t[n+r+1]]}a=Dc(l[0],l[1],u[0],u[1],c[0],c[1])?-1:1,d=p.addVertices_(l,u,c,a*ap*(_||1),d),d=p.addVertices_(l,u,c,a*hp*(_||1),d),d=p.addVertices_(l,u,c,-a*lp*(_||1),d),e<n&&(p.indices[f++]=h,p.indices[f++]=v-1,p.indices[f++]=v,p.indices[f++]=h+2,p.indices[f++]=h,p.indices[f++]=0<m*a?v:v-1),p.indices[f++]=h,p.indices[f++]=h+2,p.indices[f++]=h+1,v=h+2,m=a,_&&(d=p.addVertices_(l,u,c,a*up*_,d),p.indices[f++]=h+1,p.indices[f++]=h+3,p.indices[f++]=h)}y&&(h=h||d/7,a=Hr([l[0],l[1],u[0],u[1],c[0],c[1]],0,6,2)?1:-1,d=this.addVertices_(l,u,c,a*ap*(_||1),d),d=this.addVertices_(l,u,c,-a*lp*(_||1),d),this.indices[f++]=h,this.indices[f++]=v-1,this.indices[f++]=v,this.indices[f++]=h+1,this.indices[f++]=h,this.indices[f++]=0<m*a?v:v-1)},t.prototype.addVertices_=function(t,e,i,r,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=e[0],this.vertices[n++]=e[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=r,n},t.prototype.isValid_=function(t,e,i,r){var n=i-e;return!(n<2*r)&&(n!==2*r||!fr([t[e],t[e+1]],[t[e+r],t[e+r+1]]))},t.prototype.drawLineString=function(t,e){var i=t.getFlatCoordinates(),r=t.getStride();this.isValid_(i,0,i.length,r)&&(i=_t(i,0,i.length,r,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.drawCoordinates_(i,0,i.length,r))},t.prototype.drawMultiLineString=function(t,e){var i=this.indices.length,r=t.getEnds();r.unshift(0);var n,o,s=t.getFlatCoordinates(),a=t.getStride();if(1<r.length)for(n=1,o=r.length;n<o;++n)if(this.isValid_(s,r[n-1],r[n],a)){var h=_t(s,r[n-1],r[n],a,-this.origin[0],-this.origin[1]);this.drawCoordinates_(h,0,h.length,a)}this.indices.length>i&&(this.startIndices.push(i),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1))},t.prototype.drawPolygonCoordinates=function(t,e,i){var r,n;if($c(t,0,t.length,i)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,i),e.length)for(r=0,n=e.length;r<n;++r)$c(e[r],0,e[r].length,i)||(e[r].push(e[r][0]),e[r].push(e[r][1])),this.drawCoordinates_(e[r],0,e[r].length,i)},t.prototype.setPolygonStyle=function(t,e){var i=void 0===e?this.indices.length:e;this.startIndices.push(i),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(i),this.state_.changed=!1)},t.prototype.getCurrentIndex=function(){return this.indices.length},t.prototype.finish=function(t){this.verticesBuffer=new Uc(this.vertices),this.indicesBuffer=new Uc(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},t.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer;return function(){t.deleteBuffer(e),t.deleteBuffer(i)}},t.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(tp,ep);return this.defaultLocations_?n=this.defaultLocations_:(n=new ip(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,Ve,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ve,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,Ve,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,Ve,!1,28,24),t.uniform2fv(n.u_size,i),t.uniform1f(n.u_pixelRatio,r),n},t.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_lastPos),t.disableVertexAttribArray(e.a_position),t.disableVertexAttribArray(e.a_nextPos),t.disableVertexAttribArray(e.a_direction)},t.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Tt(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setStrokeStyle_(t,a[0],a[1],a[2]),this.drawElements(t,e,o,s),t.clear(t.DEPTH_BUFFER_BIT),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},t.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setStrokeStyle_(t,s[0],s[1],s[2]),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[Et(this.startIndicesFeature[h]).toString()]&&(n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),o=l),h--,n=l;n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),n=o=a}},t.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setStrokeStyle_(t,h[0],h[1],h[2]),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[Et(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||wt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},t.prototype.setStrokeStyle_=function(t,e,i,r){t.uniform4fv(this.defaultLocations_.u_color,e),t.uniform1f(this.defaultLocations_.u_lineWidth,i),t.uniform1f(this.defaultLocations_.u_miterLimit,r)},t.prototype.setFillStrokeStyle=function(t,e){var i=e.getLineCap();this.state_.lineCap=void 0!==i?i:"round";var r=e.getLineDash();this.state_.lineDash=r||Ac;var n=e.getLineDashOffset();this.state_.lineDashOffset=n||0;var o=e.getLineJoin();this.state_.lineJoin=void 0!==o?o:"round";var s=e.getColor();s=s instanceof CanvasGradient||s instanceof CanvasPattern?Gc:Ne(s).map(function(t,e){return 3!=e?t/255:t})||Gc;var a=e.getWidth();a=void 0!==a?a:1;var h=e.getMiterLimit();h=void 0!==h?h:10,this.state_.strokeColor&&fr(this.state_.strokeColor,s)&&this.state_.lineWidth===a&&this.state_.miterLimit===h||(this.state_.changed=!0,this.state_.strokeColor=s,this.state_.lineWidth=a,this.state_.miterLimit=h,this.styles_.push([s,a,h]))},t}(Oc),pp=new Ic("precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),dp=new Lc("\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n"),fp=function(t,e){this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_offsetScaleMatrix=t.getUniformLocation(e,"u_offsetScaleMatrix"),this.u_offsetRotateMatrix=t.getUniformLocation(e,"u_offsetRotateMatrix"),this.u_color=t.getUniformLocation(e,"u_color"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.a_position=t.getAttribLocation(e,"a_position")},_p=function(t){this.first_,this.last_,this.head_,this.circular_=void 0===t||t,this.length_=0};_p.prototype.insertItem=function(t){var e={prev:void 0,next:void 0,data:t},i=this.head_;if(i){var r=i.next;e.prev=i,e.next=r,i.next=e,r&&(r.prev=e),i===this.last_&&(this.last_=e)}else this.first_=e,this.last_=e,this.circular_&&((e.next=e).prev=e);this.head_=e,this.length_++},_p.prototype.removeItem=function(){var t=this.head_;if(t){var e=t.next,i=t.prev;e&&(e.prev=i),i&&(i.next=e),this.head_=e||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=i?this.head_.prev:this.head_),this.length_--}},_p.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},_p.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},_p.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},_p.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},_p.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},_p.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},_p.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},_p.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},_p.prototype.concat=function(t){if(t.head_){if(this.head_){var e=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,e.prev=t.last_,t.last_.next=e,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},_p.prototype.getLength=function(){return this.length_};var gp=function(i){function t(t,e){i.call(this,t,e),this.lineStringReplay=new cp(t,e),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.drawCoordinates_=function(t,e,i){var r=new _p,n=new Gh;this.processFlatCoordinates_(t,i,r,n,!0);var o=this.getMaxCoords_(r);if(e.length){var s,a,h=[];for(s=0,a=e.length;s<a;++s){var l={list:new _p,maxCoords:void 0,rtree:new Gh};h.push(l),this.processFlatCoordinates_(e[s],i,l.list,l.rtree,!1),this.classifyPoints_(l.list,l.rtree,!0),l.maxCoords=this.getMaxCoords_(l.list)}for(h.sort(function(t,e){return e.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-e.maxCoords[1]:e.maxCoords[0]-t.maxCoords[0]}),s=0;s<h.length;++s){var u=h[s].list,c=u.firstItem(),p=c,d=void 0;do{if(this.getIntersections_(p,n).length){d=!0;break}p=u.nextItem()}while(c!==p);d||this.bridgeHole_(u,h[s].maxCoords[0],r,o[0],n)&&(n.concat(h[s].rtree),this.classifyPoints_(r,n,!1))}}else this.classifyPoints_(r,n,!1);this.triangulate_(r,n)},t.prototype.processFlatCoordinates_=function(t,e,i,r,n){var o,s,a,h,l,u=Hr(t,0,t.length,e),c=this.vertices.length/2,p=[],d=[];if(n===u){for(h=a=this.createPoint_(t[0],t[1],c++),o=e,s=t.length;o<s;o+=e)l=this.createPoint_(t[o],t[o+1],c++),d.push(this.insertItem_(h,l,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}else{var f=t.length-e;for(h=a=this.createPoint_(t[f],t[f+1],c++),o=f-e,s=0;s<=o;o-=e)l=this.createPoint_(t[o],t[o+1],c++),d.push(this.insertItem_(h,l,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)]),h=l;d.push(this.insertItem_(l,a,i)),p.push([Math.min(h.x,l.x),Math.min(h.y,l.y),Math.max(h.x,l.x),Math.max(h.y,l.y)])}r.load(p,d)},t.prototype.getMaxCoords_=function(t){for(var e=t.firstItem(),i=e,r=[i.p0.x,i.p0.y];(i=t.nextItem()).p0.x>r[0]&&(r=[i.p0.x,i.p0.y]),i!==e;);return r},t.prototype.classifyPoints_=function(t,e,i){var r=t.firstItem(),n=r,o=t.nextItem(),s=!1;do{var a=i?Dc(o.p1.x,o.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Dc(n.p0.x,n.p0.y,n.p1.x,n.p1.y,o.p1.x,o.p1.y);void 0===a?(this.removeItem_(n,o,t,e),s=!0,o===r&&(r=t.getNextItem()),o=n,t.prevItem()):n.p1.reflex!==a&&(n.p1.reflex=a,s=!0),n=o,o=t.nextItem()}while(n!==r);return s},t.prototype.bridgeHole_=function(t,e,i,r,n){for(var o=t.firstItem();o.p1.x!==e;)o=t.nextItem();var s,a,h,l,u=o.p1,c={x:r,y:u.y,i:-1},p=1/0,d=this.getIntersections_({p0:u,p1:c},n,!0);for(s=0,a=d.length;s<a;++s){var f=d[s],_=this.calculateIntersection_(u,c,f.p0,f.p1,!0),g=Math.abs(u.x-_[0]);g<p&&void 0!==Dc(u.x,u.y,f.p0.x,f.p0.y,f.p1.x,f.p1.y)&&(p=g,l={x:_[0],y:_[1],i:-1},o=f)}if(p===1/0)return!1;if(h=o.p1,0<p){var y=this.getPointsInTriangle_(u,l,o.p1,n);if(y.length){var v=1/0;for(s=0,a=y.length;s<a;++s){var m=y[s],x=Math.atan2(u.y-m.y,c.x-m.x);(x<v||x===v&&m.x<h.x)&&(v=x,h=m)}}}for(o=i.firstItem();o.p1.x!==h.x||o.p1.y!==h.y;)o=i.nextItem();var S={x:u.x,y:u.y,i:u.i,reflex:void 0},C={x:o.p1.x,y:o.p1.y,i:o.p1.i,reflex:void 0};return t.getNextItem().p0=S,this.insertItem_(u,o.p1,t,n),this.insertItem_(C,S,t,n),o.p1=C,t.setFirstItem(),i.concat(t),!0},t.prototype.triangulate_=function(t,e){for(var i=this,r=!1,n=this.isSimple_(t,e);3<t.getLength();)if(n){if(!i.clipEars_(t,e,n,r)&&!i.classifyPoints_(t,e,r)&&!i.resolveSelfIntersections_(t,e,!0))break}else if(!i.clipEars_(t,e,n,r)&&!i.classifyPoints_(t,e,r)&&!i.resolveSelfIntersections_(t,e)){if(!(n=i.isSimple_(t,e))){i.splitPolygon_(t,e);break}r=!i.isClockwise_(t),i.classifyPoints_(t,e,r)}if(3===t.getLength()){var o=this.indices.length;this.indices[o++]=t.getPrevItem().p0.i,this.indices[o++]=t.getCurrItem().p0.i,this.indices[o++]=t.getNextItem().p0.i}},t.prototype.clipEars_=function(t,e,i,r){var n,o,s,a=this.indices.length,h=t.firstItem(),l=t.getPrevItem(),u=h,c=t.nextItem(),p=t.getNextItem(),d=!1;do{if(n=u.p0,o=u.p1,s=c.p1,!1===o.reflex){var f=void 0;f=i?0===this.getPointsInTriangle_(n,o,s,e,!0).length:r?this.diagonalIsInside_(p.p1,s,o,n,l.p0):this.diagonalIsInside_(l.p0,n,o,s,p.p1),(i||0===this.getIntersections_({p0:n,p1:s},e).length)&&f&&(i||!1===n.reflex||!1===s.reflex||Hr([l.p0.x,l.p0.y,n.x,n.y,o.x,o.y,s.x,s.y,p.p1.x,p.p1.y],0,10,2)===!r)&&(this.indices[a++]=n.i,this.indices[a++]=o.i,this.indices[a++]=s.i,this.removeItem_(u,c,t,e),c===h&&(h=p),d=!0)}l=t.getPrevItem(),u=t.getCurrItem(),c=t.nextItem(),p=t.getNextItem()}while(u!==h&&3<t.getLength());return d},t.prototype.resolveSelfIntersections_=function(t,e,i){var r=t.firstItem();t.nextItem();var n=r,o=t.nextItem(),s=!1;do{var a=this.calculateIntersection_(n.p0,n.p1,o.p0,o.p1,i);if(a){var h=!1,l=this.vertices.length,u=this.indices.length,c=l/2,p=t.prevItem();t.removeItem(),e.remove(p),h=p===r;var d=void 0;if(i?(a[0]===n.p0.x&&a[1]===n.p0.y?(t.prevItem(),d=n.p0,o.p0=d,e.remove(n),h=h||n===r):(d=o.p1,n.p1=d,e.remove(o),h=h||o===r),t.removeItem()):(d=this.createPoint_(a[0],a[1],c),n.p1=d,o.p0=d,e.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),e.update([Math.min(o.p0.x,o.p1.x),Math.min(o.p0.y,o.p1.y),Math.max(o.p0.x,o.p1.x),Math.max(o.p0.y,o.p1.y)],o)),this.indices[u++]=p.p0.i,this.indices[u++]=p.p1.i,this.indices[u++]=d.i,s=!0,h)break}n=t.getPrevItem(),o=t.nextItem()}while(n!==r);return s},t.prototype.isSimple_=function(t,e){var i=t.firstItem(),r=i;do{if(this.getIntersections_(r,e).length)return!1;r=t.nextItem()}while(r!==i);return!0},t.prototype.isClockwise_=function(t){for(var e=2*t.getLength(),i=new Array(e),r=t.firstItem(),n=r,o=0;i[o++]=n.p0.x,i[o++]=n.p0.y,(n=t.nextItem())!==r;);return Hr(i,0,e,2)},t.prototype.splitPolygon_=function(t,e){var i=this,r=t.firstItem(),n=r;do{var o=i.getIntersections_(n,e);if(o.length){var s=o[0],a=i.vertices.length/2,h=i.calculateIntersection_(n.p0,n.p1,s.p0,s.p1),l=i.createPoint_(h[0],h[1],a),u=new _p,c=new Gh;i.insertItem_(l,n.p1,u,c),n.p1=l,e.update([Math.min(n.p0.x,l.x),Math.min(n.p0.y,l.y),Math.max(n.p0.x,l.x),Math.max(n.p0.y,l.y)],n);for(var p=t.nextItem();p!==s;)i.insertItem_(p.p0,p.p1,u,c),e.remove(p),t.removeItem(),p=t.getCurrItem();i.insertItem_(s.p0,l,u,c),s.p0=l,e.update([Math.min(s.p1.x,l.x),Math.min(s.p1.y,l.y),Math.max(s.p1.x,l.x),Math.max(s.p1.y,l.y)],s),i.classifyPoints_(t,e,!1),i.triangulate_(t,e),i.classifyPoints_(u,c,!1),i.triangulate_(u,c);break}n=t.nextItem()}while(n!==r)},t.prototype.createPoint_=function(t,e,i){var r=this.vertices.length;return{x:this.vertices[r++]=t,y:this.vertices[r++]=e,i:i,reflex:void 0}},t.prototype.insertItem_=function(t,e,i,r){var n={p0:t,p1:e};return i.insertItem(n),r&&r.insert([Math.min(t.x,e.x),Math.min(t.y,e.y),Math.max(t.x,e.x),Math.max(t.y,e.y)],n),n},t.prototype.removeItem_=function(t,e,i,r){i.getCurrItem()===e&&(i.removeItem(),t.p1=e.p1,r.remove(e),r.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},t.prototype.getPointsInTriangle_=function(t,e,i,r,n){for(var o=[],s=r.getInExtent([Math.min(t.x,e.x,i.x),Math.min(t.y,e.y,i.y),Math.max(t.x,e.x,i.x),Math.max(t.y,e.y,i.y)]),a=0,h=s.length;a<h;++a)for(var l in s[a]){var u=s[a][l];"object"!=typeof u||n&&!u.reflex||u.x===t.x&&u.y===t.y||u.x===e.x&&u.y===e.y||u.x===i.x&&u.y===i.y||-1!==o.indexOf(u)||!Ur([t.x,t.y,e.x,e.y,i.x,i.y],0,6,2,u.x,u.y)||o.push(u)}return o},t.prototype.getIntersections_=function(t,e,i){for(var r=t.p0,n=t.p1,o=e.getInExtent([Math.min(r.x,n.x),Math.min(r.y,n.y),Math.max(r.x,n.x),Math.max(r.y,n.y)]),s=[],a=0,h=o.length;a<h;++a){var l=o[a];t!==l&&(i||l.p0!==n||l.p1!==r)&&this.calculateIntersection_(r,n,l.p0,l.p1,i)&&s.push(l)}return s},t.prototype.calculateIntersection_=function(t,e,i,r,n){var o=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==o){var s=((r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x))/o,a=((e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x))/o;if(!n&&kc<s&&s<1-kc&&kc<a&&a<1-kc||n&&0<=s&&s<=1&&0<=a&&a<=1)return[t.x+s*(e.x-t.x),t.y+s*(e.y-t.y)]}},t.prototype.diagonalIsInside_=function(t,e,i,r,n){if(void 0===e.reflex||void 0===r.reflex)return!1;var o=(i.x-r.x)*(e.y-r.y)>(i.y-r.y)*(e.x-r.x),s=(n.x-r.x)*(e.y-r.y)<(n.y-r.y)*(e.x-r.x),a=(t.x-e.x)*(r.y-e.y)>(t.y-e.y)*(r.x-e.x),h=(i.x-e.x)*(r.y-e.y)<(i.y-e.y)*(r.x-e.x),l=r.reflex?s||o:s&&o,u=e.reflex?h||a:h&&a;return l&&u},t.prototype.drawMultiPolygon=function(t,e){var i,r,n,o,s=t.getEndss(),a=t.getStride(),h=this.indices.length,l=this.lineStringReplay.getCurrentIndex(),u=t.getFlatCoordinates(),c=0;for(i=0,r=s.length;i<r;++i){var p=s[i];if(0<p.length){var d=_t(u,c,p[0],a,-this.origin[0],-this.origin[1]);if(d.length){var f=[],_=void 0;for(n=1,o=p.length;n<o;++n)p[n]!==p[n-1]&&(_=_t(u,p[n-1],p[n],a,-this.origin[0],-this.origin[1]),f.push(_));this.lineStringReplay.drawPolygonCoordinates(d,f,a),this.drawCoordinates_(d,f,a)}}c=p[p.length-1]}this.indices.length>h&&(this.startIndices.push(h),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(h),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>l&&this.lineStringReplay.setPolygonStyle(e,l)},t.prototype.drawPolygon=function(t,e){var i=t.getEnds(),r=t.getStride();if(0<i.length){var n=t.getFlatCoordinates().map(Number),o=_t(n,0,i[0],r,-this.origin[0],-this.origin[1]);if(o.length){var s,a,h,l=[];for(s=1,a=i.length;s<a;++s)i[s]!==i[s-1]&&(h=_t(n,i[s-1],i[s],r,-this.origin[0],-this.origin[1]),l.push(h));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(e),this.lineStringReplay.drawPolygonCoordinates(o,l,r),this.drawCoordinates_(o,l,r)}}},t.prototype.finish=function(t){this.verticesBuffer=new Uc(this.vertices),this.indicesBuffer=new Uc(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&0<this.styles_.length&&(this.styles_=[]),this.vertices=null,this.indices=null},t.prototype.getDeleteResourcesFunction=function(t){var e=this.verticesBuffer,i=this.indicesBuffer,r=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(e),t.deleteBuffer(i),r()}},t.prototype.setUpProgram=function(t,e,i,r){var n,o=e.getProgram(pp,dp);return this.defaultLocations_?n=this.defaultLocations_:(n=new fp(t,o),this.defaultLocations_=n),e.useProgram(o),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Ve,!1,8,0),n},t.prototype.shutDownProgram=function(t,e){t.disableVertexAttribArray(e.a_position)},t.prototype.drawReplay=function(t,e,i,r){var n,o,s,a,h=t.getParameter(t.DEPTH_FUNC),l=t.getParameter(t.DEPTH_WRITEMASK);if(r||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Tt(i))for(s=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;0<=n;--n)o=this.styleIndices_[n],a=this.styles_[n],this.setFillStyle_(t,a),this.drawElements(t,e,o,s),s=o;else this.drawReplaySkipping_(t,e,i);r||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(l),t.depthFunc(h))},t.prototype.drawHitDetectionReplayOneByOne=function(t,e,i,r,n){var o,s,a,h,l,u,c;for(c=this.startIndices.length-2,a=this.startIndices[c+1],o=this.styleIndices_.length-1;0<=o;--o)for(h=this.styles_[o],this.setFillStyle_(t,h),l=this.styleIndices_[o];0<=c&&this.startIndices[c]>=l;){if(s=this.startIndices[c],void 0===i[Et(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||wt(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,e,s,a);var p=r(u);if(p)return p}c--,a=s}},t.prototype.drawReplaySkipping_=function(t,e,i){var r,n,o,s,a,h,l;for(h=this.startIndices.length-2,o=n=this.startIndices[h+1],r=this.styleIndices_.length-1;0<=r;--r){for(s=this.styles_[r],this.setFillStyle_(t,s),a=this.styleIndices_[r];0<=h&&this.startIndices[h]>=a;)l=this.startIndices[h],i[Et(this.startIndicesFeature[h]).toString()]&&(n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),o=l),h--,n=l;n!==o&&(this.drawElements(t,e,n,o),t.clear(t.DEPTH_BUFFER_BIT)),n=o=a}},t.prototype.setFillStyle_=function(t,e){t.uniform4fv(this.defaultLocations_.u_color,e)},t.prototype.setFillStrokeStyle=function(t,e){var i=t?t.getColor():[0,0,0,0];if(i=i instanceof CanvasGradient||i instanceof CanvasPattern?Nc:Ne(i).map(function(t,e){return 3!=e?t/255:t})||Nc,this.state_.fillColor&&fr(i,this.state_.fillColor)||(this.state_.fillColor=i,this.state_.changed=!0,this.styles_.push(i)),e)this.lineStringReplay.setFillStrokeStyle(null,e);else{var r=new Vi({color:[0,0,0,0],lineWidth:0});this.lineStringReplay.setFillStrokeStyle(null,r)}},t}(Oc),yp=function(t,e){this.space_=e,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=De(t,t),this.canvas_=this.context_.canvas};yp.prototype.get=function(t){return this.entries_[t]||null},yp.prototype.add=function(t,e,i,r,n){for(var o=this,s=0,a=this.emptyBlocks_.length;s<a;++s){var h=o.emptyBlocks_[s];if(h.width>=e+o.space_&&h.height>=i+o.space_){var l={offsetX:h.x+o.space_,offsetY:h.y+o.space_,image:o.canvas_};return o.entries_[t]=l,r.call(n,o.context_,h.x+o.space_,h.y+o.space_),o.split_(s,h,e+o.space_,i+o.space_),l}}return null},yp.prototype.split_=function(t,e,i,r){var n,o,s=e.width-i;e.height-r<s?(n={x:e.x+i,y:e.y,width:e.width-i,height:e.height},o={x:e.x,y:e.y+r,width:i,height:e.height-r}):(n={x:e.x+i,y:e.y,width:e.width-i,height:r},o={x:e.x,y:e.y+r,width:e.width,height:e.height-r}),this.updateBlocks_(t,n,o)},yp.prototype.updateBlocks_=function(t,e,i){var r=[t,1];0<e.width&&0<e.height&&r.push(e),0<i.width&&0<i.height&&r.push(i),this.emptyBlocks_.splice.apply(this.emptyBlocks_,r)};var vp=function(t){var e=t||{};this.currentSize_=void 0!==e.initialSize?e.initialSize:256,this.maxSize_=void 0!==e.maxSize?e.maxSize:void 0!==Be?Be:2048,this.space_=void 0!==e.space?e.space:1,this.atlases_=[new yp(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new yp(this.currentHitSize_,this.space_)]};vp.prototype.getInfo=function(t){var e=this.getInfo_(this.atlases_,t);if(!e)return null;var i=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(e,i)},vp.prototype.getInfo_=function(t,e){for(var i=0,r=t.length;i<r;++i){var n=t[i].get(e);if(n)return n}return null},vp.prototype.mergeInfos_=function(t,e){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:e.image}},vp.prototype.add=function(t,e,i,r,n,o){if(e+this.space_>this.maxSize_||i+this.space_>this.maxSize_)return null;var s=this.add_(!1,t,e,i,r,o);if(!s)return null;var a=void 0!==n?n:L,h=this.add_(!0,t,e,i,a,o);return this.mergeInfos_(s,h)},vp.prototype.add_=function(t,e,i,r,n,o){var s,a,h,l,u=t?this.hitAtlases_:this.atlases_;for(h=0,l=u.length;h<l;++h){if(a=(s=u[h]).add(e,i,r,n,o))return a;if(!a&&h===l-1){var c=void 0;t?(c=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=c):(c=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=c),s=new yp(c,this.space_),u.push(s),++l}}return null};var mp=function(i){function t(t,e){i.call(this,t,e),this.images_=[],this.textures_=[],this.measureCanvas_=De(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.drawText=function(t,e){var i=this;if(this.text_){var r=null,n=2,o=2;switch(t.getType()){case Lt.POINT:case Lt.MULTI_POINT:n=(r=t.getFlatCoordinates()).length,o=t.getStride();break;case Lt.CIRCLE:r=t.getCenter();break;case Lt.LINE_STRING:r=t.getFlatMidpoint();break;case Lt.MULTI_LINE_STRING:n=(r=t.getFlatMidpoints()).length;break;case Lt.POLYGON:r=t.getFlatInteriorPoint();break;case Lt.MULTI_POLYGON:n=(r=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(e);var s,a,h,l,u,c,p,d,f=this.currAtlas_,_=this.text_.split("\n"),g=this.getTextSize_(_),y=Math.round(g[0]*this.textAlign_-this.offsetX_),v=Math.round(g[1]*this.textBaseline_-this.offsetY_),m=this.state_.lineWidth/2*this.state_.scale;for(s=0,a=_.length;s<a;++s)for(u=0,c=f.height*s,h=0,l=(p=_[s].split("")).length;h<l;++h){if(d=f.atlas.getInfo(p[h])){var x=d.image;if(i.anchorX=y-u,i.anchorY=v-c,i.originX=0===h?d.offsetX-m:d.offsetX,i.originY=d.offsetY,i.height=f.height,i.width=0===h||h===p.length-1?f.width[p[h]]+m:f.width[p[h]],i.imageHeight=x.height,i.imageWidth=x.width,0===i.images_.length)i.images_.push(x);else Et(i.images_[i.images_.length-1])!=Et(x)&&(i.groupIndices.push(i.indices.length),i.images_.push(x));i.drawText_(r,0,n,o)}u+=i.width}}},t.prototype.getTextSize_=function(t){var o=this,s=this.currAtlas_,e=t.length*s.height;return[t.map(function(t){for(var e=0,i=0,r=t.length;i<r;++i){var n=t[i];s.width[n]||o.addCharToAtlas_(n),e+=s.width[n]?s.width[n]:0}return e}).reduce(function(t,e){return Math.max(t,e)}),e]},t.prototype.drawText_=function(t,e,i,r){for(var n=e,o=i;n<o;n+=r)this.drawCoordinates(t,e,i,r)},t.prototype.addCharToAtlas_=function(r){if(1===r.length){var t=this.currAtlas_,n=this.state_,e=this.measureCanvas_.getContext("2d");e.font=n.font;var i=Math.ceil(e.measureText(r).width*n.scale);t.atlas.add(r,i,t.height,function(t,e,i){t.font=n.font,t.fillStyle=n.fillColor,t.strokeStyle=n.strokeColor,t.lineWidth=n.lineWidth,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.miterLimit=n.miterLimit,t.textAlign="left",t.textBaseline="top",hi&&n.lineDash&&(t.setLineDash(n.lineDash),t.lineDashOffset=n.lineDashOffset),1!==n.scale&&t.setTransform(n.scale,0,0,n.scale,0,0),n.strokeColor&&t.strokeText(r,e,i),n.fillColor&&t.fillText(r,e,i)})&&(t.width[r]=i)}},t.prototype.finish=function(t){var e=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Uc(this.vertices),this.indicesBuffer=new Uc(this.indices);this.createTextures(this.textures_,this.images_,{},e),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,i.prototype.finish.call(this,t)},t.prototype.setTextStyle=function(t){var e=this.state_,i=t.getFill(),r=t.getStroke();if(t&&t.getText()&&(i||r)){if(i){var n=i.getColor();e.fillColor=ke(n||Nc)}else e.fillColor=null;if(r){var o=r.getColor();e.strokeColor=ke(o||Gc),e.lineWidth=r.getWidth()||1,e.lineCap=r.getLineCap()||"round",e.lineDashOffset=r.getLineDashOffset()||0,e.lineJoin=r.getLineJoin()||"round",e.miterLimit=r.getMiterLimit()||10;var s=r.getLineDash();e.lineDash=s?s.slice():Ac}else e.strokeColor=null,e.lineWidth=0;e.font=t.getFont()||"10px sans-serif",e.scale=t.getScale()||1,this.text_=t.getText();var a=_u[t.getTextAlign()],h=_u[t.getTextBaseline()];this.textAlign_=void 0===a?.5:a,this.textBaseline_=void 0===h?.5:h,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(e)}else this.text_=""},t.prototype.getAtlas_=function(t){var e=[];for(var i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?e=e.concat(t[i]):e.push(t[i]));var r=this.calculateHash_(e);if(!this.atlases_[r]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var o=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[r]={atlas:new vp({space:t.lineWidth+1}),width:{},height:o}}return this.atlases_[r]},t.prototype.calculateHash_=function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=t[i];return e},t.prototype.getTextures=function(t){return this.textures_},t.prototype.getHitDetectionTextures=function(){return this.textures_},t}(Jc),xp=[1,1],Sp={Circle:Yc,Image:Qc,LineString:cp,Polygon:gp,Text:mp},Cp=function(r){function t(t,e,i){r.call(this),this.maxExtent_=e,this.tolerance_=t,this.renderBuffer_=i,this.replaysByZIndex_={}}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.addDeclutter=function(t,e){},t.prototype.getDeleteResourcesFunction=function(t){var e,n=[];for(e in this.replaysByZIndex_){var i=this.replaysByZIndex_[e];for(var r in i)n.push(i[r].getDeleteResourcesFunction(t))}return function(){for(var t,e=arguments,i=n.length,r=0;r<i;r++)t=n[r].apply(this,e);return t}},t.prototype.finish=function(t){var e;for(e in this.replaysByZIndex_){var i=this.replaysByZIndex_[e];for(var r in i)i[r].finish(t)}},t.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[e];void 0===n&&(n=new Sp[e](this.tolerance_,this.maxExtent_),r[e]=n);return n},t.prototype.isEmpty=function(){return Tt(this.replaysByZIndex_)},t.prototype.replay=function(t,e,i,r,n,o,s,a){var h,l,u,c,p,d,f=Object.keys(this.replaysByZIndex_).map(Number);for(f.sort(hr),h=0,l=f.length;h<l;++h)for(p=this.replaysByZIndex_[f[h].toString()],u=0,c=fu.length;u<c;++u)d=p[fu[u]],void 0!==d&&d.replay(t,e,i,r,n,o,s,a,void 0,!1)},t.prototype.replayHitDetection_=function(t,e,i,r,n,o,s,a,h,l,u){var c,p,d,f,_,g,y=Object.keys(this.replaysByZIndex_).map(Number);for(y.sort(function(t,e){return e-t}),c=0,p=y.length;c<p;++c)for(f=this.replaysByZIndex_[y[c].toString()],d=fu.length-1;0<=d;--d)if(void 0!==(_=f[fu[d]])&&(g=_.replay(t,e,i,r,n,o,s,a,h,l,u)))return g},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h,l){var u,c=e.getGL();return c.bindFramebuffer(c.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(u=G(V(t),r*this.renderBuffer_)),this.replayHitDetection_(e,t,r,n,xp,s,a,h,function(t){var e=new Uint8Array(4);if(c.readPixels(0,0,1,1,c.RGBA,c.UNSIGNED_BYTE,e),0<e[3]){var i=l(t);if(i)return i}},!0,u)},t.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n,o,s,a,h){var l=e.getGL();return l.bindFramebuffer(l.FRAMEBUFFER,e.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(e,t,r,n,xp,s,a,h,function(t){var e=new Uint8Array(4);return l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,e),0<e[3]},!1)},t}(Hl),Ep=function(a){function t(t,e,i,r,n,o,s){a.call(this),this.context_=t,this.center_=e,this.extent_=o,this.pixelRatio_=s,this.size_=n,this.rotation_=r,this.resolution_=i,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null}return a&&(t.__proto__=a),((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.drawText_=function(t,e){var i=this.context_,r=t.getReplay(0,Zl.TEXT);r.setTextStyle(this.textStyle_),r.drawText(e,null),r.finish(i);r.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),r.getDeleteResourcesFunction(i)()},t.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},t.prototype.drawGeometry=function(t){switch(t.getType()){case Lt.POINT:this.drawPoint(t,null);break;case Lt.LINE_STRING:this.drawLineString(t,null);break;case Lt.POLYGON:this.drawPolygon(t,null);break;case Lt.MULTI_POINT:this.drawMultiPoint(t,null);break;case Lt.MULTI_LINE_STRING:this.drawMultiLineString(t,null);break;case Lt.MULTI_POLYGON:this.drawMultiPolygon(t,null);break;case Lt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t,null);break;case Lt.CIRCLE:this.drawCircle(t,null)}},t.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&wt(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},t.prototype.drawGeometryCollection=function(t,e){var i,r,n=t.getGeometriesArray();for(i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])},t.prototype.drawPoint=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.IMAGE);n.setImageStyle(this.imageStyle_),n.drawPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawMultiPoint=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.IMAGE);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawLineString=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawMultiLineString=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.LINE_STRING);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawPolygon=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawMultiPolygon=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.POLYGON);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.drawCircle=function(t,e){var i=this.context_,r=new Cp(1,this.extent_),n=r.getReplay(0,Zl.CIRCLE);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,e),n.finish(i);n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(i)(),this.textStyle_&&this.drawText_(r,t)},t.prototype.setImageStyle=function(t){this.imageStyle_=t},t.prototype.setFillStrokeStyle=function(t,e){this.fillStyle_=t,this.strokeStyle_=e},t.prototype.setTextStyle=function(t){this.textStyle_=t},t}(Fl),Tp=new Ic("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n"),wp=new Lc("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n"),Rp=function(t,e){this.u_texCoordMatrix=t.getUniformLocation(e,"u_texCoordMatrix"),this.u_projectionMatrix=t.getUniformLocation(e,"u_projectionMatrix"),this.u_opacity=t.getUniformLocation(e,"u_opacity"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},Ip=function(i){function t(t,e){i.call(this,e),this.mapRenderer=t,this.arrayBuffer_=new Uc([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=[1,0,0,1,0,0],this.projectionMatrix=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.defaultLocations_=null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.bindFramebuffer=function(t,e){var i=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=e){var r=function(t,e,i){t.isContextLost()||(t.deleteFramebuffer(e),t.deleteTexture(i))}.bind(null,i,this.framebuffer,this.texture);t.postRenderFunctions.push(r);var n=Zc(i,e,e),o=i.createFramebuffer();i.bindFramebuffer(qe,o),i.framebufferTexture2D(qe,36064,He,n,0),this.texture=n,this.framebuffer=o,this.framebufferDimension=e}else i.bindFramebuffer(qe,this.framebuffer)},t.prototype.composeFrame=function(t,e,i){this.dispatchComposeEvent_(Tn,i,t),i.bindBuffer(ze,this.arrayBuffer_);var r,n=i.getGL(),o=i.getProgram(Tp,wp);this.defaultLocations_?r=this.defaultLocations_:(r=new Rp(n,o),this.defaultLocations_=r),i.useProgram(o)&&(n.enableVertexAttribArray(r.a_position),n.vertexAttribPointer(r.a_position,2,Ve,!1,16,0),n.enableVertexAttribArray(r.a_texCoord),n.vertexAttribPointer(r.a_texCoord,2,Ve,!1,16,8),n.uniform1i(r.u_texture,0)),n.uniformMatrix4fv(r.u_texCoordMatrix,!1,Mc(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(r.u_projectionMatrix,!1,Mc(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(r.u_opacity,e.opacity),n.bindTexture(He,this.getTexture()),n.drawArrays(5,0,4),this.dispatchComposeEvent_(En,i,t)},t.prototype.dispatchComposeEvent_=function(t,e,i){var r=this.getLayer();if(r.hasListener(t)){var n=i.viewState,o=n.resolution,s=i.pixelRatio,a=i.extent,h=n.center,l=n.rotation,u=i.size,c=new Ep(e,h,o,l,u,a,s),p=new Pl(t,c,i,null,e);r.dispatchEvent(p)}},t.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},t.prototype.getTexture=function(){return this.texture},t.prototype.getProjectionMatrix=function(){return this.projectionMatrix},t.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},t.prototype.prepareFrame=function(t,e,i){},t.prototype.forEachLayerAtPixel=function(t,e,i,r){},t}(Yl),Lp=function(i){function t(t,e){i.call(this,t,e),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.createTexture_=function(t){var e=t.getImage();return qc(this.mapRenderer.getGL(),e,Ze,Ze)},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=this.getLayer(),s=o.getSource(),a=e.viewState.resolution,h=e.viewState.rotation,l=e.skippedFeatureUids;return s.forEachFeatureAtCoordinate(t,a,h,i,l,function(t){return r.call(n,t,o)})},t.prototype.prepareFrame=function(t,e,i){var r=this.mapRenderer.getGL(),n=t.pixelRatio,o=t.viewState,s=o.center,a=o.resolution,h=o.rotation,l=this.image_,u=this.texture,c=this.getLayer().getSource(),p=t.viewHints,d=t.extent;if(void 0!==e.extent&&(d=ht(d,e.extent)),!p[rs.ANIMATING]&&!p[rs.INTERACTING]&&!pt(d)){var f=o.projection,_=c.getImage(d,a,n,f);if(_)if(this.loadImage(_)&&(l=_,u=this.createTexture_(_),this.texture)){var g=function(t,e){t.isContextLost()||t.deleteTexture(e)}.bind(null,r,this.texture);t.postRenderFunctions.push(g)}}if(l){var y=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(y.width,y.height,n,s,a,h,l.getExtent()),this.hitTransformationMatrix_=null;var v=this.texCoordMatrix;ge(v),Ce(v,1,-1),Ee(v,0,-1),this.image_=l,this.texture=u}return!!l},t.prototype.updateProjectionMatrix_=function(t,e,i,r,n,o,s){var a=t*n,h=e*n,l=this.projectionMatrix;ge(l),Ce(l,2*i/a,2*i/h),Se(l,-o),Ee(l,s[0]-r[0],s[1]-r[1]),Ce(l,(s[2]-s[0])/2,(s[3]-s[1])/2),Ee(l,1,1)},t.prototype.hasFeatureAtCoordinate=function(t,e){return void 0!==this.forEachFeatureAtCoordinate(t,e,0,y,this)},t.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==L){var n=xe(e.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,e,0,y,this)?i.call(r,this.getLayer(),null):void 0}var o=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(e.size,o));var s=xe(this.hitTransformationMatrix_,t.slice());if(!(s[0]<0||s[0]>o[0]||s[1]<0||s[1]>o[1])){this.hitCanvasContext_||(this.hitCanvasContext_=De(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),s[0],s[1],1,1,0,0,1,1);var a=this.hitCanvasContext_.getImageData(0,0,1,1).data;return 0<a[3]?i.call(r,this.getLayer(),a):void 0}}},t.prototype.getHitTransformationMatrix_=function(t,e){var i=[1,0,0,1,0,0];Ee(i,-1,-1),Ce(i,2/t[0],2/t[1]),Ee(i,0,t[1]),Ce(i,1,-1);var r=we(this.projectionMatrix.slice()),n=[1,0,0,1,0,0];return Ee(n,0,e[1]),Ce(n,1,-1),Ce(n,e[0]/2,e[1]/2),Ee(n,1,1),ye(n,r),ye(n,i),n},t}(Ip);Lp.handles=function(t){return t.getType()===oh.IMAGE},Lp.create=function(t,e){return new Lp(t,e)};var bp=function(i){function t(t){i.call(this,t);var e=t.getViewport();this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=_i,e.insertBefore(this.canvas_,e.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=De(),this.renderedVisible_=!0,this.gl_=Qe(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new Kc(this.canvas_,this.gl_),E(this.canvas_,Vc,this.handleWebGLContextLost,this),E(this.canvas_,Wc,this.handleWebGLContextRestored,this),this.textureCache_=new mi,this.focus_=null,this.tileTextureQueue_=new qo(function(t){var e=t[1],i=t[2],r=e[0]-this.focus_[0],n=e[1]-this.focus_[1];return 65536*Math.log(i)+Math.sqrt(r*r+n*n)/i}.bind(this),function(t){return t[0].getKey()}),this.loadNextTileTexture_=function(t,e){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var i=this.tileTextureQueue_.dequeue(),r=i[0],n=i[3],o=i[4];this.bindTileTexture(r,n,o,9729,9729)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.bindTileTexture=function(t,e,i,r,n){var o=this.getGL(),s=t.getKey();if(this.textureCache_.containsKey(s)){var a=this.textureCache_.get(s);o.bindTexture(He,a.texture),a.magFilter!=r&&(o.texParameteri(He,10240,r),a.magFilter=r),a.minFilter!=n&&(o.texParameteri(He,10241,n),a.minFilter=n)}else{var h=o.createTexture();if(o.bindTexture(He,h),0<i){var l=this.clipTileContext_.canvas,u=this.clipTileContext_;this.clipTileCanvasWidth_!==e[0]||this.clipTileCanvasHeight_!==e[1]?(l.width=e[0],l.height=e[1],this.clipTileCanvasWidth_=e[0],this.clipTileCanvasHeight_=e[1]):u.clearRect(0,0,e[0],e[1]),u.drawImage(t.getImage(),i,i,e[0],e[1],0,0,e[0],e[1]),o.texImage2D(He,0,6408,6408,5121,l)}else o.texImage2D(He,0,6408,6408,5121,t.getImage());o.texParameteri(He,10240,r),o.texParameteri(He,10241,n),o.texParameteri(He,We,Ze),o.texParameteri(He,Ke,Ze),this.textureCache_.set(s,{texture:h,magFilter:r,minFilter:n})}},t.prototype.dispatchComposeEvent_=function(t,e){var i=this.getMap();if(i.hasListener(t)){var r=this.context_,n=e.extent,o=e.size,s=e.viewState,a=e.pixelRatio,h=s.resolution,l=s.center,u=s.rotation,c=new Ep(r,l,h,u,o,n,a),p=new Pl(t,c,e,null,r);i.dispatchEvent(p)}},t.prototype.disposeInternal=function(){var e=this.getGL();e.isContextLost()||this.textureCache_.forEach(function(t){t&&e.deleteTexture(t.texture)}),this.context_.dispose(),i.prototype.disposeInternal.call(this)},t.prototype.expireCache_=function(t,e){for(var i,r=this.getGL();1024<this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_;){if(i=this.textureCache_.peekLast())r.deleteTexture(i.texture);else{if(+this.textureCache_.peekLastKey()==e.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},t.prototype.getContext=function(){return this.context_},t.prototype.getGL=function(){return this.gl_},t.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},t.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var e=this.getLayerRenderers();for(var i in e){e[i].handleWebGLContextLost()}},t.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},t.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(33984),t.blendFuncSeparate(770,771,1,771),t.disable(2884),t.disable(2929),t.disable(3089),t.disable(2960)},t.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},t.prototype.renderFrame=function(t){var e=this.getContext(),i=this.getGL();if(i.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(Tn,t);var r=[],n=t.layerStatesArray;_r(n,Dl);var o,s,a,h=t.viewState.resolution;for(o=0,s=n.length;o<s;++o)bs(a=n[o],h)&&a.sourceState==ms&&this.getLayerRenderer(a.layer).prepareFrame(t,a,e)&&r.push(a);var l=t.size[0]*t.pixelRatio,u=t.size[1]*t.pixelRatio;for(this.canvas_.width==l&&this.canvas_.height==u||(this.canvas_.width=l,this.canvas_.height=u),i.bindFramebuffer(qe,null),i.clearColor(0,0,0,0),i.clear(16384),i.enable(3042),i.viewport(0,0,this.canvas_.width,this.canvas_.height),o=0,s=r.length;o<s;++o)a=r[o],this.getLayerRenderer(a.layer).composeFrame(t,a,e);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),1024<this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(En,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n,o,s){var a;if(this.getGL().isContextLost())return!1;var h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;0<=h;--h){var c=u[h],p=c.layer;if(bs(c,l.resolution)&&o.call(s,p))if(a=this.getLayerRenderer(p).forEachFeatureAtCoordinate(t,e,i,r,n))return a}},t.prototype.hasFeatureAtCoordinate=function(t,e,i,r,n){var o=!1;if(this.getGL().isContextLost())return!1;var s,a=e.viewState,h=e.layerStatesArray;for(s=h.length-1;0<=s;--s){var l=h[s],u=l.layer;if(bs(l,a.resolution)&&r.call(n,u))if(o=this.getLayerRenderer(u).hasFeatureAtCoordinate(t,e))return!0}return o},t.prototype.forEachLayerAtPixel=function(t,e,i,r,n,o,s){if(this.getGL().isContextLost())return!1;var a,h,l=e.viewState,u=e.layerStatesArray;for(h=u.length-1;0<=h;--h){var c=u[h],p=c.layer;if(bs(c,l.resolution)&&o.call(n,p))if(a=this.getLayerRenderer(p).forEachLayerAtPixel(t,e,r,n))return a}},t}(Gl),Pp=new Ic("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n"),Fp=new Lc("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n"),Mp=function(t,e){this.u_tileOffset=t.getUniformLocation(e,"u_tileOffset"),this.u_texture=t.getUniformLocation(e,"u_texture"),this.a_position=t.getAttribLocation(e,"a_position"),this.a_texCoord=t.getAttribLocation(e,"a_texCoord")},Op=function(i){function t(t,e){i.call(this,t,e),this.fragmentShader_=Pp,this.vertexShader_=Fp,this.locations_=null,this.renderArrayBuffer_=new Uc([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),i.prototype.disposeInternal.call(this)},t.prototype.createLoadedTileFinder=function(e,r,n){var o=this.mapRenderer;return function(i,t){return e.forEachLoadedTile(r,i,t,function(t){var e=o.isTileTextureLoaded(t);return e&&(n[i]||(n[i]={}),n[i][t.tileCoord.toString()]=t),e})}},t.prototype.handleWebGLContextLost=function(){i.prototype.handleWebGLContextLost.call(this),this.locations_=null},t.prototype.prepareFrame=function(t,e,i){var r,n,o=this.mapRenderer,s=i.getGL(),a=t.viewState,h=a.projection,l=this.getLayer(),u=l.getSource(),c=u.getTileGridForProjection(h),p=c.getZForResolution(a.resolution),d=c.getResolution(p),f=u.getTilePixelSize(p,t.pixelRatio,h),_=f[0]/ws(c.getTileSize(p),this.tmpSize_)[0],g=d/_,y=u.getTilePixelRatio(_)*u.getGutter(h),v=a.center,m=t.extent,x=c.getTileRangeForExtentAndZ(m,p);if(this.renderedTileRange_&&this.renderedTileRange_.equals(x)&&this.renderedRevision_==u.getRevision())r=this.renderedFramebufferExtent_;else{var S=x.getSize(),C=Math.max(S[0]*f[0],S[1]*f[1]),E=(Z(0<(n=C),29),Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))),T=g*E,w=c.getOrigin(p),R=w[0]+x.minX*f[0]*g,I=w[1]+x.minY*f[1]*g;r=[R,I,R+T,I+T],this.bindFramebuffer(t,E),s.viewport(0,0,E,E),s.clearColor(0,0,0,0),s.clear(16384),s.disable(3042);var L=i.getProgram(this.fragmentShader_,this.vertexShader_);i.useProgram(L),this.locations_||(this.locations_=new Mp(s,L)),i.bindBuffer(ze,this.renderArrayBuffer_),s.enableVertexAttribArray(this.locations_.a_position),s.vertexAttribPointer(this.locations_.a_position,2,Ve,!1,16,0),s.enableVertexAttribArray(this.locations_.a_texCoord),s.vertexAttribPointer(this.locations_.a_texCoord,2,Ve,!1,16,8),s.uniform1i(this.locations_.u_texture,0);var b={};b[p]={};var P,F,M,O,N,A,G=this.createLoadedTileFinder(u,h,b),k=l.getUseInterimTilesOnError(),D=!0,j=[1/0,1/0,-1/0,-1/0],U=new Vl(0,0,0,0);for(O=x.minX;O<=x.maxX;++O)for(N=x.minY;N<=x.maxY;++N)if(F=u.getTile(p,O,N,_,h),void 0===e.extent||wt(A=c.getTileCoordExtent(F.tileCoord,j),e.extent)){if((M=F.getState())==Gn||M==Dn||M==kn&&!k||(F=F.getInterimTile()),(M=F.getState())==Gn){if(o.isTileTextureLoaded(F)){b[p][F.tileCoord.toString()]=F;continue}}else if(M==Dn||M==kn&&!k)continue;D=!1,c.forEachTileCoordParentTileRange(F.tileCoord,G,null,U,j)||(P=c.getTileCoordChildTileRange(F.tileCoord,U,j))&&G(p+1,P)}var Y=Object.keys(b).map(Number);Y.sort(hr);for(var B=new Float32Array(4),X=0,z=Y.length;X<z;++X){var V=b[Y[X]];for(var W in V)F=V[W],A=c.getTileCoordExtent(F.tileCoord,j),B[0]=2*(A[2]-A[0])/T,B[1]=2*(A[3]-A[1])/T,B[2]=2*(A[0]-r[0])/T-1,B[3]=2*(A[1]-r[1])/T-1,s.uniform4fv(this.locations_.u_tileOffset,B),o.bindTileTexture(F,f,y*_,9729,9729),s.drawArrays(5,0,4)}D?(this.renderedTileRange_=x,this.renderedFramebufferExtent_=r,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,p,x);var K=o.getTileTextureQueue();this.manageTilePyramid(t,u,c,_,h,m,p,l.getPreload(),function(t){t.getState()!=Gn||o.isTileTextureLoaded(t)||K.isKeyQueued(t.getKey())||K.enqueue([t,c.getTileCoordCenter(t.tileCoord),c.getResolution(t.tileCoord[0]),f,y*_])},this),this.scheduleExpireCache(t,u);var H=this.texCoordMatrix;return ge(H),Ee(H,(Math.round(v[0]/d)*d-r[0])/(r[2]-r[0]),(Math.round(v[1]/d)*d-r[1])/(r[3]-r[1])),0!==a.rotation&&Se(H,a.rotation),Ce(H,t.size[0]*a.resolution/(r[2]-r[0]),t.size[1]*a.resolution/(r[3]-r[1])),Ee(H,-.5,-.5),!0},t.prototype.forEachLayerAtPixel=function(t,e,i,r){if(this.framebuffer){var n=[t[0]/e.size[0],(e.size[1]-t[1])/e.size[1]],o=xe(this.texCoordMatrix,n.slice()),s=[o[0]*this.framebufferDimension,o[1]*this.framebufferDimension],a=this.mapRenderer.getContext().getGL();a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer);var h=new Uint8Array(4);return a.readPixels(s[0],s[1],1,1,a.RGBA,a.UNSIGNED_BYTE,h),0<h[3]?i.call(r,this.getLayer(),h):void 0}},t}(Ip);Op.handles=function(t){return t.getType()===oh.TILE},Op.create=function(t,e){return new Op(t,e)};var Np=function(i){function t(t,e){i.call(this,t,e),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.composeFrame=function(t,e,i){this.layerState_=e;var r=t.viewState,n=this.replayGroup_,o=t.size,s=t.pixelRatio,a=this.mapRenderer.getGL();n&&!n.isEmpty()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,o[0]*s,o[1]*s),n.replay(i,r.center,r.resolution,r.rotation,o,s,e.opacity,e.managed?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},t.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var e=this.mapRenderer.getContext();t.getDeleteResourcesFunction(e)(),this.replayGroup_=null}i.prototype.disposeInternal.call(this)},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){if(this.replayGroup_&&this.layerState_){var o=this.mapRenderer.getContext(),s=e.viewState,a=this.getLayer(),h=this.layerState_,l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s.center,s.resolution,s.rotation,e.size,e.pixelRatio,h.opacity,{},function(t){var e=Et(t).toString();if(!(e in l))return l[e]=!0,r.call(n,t,a)})}},t.prototype.hasFeatureAtCoordinate=function(t,e){if(this.replayGroup_&&this.layerState_){var i=this.mapRenderer.getContext(),r=e.viewState,n=this.layerState_;return this.replayGroup_.hasFeatureAtCoordinate(t,i,r.center,r.resolution,r.rotation,e.size,e.pixelRatio,n.opacity,e.skippedFeatureUids)}return!1},t.prototype.forEachLayerAtPixel=function(t,e,i,r){var n=xe(e.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,e)?i.call(r,this.getLayer(),null):void 0},t.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(t,e,i){var n=this.getLayer(),r=n.getSource(),o=t.viewHints[rs.ANIMATING],s=t.viewHints[rs.INTERACTING],a=n.getUpdateWhileAnimating(),h=n.getUpdateWhileInteracting();if(!this.dirty_&&!a&&o||!h&&s)return!0;var l=t.extent,u=t.viewState,c=u.projection,p=u.resolution,d=t.pixelRatio,f=n.getRevision(),_=n.getRenderBuffer(),g=n.getRenderOrder();void 0===g&&(g=bu);var y=G(l,_*p);if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&Q(this.renderedExtent_,y))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(i)),this.dirty_=!1;var v=new Cp(Fu(p,d),y,n.getRenderBuffer());r.loadFeatures(y,p,c);var m=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,p)),e){var r=this.renderFeature(t,p,d,e,v);this.dirty_=this.dirty_||r}};if(g){var x=[];r.forEachFeatureInExtent(y,function(t){x.push(t)},this),x.sort(g),x.forEach(m.bind(this))}else r.forEachFeatureInExtent(y,m,this);return v.finish(i),this.renderedResolution_=p,this.renderedRevision_=f,this.renderedRenderOrder_=g,this.renderedExtent_=y,this.replayGroup_=v,!0},t.prototype.renderFeature=function(t,e,i,r,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=r.length-1;0<=s;--s)o=Mu(n,t,r[s],Pu(e,i),this.handleStyleImageChange_,this)||o;else o=Mu(n,t,r,Pu(e,i),this.handleStyleImageChange_,this)||o;return o},t}(Ip);Np.handles=function(t){return t.getType()===oh.VECTOR},Np.create=function(t,e){return new Np(t,e)};var Ap=function(e){function t(t){(t=C({},t)).controls||(t.controls=As()),t.interactions||(t.interactions=Ll()),e.call(this,t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.createRenderer=function(){var t=new bp(this);return t.registerLayerRenderers([Lp,Op,Np]),t},t}(Rs),Gp="projection",kp="coordinateFormat",Dp=function(r){function t(t){var e=t||{},i=document.createElement("DIV");i.className=void 0!==e.className?e.className:"ol-mouse-position",r.call(this,{element:i,render:e.render||jp,target:e.target}),E(this,b(Gp),this.handleProjectionChanged_,this),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.undefinedHTML_="undefinedHTML"in e?e.undefinedHTML:" ",this.renderOnMouseOut_=!!this.undefinedHTML_,this.renderedHTML_=i.innerHTML,this.mapProjection_=null,this.transform_=null,this.lastMouseMovePixel_=null}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.handleProjectionChanged_=function(){this.transform_=null},t.prototype.getCoordinateFormat=function(){return this.get(kp)},t.prototype.getProjection=function(){return this.get(Gp)},t.prototype.handleMouseMove=function(t){var e=this.getMap();this.lastMouseMovePixel_=e.getEventPixel(t),this.updateHTML_(this.lastMouseMovePixel_)},t.prototype.handleMouseOut=function(t){this.updateHTML_(null),this.lastMouseMovePixel_=null},t.prototype.setMap=function(t){if(r.prototype.setMap.call(this,t),t){var e=t.getViewport();this.listenerKeys.push(E(e,w.MOUSEMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(E(e,w.MOUSEOUT,this.handleMouseOut,this))}},t.prototype.setCoordinateFormat=function(t){this.set(kp,t)},t.prototype.setProjection=function(t){this.set(Gp,ne(t))},t.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var i=this.getProjection();this.transform_=i?ce(this.mapProjection_,i):ie}var r=this.getMap().getCoordinateFromPixel(t);if(r){this.transform_(r,r);var n=this.getCoordinateFormat();e=n?n(r):r.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},t}(Is);function jp(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null,this.updateHTML_(this.lastMouseMovePixel_)}var Up=function(){this.dataProjection=null,this.defaultFeatureProjection=null};function Yp(t,e,i){var r,n=i?ne(i.featureProjection):null,o=i?ne(i.dataProjection):null;if(r=n&&o&&!ue(n,o)?t instanceof Ie?(e?t.clone():t).transform(e?n:o,e?o:n):fe(t,o,n):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);r===t&&(r=r.clone()),r.applyTransform(function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*s)/s;return t})}return r}Up.prototype.getReadOptions=function(t,e){var i;return e&&(i={dataProjection:e.dataProjection?e.dataProjection:this.readProjection(t),featureProjection:e.featureProjection}),this.adaptOptions(i)},Up.prototype.adaptOptions=function(t){return C({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},Up.prototype.getLastExtent=function(){return null},Up.prototype.getType=function(){},Up.prototype.readFeature=function(t,e){},Up.prototype.readFeatures=function(t,e){},Up.prototype.readGeometry=function(t,e){},Up.prototype.readProjection=function(t){},Up.prototype.writeFeature=function(t,e){},Up.prototype.writeFeatures=function(t,e){},Up.prototype.writeGeometry=function(t,e){};var Bp=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getType=function(){return uh.JSON},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Xp(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Xp(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){},e.prototype.readFeaturesFromObject=function(t,e){},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Xp(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Xp(t))},e.prototype.readProjectionFromObject=function(t){},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){},e}(Up);function Xp(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var zp={};zp[Lt.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new Dr([t.x,t.y,t.z,t.m],yr.XYZM):void 0!==t.z?new Dr([t.x,t.y,t.z],yr.XYZ):void 0!==t.m?new Dr([t.x,t.y,t.m],yr.XYM):new Dr([t.x,t.y]);return e},zp[Lt.LINE_STRING]=function(t){var e=Hp(t);return new Sn(t.paths[0],e)},zp[Lt.POLYGON]=function(t){var e=Hp(t);return new Qr(t.rings,e)},zp[Lt.MULTI_POINT]=function(t){var e=Hp(t);return new ih(t.points,e)},zp[Lt.MULTI_LINE_STRING]=function(t){var e=Hp(t);return new eh(t.paths,e)},zp[Lt.MULTI_POLYGON]=function(t){var e=Hp(t);return new nh(t.rings,e)};var Vp={};Vp[Lt.POINT]=function(t,e){var i,r=t.getCoordinates(),n=t.getLayout();n===yr.XYZ?i={x:r[0],y:r[1],z:r[2]}:n===yr.XYM?i={x:r[0],y:r[1],m:r[2]}:n===yr.XYZM?i={x:r[0],y:r[1],z:r[2],m:r[3]}:n===yr.XY?i={x:r[0],y:r[1]}:Z(!1,34);return i},Vp[Lt.LINE_STRING]=function(t,e){var i=Zp(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},Vp[Lt.POLYGON]=function(t,e){var i=Zp(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},Vp[Lt.MULTI_POINT]=function(t,e){var i=Zp(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},Vp[Lt.MULTI_LINE_STRING]=function(t,e){var i=Zp(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},Vp[Lt.MULTI_POLYGON]=function(t,e){for(var i=Zp(t),r=t.getCoordinates(!1),n=[],o=0;o<r.length;o++)for(var s=r[o].length-1;0<=s;s--)n.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:n}};var Wp=function(i){function t(t){var e=t||{};i.call(this),this.geometryName_=e.geometryName}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeatureFromObject=function(t,e){var i=t,r=Kp(i.geometry,e),n=new Ji;return this.geometryName_&&n.setGeometryName(this.geometryName_),n.setGeometry(r),e&&e.idField&&i.attributes[e.idField]&&n.setId(i.attributes[e.idField]),i.attributes&&n.setProperties(i.attributes),n},t.prototype.readFeaturesFromObject=function(t,e){var i=e||{};if(t.features){var r=[],n=t.features;i.idField=t.objectIdFieldName;for(var o=0,s=n.length;o<s;++o)r.push(this.readFeatureFromObject(n[o],i));return r}return[this.readFeatureFromObject(t,i)]},t.prototype.readGeometryFromObject=function(t,e){return Kp(t,e)},t.prototype.readProjectionFromObject=function(t){var e=t;return e.spatialReference&&e.spatialReference.wkid?ne("EPSG:"+e.spatialReference.wkid):null},t.prototype.writeGeometryObject=function(t,e){return qp(t,this.adaptOptions(e))},t.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={},r=t.getGeometry();r&&(i.geometry=qp(r,e),e&&e.featureProjection&&(i.geometry.spatialReference={wkid:ne(e.featureProjection).getCode().split(":").pop()}));var n=t.getProperties();return delete n[t.getGeometryName()],Tt(n)?i.attributes={}:i.attributes=n,i},t.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(this.writeFeatureObject(t[r],e));return{features:i}},t}(Bp);function Kp(t,e){if(!t)return null;var i;if("number"==typeof t.x&&"number"==typeof t.y)i=Lt.POINT;else if(t.points)i=Lt.MULTI_POINT;else if(t.paths)i=1===t.paths.length?Lt.LINE_STRING:Lt.MULTI_LINE_STRING;else if(t.rings){var r=Hp(t),n=function(t,e){var i,r,n=[],o=[],s=[];for(i=0,r=t.length;i<r;++i){n.length=0,Lr(n,0,t[i],e.length);var a=Hr(n,0,n.length,e.length);a?o.push([t[i]]):s.push(t[i])}for(;s.length;){var h=s.shift(),l=!1;for(i=o.length-1;0<=i;i--){var u=o[i][0],c=Q(new kr(u).getExtent(),new kr(h).getExtent());if(c){o[i].push(h),l=!0;break}}l||o.push([h.reverse()])}return o}(t.rings,r);t=C({},t),1===n.length?(i=Lt.POLYGON,t.rings=n[0]):(i=Lt.MULTI_POLYGON,t.rings=n)}return Yp((0,zp[i])(t),!1,e)}function Hp(t){var e=yr.XY;return!0===t.hasZ&&!0===t.hasM?e=yr.XYZM:!0===t.hasZ?e=yr.XYZ:!0===t.hasM&&(e=yr.XYM),e}function Zp(t){var e=t.getLayout();return{hasZ:e===yr.XYZ||e===yr.XYZM,hasM:e===yr.XYM||e===yr.XYZM}}function qp(t,e){return(0,Vp[t.getType()])(Yp(t,!0,e),e)}var Jp=document.implementation.createDocument("","",null),Qp="http://www.w3.org/2001/XMLSchema-instance";function $p(t,e){return Jp.createElementNS(t,e)}function td(t,e){return function t(e,i,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var n;for(n=e.firstChild;n;n=n.nextSibling)t(n,i,r)}return r}(t,e,[]).join("")}function ed(t){return t instanceof Document}function id(t){return t instanceof Node}function rd(t){return(new DOMParser).parseFromString(t,"application/xml")}function nd(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&pr(e[e.length-1],i)}}function od(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&e[e.length-1].push(i)}}function sd(r,n){return function(t,e){var i=r.call(void 0!==n?n:this,t,e);void 0!==i&&(e[e.length-1]=i)}}function ad(o,s,a){return function(t,e){var i=o.call(void 0!==a?a:this,t,e);if(void 0!==i){var r=e[e.length-1],n=void 0!==s?s:t.localName;(n in r?r[n]:r[n]=[]).push(i)}}}function hd(r,n,o){return function(t,e){var i=r.call(void 0!==o?o:this,t,e);void 0!==i&&(e[e.length-1][void 0!==n?n:t.localName]=i)}}function ld(r,n){return function(t,e,i){r.call(void 0!==n?n:this,t,e,i),i[i.length-1].node.appendChild(t)}}function ud(n,t){var o,s;return function(t,e,i){if(void 0===o){o={};var r={};r[t.localName]=n,o[t.namespaceURI]=r,s=cd(t.localName)}yd(o,s,e,i)}}function cd(t,o){var s=t;return function(t,e,i){var r=e[e.length-1].node,n=s;return void 0===n&&(n=i),$p(void 0!==o?o:r.namespaceURI,n)}}var pd=cd();function dd(t,e){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=t[e[n]];return r}function fd(t,e,i){var r,n,o=void 0!==i?i:{};for(r=0,n=t.length;r<n;++r)o[t[r]]=e;return o}function _d(t,e,i,r){var n;for(n=e.firstElementChild;n;n=n.nextElementSibling){var o=t[n.namespaceURI];if(void 0!==o){var s=o[n.localName];void 0!==s&&s.call(r,n,i)}}}function gd(t,e,i,r,n){return r.push(t),_d(e,i,r,n),r.pop()}function yd(t,e,i,r,n,o){for(var s,a,h=(void 0!==n?n:i).length,l=0;l<h;++l)void 0!==(s=i[l])&&void 0!==(a=e.call(void 0!==o?o:this,s,r,void 0!==n?n[l]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,r)}function vd(t,e,i,r,n,o,s){return n.push(t),yd(e,i,r,n,o,s),n.pop()}var md=function(t){function e(){t.call(this),this.xmlSerializer_=new XMLSerializer}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getType=function(){return uh.XML},e.prototype.readFeature=function(t,e){if(ed(t))return this.readFeatureFromDocument(t,e);if(id(t))return this.readFeatureFromNode(t,e);if("string"==typeof t){var i=rd(t);return this.readFeatureFromDocument(i,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var i=this.readFeaturesFromDocument(t,e);return 0<i.length?i[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(ed(t))return this.readFeaturesFromDocument(t,e);if(id(t))return this.readFeaturesFromNode(t,e);if("string"==typeof t){var i=rd(t);return this.readFeaturesFromDocument(i,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&pr(i,this.readFeaturesFromNode(r,e));return i},e.prototype.readFeaturesFromNode=function(t,e){},e.prototype.readGeometry=function(t,e){if(ed(t))return this.readGeometryFromDocument(t,e);if(id(t))return this.readGeometryFromNode(t,e);if("string"==typeof t){var i=rd(t);return this.readGeometryFromDocument(i,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(ed(t))return this.readProjectionFromDocument(t);if(id(t))return this.readProjectionFromNode(t);if("string"==typeof t){var e=rd(t);return this.readProjectionFromDocument(e)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Up),xd="http://www.opengis.net/gml",Sd=/^[\s\xa0]*$/,Cd=function(i){function t(t){i.call(this);var e=t||{};this.featureType=e.featureType,this.featureNS=e.featureNS,this.srsName=e.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[xd]={featureMember:sd(this.readFeaturesInternal),featureMembers:sd(this.readFeaturesInternal)}}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeaturesInternal=function(t,e){var i=t.localName,r=null;if("FeatureCollection"==i)r="http://www.opengis.net/wfs"===t.namespaceURI?gd([],this.FEATURE_COLLECTION_PARSERS,t,e,this):gd(null,this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==i||"featureMember"==i){var n=e[0],o=n.featureType,s=n.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,h=t.childNodes.length;a<h;++a){var l=t.childNodes[a];if(1===l.nodeType){var u=l.nodeName.split(":").pop();if(-1===o.indexOf(u)){var c="",p=0,d=l.namespaceURI;for(var f in s){if(s[f]===d){c=f;break}++p}c||(s[c="p"+p]=d),o.push(c+":"+u)}}}"featureMember"!=i&&(n.featureType=o,n.featureNS=s)}if("string"==typeof s){var _=s;(s={}).p0=_}var g={},y=Array.isArray(o)?o:[o];for(var v in s){for(var m={},x=0,S=y.length;x<S;++x){(-1===y[x].indexOf(":")?"p0":y[x].split(":")[0])===v&&(m[y[x].split(":").pop()]="featureMembers"==i?od(this.readFeatureElement,this):sd(this.readFeatureElement,this))}g[s[v]]=m}r=gd("featureMember"==i?void 0:[],g,t,e)}return null===r&&(r=[]),r},t.prototype.readGeometryElement=function(t,e){var i=e[0];i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension");var r=gd(null,this.GEOMETRY_PARSERS_,t,e,this);return r?Yp(r,!1,i):void 0},t.prototype.readFeatureElement=function(t,e){var i,r,n,o,s=t.getAttribute("fid")||(r=xd,n="id",t.getAttributeNS(r,n)||""),a={};for(i=t.firstElementChild;i;i=i.nextElementSibling){var h=i.localName;if(0===i.childNodes.length||1===i.childNodes.length&&(3===i.firstChild.nodeType||4===i.firstChild.nodeType)){var l=td(i,!1);Sd.test(l)&&(l=void 0),a[h]=l}else"boundedBy"!==h&&(o=h),a[h]=this.readGeometryElement(i,e)}var u=new Ji(a);return o&&u.setGeometryName(o),s&&u.setId(s),u},t.prototype.readPoint=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i)return new Dr(i,yr.XYZ)},t.prototype.readMultiPoint=function(t,e){var i=gd([],this.MULTIPOINT_PARSERS_,t,e,this);return i?new ih(i):void 0},t.prototype.readMultiLineString=function(t,e){var i=gd([],this.MULTILINESTRING_PARSERS_,t,e,this);if(i)return new eh(i)},t.prototype.readMultiPolygon=function(t,e){var i=gd([],this.MULTIPOLYGON_PARSERS_,t,e,this);if(i)return new nh(i)},t.prototype.pointMemberParser_=function(t,e){_d(this.POINTMEMBER_PARSERS_,t,e,this)},t.prototype.lineStringMemberParser_=function(t,e){_d(this.LINESTRINGMEMBER_PARSERS_,t,e,this)},t.prototype.polygonMemberParser_=function(t,e){_d(this.POLYGONMEMBER_PARSERS_,t,e,this)},t.prototype.readLineString=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);return i?new Sn(i,yr.XYZ):void 0},t.prototype.readFlatLinearRing_=function(t,e){var i=gd(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this);return i||void 0},t.prototype.readLinearRing=function(t,e){var i=this.readFlatCoordinatesFromNode_(t,e);if(i)return new kr(i,yr.XYZ)},t.prototype.readPolygon=function(t,e){var i=gd([null],this.FLAT_LINEAR_RINGS_PARSERS_,t,e,this);if(i&&i[0]){var r,n,o=i[0],s=[o.length];for(r=1,n=i.length;r<n;++r)pr(o,i[r]),s.push(o.length);return new Qr(o,yr.XYZ,s)}},t.prototype.readFlatCoordinatesFromNode_=function(t,e){return gd(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this)},t.prototype.readGeometryFromNode=function(t,e){var i=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return i||null},t.prototype.readFeaturesFromNode=function(t,e){var i={featureType:this.featureType,featureNS:this.featureNS};return e&&C(i,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[i])||[]},t.prototype.readProjectionFromNode=function(t){return ne(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},t}(md);function Ed(t){return Td(td(t,!1))}function Td(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function wd(t){var e=td(t,!1),i=Date.parse(e);return isNaN(i)?void 0:i/1e3}function Rd(t){return Id(td(t,!1))}function Id(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function Ld(t){return bd(td(t,!1))}function bd(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function Pd(t){return td(t,!1).trim()}function Fd(t,e){Nd(t,e?"1":"0")}function Md(t,e){var i=e.toPrecision();t.appendChild(Jp.createTextNode(i))}function Od(t,e){var i=e.toString();t.appendChild(Jp.createTextNode(i))}function Nd(t,e){t.appendChild(Jp.createTextNode(e))}Cd.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:od(Cd.prototype.pointMemberParser_),pointMembers:od(Cd.prototype.pointMemberParser_)}},Cd.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:od(Cd.prototype.lineStringMemberParser_),lineStringMembers:od(Cd.prototype.lineStringMemberParser_)}},Cd.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:od(Cd.prototype.polygonMemberParser_),polygonMembers:od(Cd.prototype.polygonMemberParser_)}},Cd.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:od(Cd.prototype.readFlatCoordinatesFromNode_)}},Cd.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:od(Cd.prototype.readLineString)}},Cd.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:od(Cd.prototype.readPolygon)}},Cd.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:sd(Cd.prototype.readFlatLinearRing_)}};var Ad=xd+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",Gd={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},kd=function(i){function t(t){var e=t||{};i.call(this,e),this.surface_=void 0!==e.surface&&e.surface,this.curve_=void 0!==e.curve&&e.curve,this.multiCurve_=void 0===e.multiCurve||e.multiCurve,this.multiSurface_=void 0===e.multiSurface||e.multiSurface,this.schemaLocation=e.schemaLocation?e.schemaLocation:Ad,this.hasZ=void 0!==e.hasZ&&e.hasZ}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readMultiCurve_=function(t,e){var i=gd([],this.MULTICURVE_PARSERS_,t,e,this);return i?new eh(i):void 0},t.prototype.readMultiSurface_=function(t,e){var i=gd([],this.MULTISURFACE_PARSERS_,t,e,this);if(i)return new nh(i)},t.prototype.curveMemberParser_=function(t,e){_d(this.CURVEMEMBER_PARSERS_,t,e,this)},t.prototype.surfaceMemberParser_=function(t,e){_d(this.SURFACEMEMBER_PARSERS_,t,e,this)},t.prototype.readPatch_=function(t,e){return gd([null],this.PATCHES_PARSERS_,t,e,this)},t.prototype.readSegment_=function(t,e){return gd([null],this.SEGMENTS_PARSERS_,t,e,this)},t.prototype.readPolygonPatch_=function(t,e){return gd([null],this.FLAT_LINEAR_RINGS_PARSERS_,t,e,this)},t.prototype.readLineStringSegment_=function(t,e){return gd([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS_,t,e,this)},t.prototype.interiorParser_=function(t,e){var i=gd(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},t.prototype.exteriorParser_=function(t,e){var i=gd(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)},t.prototype.readSurface_=function(t,e){var i=gd([null],this.SURFACE_PARSERS_,t,e,this);if(i&&i[0]){var r,n,o=i[0],s=[o.length];for(r=1,n=i.length;r<n;++r)pr(o,i[r]),s.push(o.length);return new Qr(o,yr.XYZ,s)}},t.prototype.readCurve_=function(t,e){var i=gd([null],this.CURVE_PARSERS_,t,e,this);return i?new Sn(i,yr.XYZ):void 0},t.prototype.readEnvelope_=function(t,e){var i=gd([null],this.ENVELOPE_PARSERS_,t,e,this);return X(i[1][0],i[1][1],i[2][0],i[2][1])},t.prototype.readFlatPos_=function(t,e){for(var i,r=td(t,!1),n=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];i=n.exec(r);)o.push(parseFloat(i[1])),r=r.substr(i[0].length);if(""===r){var s,a,h=e[0].srsName,l="enu";if(h)l=ne(h).getAxisOrientation();if("neu"===l)for(s=0,a=o.length;s<a;s+=3){var u=o[s],c=o[s+1];o[s]=c,o[s+1]=u}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},t.prototype.readFlatPosList_=function(t,e){var i=td(t,!1).replace(/^\s*|\s*$/g,""),r=e[0],n=r.srsName,o=r.srsDimension,s="enu";n&&(s=ne(n).getAxisOrientation());var a,h,l,u=i.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=bd(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=bd(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=bd(t.parentNode.getAttribute("srsDimension")):o&&(c=bd(o));for(var p=[],d=0,f=u.length;d<f;d+=c)a=parseFloat(u[d]),h=parseFloat(u[d+1]),l=3===c?parseFloat(u[d+2]):0,"en"===s.substr(0,2)?p.push(a,h,l):p.push(h,a,l);return p},t.prototype.writePos_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?3:2;t.setAttribute("srsDimension",o);var s=r.srsName,a="enu";s&&(a=ne(s).getAxisOrientation());var h,l=e.getCoordinates();(h="en"===a.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],n)&&(h+=" "+(l[2]||0));Nd(t,h)},t.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=ne(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];i&&(n+=" "+(t[2]||0));return n},t.prototype.writePosList_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=n?3:2;t.setAttribute("srsDimension",o);for(var s,a=r.srsName,h=e.getCoordinates(),l=h.length,u=new Array(l),c=0;c<l;++c)s=h[c],u[c]=this.getCoords_(s,a,n);Nd(t,u.join(" "))},t.prototype.writePoint_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=$p(t.namespaceURI,"pos");t.appendChild(n),this.writePos_(n,e,i)},t.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];vd({node:t},this.ENVELOPE_SERIALIZERS_,pd,n,i,["lowerCorner","upperCorner"],this)},t.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=$p(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)},t.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),$p(n.namespaceURI,void 0!==o?"interior":"exterior")},t.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();vd({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=$p(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},t.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=$p(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)}else if("Curve"===t.nodeName){var o=$p(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}},t.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();vd({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},t.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.srsName,o=r.hasZ;n&&t.setAttribute("srsName",n);var s=e.getPoints();vd({node:t,hasZ:o,srsName:n},this.POINTMEMBER_SERIALIZERS_,cd("pointMember"),s,i,void 0,this)},t.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();vd({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},t.prototype.writeRing_=function(t,e,i){var r=$p(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},t.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},t.prototype.writePointMember_=function(t,e,i){var r=$p(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},t.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},t.prototype.writeSurfacePatches_=function(t,e,i){var r=$p(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},t.prototype.writeCurveSegments_=function(t,e,i){var r=$p(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},t.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=C({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?fe(e,n.featureProjection,n.dataProjection):e:Yp(e,!0,n),vd(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},t.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var u in a){var c=a[u];null!==c&&(h.push(u),l.push(c),u==s||c instanceof Ie?u in n.serializers[o]||(n.serializers[o][u]=ld(this.writeGeometryElement,this)):u in n.serializers[o]||(n.serializers[o][u]=ld(Nd)))}var p=C({},n);p.node=t,vd(p,n.serializers,cd(void 0,o),l,i,h)},t.prototype.writeFeatureMembers_=function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s={};s[o]={},s[o][n]=ld(this.writeFeatureElement,this);var a=C({},r);a.node=t,vd(a,s,cd(n,o),e,i)},t.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return $p("http://www.opengis.net/gml",Gd[r.nodeName])},t.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.curve,h=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"LineString"===r&&!0===a?r="Curve":"MultiLineString"===r&&!0===h&&(r="MultiCurve"),$p("http://www.opengis.net/gml",r)},t.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var i=$p("http://www.opengis.net/gml","geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&C(r,e),this.writeGeometryElement(i,t,[r]),i},t.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=$p("http://www.opengis.net/gml","featureMembers");i.setAttributeNS(Qp,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&C(r,e),this.writeFeatureMembers_(i,t,[r]),i},t}(Cd);kd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_={"http://www.opengis.net/gml":{pos:sd(kd.prototype.readFlatPos_),posList:sd(kd.prototype.readFlatPosList_)}},kd.prototype.FLAT_LINEAR_RINGS_PARSERS_={"http://www.opengis.net/gml":{interior:kd.prototype.interiorParser_,exterior:kd.prototype.exteriorParser_}},kd.prototype.GEOMETRY_PARSERS_={"http://www.opengis.net/gml":{Point:sd(Cd.prototype.readPoint),MultiPoint:sd(Cd.prototype.readMultiPoint),LineString:sd(Cd.prototype.readLineString),MultiLineString:sd(Cd.prototype.readMultiLineString),LinearRing:sd(Cd.prototype.readLinearRing),Polygon:sd(Cd.prototype.readPolygon),MultiPolygon:sd(Cd.prototype.readMultiPolygon),Surface:sd(kd.prototype.readSurface_),MultiSurface:sd(kd.prototype.readMultiSurface_),Curve:sd(kd.prototype.readCurve_),MultiCurve:sd(kd.prototype.readMultiCurve_),Envelope:sd(kd.prototype.readEnvelope_)}},kd.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:od(kd.prototype.curveMemberParser_),curveMembers:od(kd.prototype.curveMemberParser_)}},kd.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:od(kd.prototype.surfaceMemberParser_),surfaceMembers:od(kd.prototype.surfaceMemberParser_)}},kd.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:od(Cd.prototype.readLineString),Curve:od(kd.prototype.readCurve_)}},kd.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:od(Cd.prototype.readPolygon),Surface:od(kd.prototype.readSurface_)}},kd.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:sd(kd.prototype.readPatch_)}},kd.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:sd(kd.prototype.readSegment_)}},kd.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:od(kd.prototype.readFlatPosList_),upperCorner:od(kd.prototype.readFlatPosList_)}},kd.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:sd(kd.prototype.readPolygonPatch_)}},kd.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:sd(kd.prototype.readLineStringSegment_)}},kd.prototype.writeFeatures,kd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:ld(kd.prototype.writeRing_),interior:ld(kd.prototype.writeRing_)}},kd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:ld(Nd),upperCorner:ld(Nd)}},kd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:ld(kd.prototype.writeSurfaceOrPolygonMember_),polygonMember:ld(kd.prototype.writeSurfaceOrPolygonMember_)}},kd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:ld(kd.prototype.writePointMember_)}},kd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:ld(kd.prototype.writeLineStringOrCurveMember_),curveMember:ld(kd.prototype.writeLineStringOrCurveMember_)}},kd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:ld(kd.prototype.writeCurveOrLineString_),MultiCurve:ld(kd.prototype.writeMultiCurveOrLineString_),Point:ld(kd.prototype.writePoint_),MultiPoint:ld(kd.prototype.writeMultiPoint_),LineString:ld(kd.prototype.writeCurveOrLineString_),MultiLineString:ld(kd.prototype.writeMultiCurveOrLineString_),LinearRing:ld(kd.prototype.writeLinearRing_),Polygon:ld(kd.prototype.writeSurfaceOrPolygon_),MultiPolygon:ld(kd.prototype.writeMultiSurfaceOrPolygon_),Surface:ld(kd.prototype.writeSurfaceOrPolygon_),MultiSurface:ld(kd.prototype.writeMultiSurfaceOrPolygon_),Envelope:ld(kd.prototype.writeEnvelope)}};var Dd=kd;Dd.prototype.writeFeatures,Dd.prototype.writeFeaturesNode;var jd=xd+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",Ud={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Yd=function(i){function t(t){var e=t||{};i.call(this,e),this.FEATURE_COLLECTION_PARSERS[xd].featureMember=od(this.readFeaturesInternal),this.schemaLocation=e.schemaLocation?e.schemaLocation:jd}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFlatCoordinates_=function(t,e){var i=td(t,!1).replace(/^\s*|\s*$/g,""),r=e[0].srsName,n="enu";if(r){var o=ne(r);o&&(n=o.getAxisOrientation())}for(var s=i.trim().split(/\s+/),a=[],h=0,l=s.length;h<l;h++){var u=s[h].split(/,+/),c=parseFloat(u[0]),p=parseFloat(u[1]),d=3===u.length?parseFloat(u[2]):0;"en"===n.substr(0,2)?a.push(c,p,d):a.push(p,c,d)}return a},t.prototype.readBox_=function(t,e){var i=gd([null],this.BOX_PARSERS_,t,e,this);return X(i[1][0],i[1][1],i[1][3],i[1][4])},t.prototype.innerBoundaryIsParser_=function(t,e){var i=gd(void 0,this.RING_PARSERS,t,e,this);i&&e[e.length-1].push(i)},t.prototype.outerBoundaryIsParser_=function(t,e){var i=gd(void 0,this.RING_PARSERS,t,e,this);i&&(e[e.length-1][0]=i)},t.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,i){var r,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"MultiLineString"===r&&!0===a&&(r="MultiCurve"),$p("http://www.opengis.net/gml",r)},t.prototype.writeFeatureElement=function(t,e,i){var r=e.getId();r&&t.setAttribute("fid",r);var n=i[i.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=e.getProperties(),h=[],l=[];for(var u in a){var c=a[u];null!==c&&(h.push(u),l.push(c),u==s||c instanceof Ie?u in n.serializers[o]||(n.serializers[o][u]=ld(this.writeGeometryElement,this)):u in n.serializers[o]||(n.serializers[o][u]=ld(Nd)))}var p=C({},n);p.node=t,vd(p,n.serializers,cd(void 0,o),l,i,h)},t.prototype.writeCurveOrLineString_=function(t,e,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)}else if("Curve"===t.nodeName){var o=$p(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,i)}},t.prototype.writeLineStringOrCurveMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeCurveOrLineString_(r,e,i))},t.prototype.writeMultiCurveOrLineString_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();vd({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},t.prototype.writeGeometryElement=function(t,e,i){var r,n=i[i.length-1],o=C({},n);o.node=t,r=Array.isArray(e)?n.dataProjection?fe(e,n.featureProjection,n.dataProjection):e:Yp(e,!0,n),vd(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[r],i,void 0,this)},t.prototype.createCoordinatesNode_=function(t){var e=$p(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},t.prototype.writeCoordinates_=function(t,e,i){for(var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=e.getCoordinates(),a=s.length,h=new Array(a),l=0;l<a;++l){var u=s[l];h[l]=this.getCoords_(u,o,n)}Nd(t,h.join(" "))},t.prototype.writeCurveSegments_=function(t,e,i){var r=$p(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString_(r,e,i)},t.prototype.writeSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();vd({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,s,i,void 0,this)}else if("Surface"===t.nodeName){var a=$p(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,i)}},t.prototype.RING_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1],n=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),$p(n.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},t.prototype.writeSurfacePatches_=function(t,e,i){var r=$p(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i)},t.prototype.writeRing_=function(t,e,i){var r=$p(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing_(r,e,i)},t.prototype.getCoords_=function(t,e,i){var r="enu";e&&(r=ne(e).getAxisOrientation());var n="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];i&&(n+=","+(t[2]||0));return n},t.prototype.writePoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(s);var a=e.getCoordinates();Nd(s,this.getCoords_(a,o,n))},t.prototype.writeMultiPoint_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=e.getPoints();vd({node:t,hasZ:n,srsName:o},this.POINTMEMBER_SERIALIZERS_,cd("pointMember"),s,i,void 0,this)},t.prototype.writePointMember_=function(t,e,i){var r=$p(t.namespaceURI,"Point");t.appendChild(r),this.writePoint_(r,e,i)},t.prototype.writeLinearRing_=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)},t.prototype.writeMultiSurfaceOrPolygon_=function(t,e,i){var r=i[i.length-1],n=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();vd({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)},t.prototype.writeSurfaceOrPolygonMember_=function(t,e,i){var r=this.GEOMETRY_NODE_FACTORY_(e,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon_(r,e,i))},t.prototype.writeEnvelope=function(t,e,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];vd({node:t},this.ENVELOPE_SERIALIZERS_,pd,n,i,["lowerCorner","upperCorner"],this)},t.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,i){var r=e[e.length-1].node;return $p("http://www.opengis.net/gml",Ud[r.nodeName])},t}(Cd);Yd.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_={"http://www.opengis.net/gml":{coordinates:sd(Yd.prototype.readFlatCoordinates_)}},Yd.prototype.FLAT_LINEAR_RINGS_PARSERS_={"http://www.opengis.net/gml":{innerBoundaryIs:Yd.prototype.innerBoundaryIsParser_,outerBoundaryIs:Yd.prototype.outerBoundaryIsParser_}},Yd.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:od(Yd.prototype.readFlatCoordinates_)}},Yd.prototype.GEOMETRY_PARSERS_={"http://www.opengis.net/gml":{Point:sd(Cd.prototype.readPoint),MultiPoint:sd(Cd.prototype.readMultiPoint),LineString:sd(Cd.prototype.readLineString),MultiLineString:sd(Cd.prototype.readMultiLineString),LinearRing:sd(Cd.prototype.readLinearRing),Polygon:sd(Cd.prototype.readPolygon),MultiPolygon:sd(Cd.prototype.readMultiPolygon),Box:sd(Yd.prototype.readBox_)}},Yd.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:ld(Yd.prototype.writeCurveOrLineString_),MultiCurve:ld(Yd.prototype.writeMultiCurveOrLineString_),Point:ld(Yd.prototype.writePoint_),MultiPoint:ld(Yd.prototype.writeMultiPoint_),LineString:ld(Yd.prototype.writeCurveOrLineString_),MultiLineString:ld(Yd.prototype.writeMultiCurveOrLineString_),LinearRing:ld(Yd.prototype.writeLinearRing_),Polygon:ld(Yd.prototype.writeSurfaceOrPolygon_),MultiPolygon:ld(Yd.prototype.writeMultiSurfaceOrPolygon_),Surface:ld(Yd.prototype.writeSurfaceOrPolygon_),MultiSurface:ld(Yd.prototype.writeMultiSurfaceOrPolygon_),Envelope:ld(Yd.prototype.writeEnvelope)}},Yd.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:ld(Yd.prototype.writeLineStringOrCurveMember_),curveMember:ld(Yd.prototype.writeLineStringOrCurveMember_)}},Yd.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:ld(Yd.prototype.writeRing_),innerBoundaryIs:ld(Yd.prototype.writeRing_)}},Yd.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:ld(Yd.prototype.writePointMember_)}},Yd.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:ld(Yd.prototype.writeSurfaceOrPolygonMember_),polygonMember:ld(Yd.prototype.writeSurfaceOrPolygonMember_)}},Yd.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:ld(Nd),upperCorner:ld(Nd)}};var Bd=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Xd={rte:vf,trk:mf,wpt:xf},zd=fd(Bd,{rte:od(vf),trk:od(mf),wpt:od(xf)}),Vd=fd(Bd,{text:hd(Pd,"linkText"),type:hd(Pd,"linkType")}),Wd=fd(Bd,{rte:ld(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t,properties:n},s=e.getGeometry();s&&(s=Yp(s,!0,r),o.geometryLayout=s.getLayout(),n.rtept=s.getCoordinates());var a=i[i.length-1].node,h=rf[a.namespaceURI],l=dd(n,h);vd(o,nf,pd,l,i,h)}),trk:ld(function(t,e,i){var r=i[0],n=e.getProperties(),o={node:t,properties:n},s=e.getGeometry();s&&(s=Yp(s,!0,r),n.trkseg=s.getLineStrings());var a=i[i.length-1].node,h=sf[a.namespaceURI],l=dd(n,h);vd(o,af,pd,l,i,h)}),wpt:ld(function(t,e,i){var r=i[0],n=i[i.length-1];n.properties=e.getProperties();var o=e.getGeometry();o&&(o=Yp(o,!0,r),n.geometryLayout=o.getLayout(),Cf(t,o.getCoordinates(),i))})}),Kd=function(i){function t(t){i.call(this);var e=t||{};this.dataProjection=ne("EPSG:4326"),this.readExtensions_=e.readExtensions}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,i=t.length;e<i;++e){var r=t[e];if(this.readExtensions_){var n=r.get("extensionsNode_")||null;this.readExtensions_(r,n)}r.set("extensionsNode_",void 0)}},t.prototype.readFeatureFromNode=function(t,e){if(!lr(Bd,t.namespaceURI))return null;var i=Xd[t.localName];if(!i)return null;var r=i(t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_([r]),r):null},t.prototype.readFeaturesFromNode=function(t,e){if(!lr(Bd,t.namespaceURI))return[];if("gpx"==t.localName){var i=gd([],zd,t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_(i),i):[]}return[]},t.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=$p("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",Qp),i.setAttributeNS(Qp,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),vd({node:i},Wd,df,t,[e]),i},t}(md),Hd=fd(Bd,{name:hd(Pd),cmt:hd(Pd),desc:hd(Pd),src:hd(Pd),link:gf,number:hd(Ld),extensions:yf,type:hd(Pd),rtept:function(t,e){var i=gd({},Zd,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;ff(n,o,t,i)}}}),Zd=fd(Bd,{ele:hd(Rd),time:hd(wd)}),qd=fd(Bd,{name:hd(Pd),cmt:hd(Pd),desc:hd(Pd),src:hd(Pd),link:gf,number:hd(Ld),type:hd(Pd),extensions:yf,trkseg:function(t,e){var i=e[e.length-1];_d(Jd,t,e);var r=i.flatCoordinates;i.ends.push(r.length)}}),Jd=fd(Bd,{trkpt:function(t,e){var i=gd({},Qd,t,e);if(i){var r=e[e.length-1],n=r.flatCoordinates,o=r.layoutOptions;ff(n,o,t,i)}}}),Qd=fd(Bd,{ele:hd(Rd),time:hd(wd)}),$d=fd(Bd,{ele:hd(Rd),time:hd(wd),magvar:hd(Rd),geoidheight:hd(Rd),name:hd(Pd),cmt:hd(Pd),desc:hd(Pd),src:hd(Pd),link:gf,sym:hd(Pd),type:hd(Pd),fix:hd(Pd),sat:hd(Ld),hdop:hd(Rd),vdop:hd(Rd),pdop:hd(Rd),ageofdgpsdata:hd(Rd),dgpsid:hd(Ld),extensions:yf}),tf=["text","type"],ef=fd(Bd,{text:ld(Nd),type:ld(Nd)}),rf=fd(Bd,["name","cmt","desc","src","link","number","type","rtept"]),nf=fd(Bd,{name:ld(Nd),cmt:ld(Nd),desc:ld(Nd),src:ld(Nd),link:ld(Sf),number:ld(Od),type:ld(Nd),rtept:ud(ld(Cf))}),of=fd(Bd,["ele","time"]),sf=fd(Bd,["name","cmt","desc","src","link","number","type","trkseg"]),af=fd(Bd,{name:ld(Nd),cmt:ld(Nd),desc:ld(Nd),src:ld(Nd),link:ld(Sf),number:ld(Od),type:ld(Nd),trkseg:ud(ld(function(t,e,i){vd({node:t,geometryLayout:e.getLayout(),properties:{}},lf,hf,e.getCoordinates(),i)}))}),hf=cd("trkpt"),lf=fd(Bd,{trkpt:ld(Cf)}),uf=fd(Bd,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),cf=fd(Bd,{ele:ld(Md),time:ld(function(t,e){var i=new Date(1e3*e),r=i.getUTCFullYear()+"-"+on(i.getUTCMonth()+1,2)+"-"+on(i.getUTCDate(),2)+"T"+on(i.getUTCHours(),2)+":"+on(i.getUTCMinutes(),2)+":"+on(i.getUTCSeconds(),2)+"Z";t.appendChild(Jp.createTextNode(r))}),magvar:ld(Md),geoidheight:ld(Md),name:ld(Nd),cmt:ld(Nd),desc:ld(Nd),src:ld(Nd),link:ld(Sf),sym:ld(Nd),type:ld(Nd),fix:ld(Nd),sat:ld(Od),hdop:ld(Md),vdop:ld(Md),pdop:ld(Md),ageofdgpsdata:ld(Md),dgpsid:ld(Od)}),pf={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function df(t,e,i){var r=t.getGeometry();if(r){var n=pf[r.getType()];if(n)return $p(e[e.length-1].node.namespaceURI,n)}}function ff(t,e,i,r){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,e.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,e.hasM=!0):t.push(0),t}function _f(t,e,i){var r=yr.XY,n=2;if(t.hasZ&&t.hasM?(r=yr.XYZM,n=4):t.hasZ?(r=yr.XYZ,n=3):t.hasM&&(r=yr.XYM,n=3),4!==n){for(var o=0,s=e.length/4;o<s;o++)e[o*n]=e[4*o],e[o*n+1]=e[4*o+1],t.hasZ&&(e[o*n+2]=e[4*o+2]),t.hasM&&(e[o*n+2]=e[4*o+3]);if(e.length=e.length/4*n,i)for(var a=0,h=i.length;a<h;a++)i[a]=i[a]/4*n}return r}function gf(t,e){var i=e[e.length-1],r=t.getAttribute("href");null!==r&&(i.link=r),_d(Vd,t,e)}function yf(t,e){e[e.length-1].extensionsNode_=t}function vf(t,e){var i=e[0],r=gd({flatCoordinates:[],layoutOptions:{}},Hd,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.layoutOptions;delete r.layoutOptions;var s=_f(o,n),a=new Sn(n,s);Yp(a,!1,i);var h=new Ji(a);return h.setProperties(r),h}}function mf(t,e){var i=e[0],r=gd({flatCoordinates:[],ends:[],layoutOptions:{}},qd,t,e);if(r){var n=r.flatCoordinates;delete r.flatCoordinates;var o=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var a=_f(s,n,o),h=new eh(n,a,o);Yp(h,!1,i);var l=new Ji(h);return l.setProperties(r),l}}function xf(t,e){var i=e[0],r=gd({},$d,t,e);if(r){var n={},o=ff([],n,t,r),s=_f(n,o),a=new Dr(o,s);Yp(a,!1,i);var h=new Ji(a);return h.setProperties(r),h}}function Sf(t,e,i){t.setAttribute("href",e);var r=i[i.length-1].properties,n=[r.linkText,r.linkType];vd({node:t},ef,pd,n,i,tf)}function Cf(t,e,i){var r=i[i.length-1],n=r.node.namespaceURI,o=r.properties;switch(t.setAttributeNS(null,"lat",e[1]),t.setAttributeNS(null,"lon",e[0]),r.geometryLayout){case yr.XYZM:0!==e[3]&&(o.time=e[3]);case yr.XYZ:0!==e[2]&&(o.ele=e[2]);break;case yr.XYM:0!==e[2]&&(o.time=e[2])}var s="rtept"==t.nodeName?of[n]:uf[n],a=dd(o,s);vd({node:t,properties:o},cf,pd,a,i,s)}var Ef=function(e){function u(t){e.call(this),this.geometries_=t||null,this.listenGeometriesChange_()}return e&&(u.__proto__=e),((u.prototype=Object.create(e&&e.prototype)).constructor=u).prototype.unlistenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)d(this.geometries_[t],w.CHANGE,this.changed,this)},u.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)E(this.geometries_[t],w.CHANGE,this.changed,this)},u.prototype.clone=function(){var t=new u(null);return t.setGeometries(this.geometries_),t},u.prototype.closestPointXY=function(t,e,i,r){if(r<D(this.getExtent(),t,e))return r;for(var n=this.geometries_,o=0,s=n.length;o<s;++o)r=n[o].closestPointXY(t,e,i,r);return r},u.prototype.containsXY=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)if(i[r].containsXY(t,e))return!0;return!1},u.prototype.computeExtent=function(t){z(t);for(var e=this.geometries_,i=0,r=e.length;i<r;++i)H(t,e[i].getExtent());return t},u.prototype.getGeometries=function(){return Tf(this.geometries_)},u.prototype.getGeometriesArray=function(){return this.geometries_},u.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(_(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];for(var i=[],r=this.geometries_,n=!1,o=0,s=r.length;o<s;++o){var a=r[o],h=a.getSimplifiedGeometry(t);i.push(h),h!==a&&(n=!0)}if(n){var l=new u(null);return l.setGeometriesArray(i),this.simplifiedGeometryCache[e]=l}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},u.prototype.getType=function(){return Lt.GEOMETRY_COLLECTION},u.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)if(e[i].intersectsExtent(t))return!0;return!1},u.prototype.isEmpty=function(){return 0===this.geometries_.length},u.prototype.rotate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].rotate(t,e);this.changed()},u.prototype.scale=function(t,e,i){var r=i;r||(r=ot(this.getExtent()));for(var n=this.geometries_,o=0,s=n.length;o<s;++o)n[o].scale(t,e,r);this.changed()},u.prototype.setGeometries=function(t){this.setGeometriesArray(Tf(t))},u.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},u.prototype.applyTransform=function(t){for(var e=this.geometries_,i=0,r=e.length;i<r;++i)e[i].applyTransform(t);this.changed()},u.prototype.translate=function(t,e){for(var i=this.geometries_,r=0,n=i.length;r<n;++r)i[r].translate(t,e);this.changed()},u.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),e.prototype.disposeInternal.call(this)},u}(Ie);function Tf(t){for(var e=[],i=0,r=t.length;i<r;++i)e.push(t[i].clone());return e}var wf=function(i){function t(t){var e=t||{};i.call(this),this.dataProjection=ne(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=ne(e.featureProjection)),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeatureFromObject=function(t,e){var i=null,r=Lf((i="Feature"===t.type?t:{type:"Feature",geometry:t}).geometry,e),n=new Ji;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&void 0!==i.geometry_name&&n.setGeometryName(i.geometry_name),n.setGeometry(r),void 0!==i.id&&n.setId(i.id),i.properties&&n.setProperties(i.properties),n},t.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var r=t.features,n=0,o=r.length;n<o;++n)i.push(this.readFeatureFromObject(r[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},t.prototype.readGeometryFromObject=function(t,e){return Lf(t,e)},t.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=ne(i.properties.name):Z(!1,36):e=this.dataProjection,e},t.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature"},r=t.getId();void 0!==r&&(i.id=r);var n=t.getGeometry();i.geometry=n?bf(n,e):null;var o=t.getProperties();return delete o[t.getGeometryName()],Tt(o)?i.properties=null:i.properties=o,i},t.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:i}},t.prototype.writeGeometryObject=function(t,e){return bf(t,this.adaptOptions(e))},t}(Bp),Rf={Point:function(t){return new Dr(t.coordinates)},LineString:function(t){return new Sn(t.coordinates)},Polygon:function(t){return new Qr(t.coordinates)},MultiPoint:function(t){return new ih(t.coordinates)},MultiLineString:function(t){return new eh(t.coordinates)},MultiPolygon:function(t){return new nh(t.coordinates)},GeometryCollection:function(t,e){var i=t.geometries.map(function(t){return Lf(t,e)});return new Ef(i)}},If={Point:function(t,e){return{type:"Point",coordinates:t.getCoordinates()}},LineString:function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}},Polygon:function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}},MultiPoint:function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}},MultiLineString:function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}},MultiPolygon:function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}},GeometryCollection:function(t,i){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(t){var e=C({},i);return delete e.featureProjection,bf(t,e)})}},Circle:function(t){return{type:"GeometryCollection",geometries:[]}}};function Lf(t,e){return t?Yp((0,Rf[t.type])(t),!1,e):null}function bf(t,e){return(0,If[t.getType()])(Yp(t,!0,e),e)}var Pf=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.getType=function(){return uh.TEXT},e.prototype.readFeature=function(t,e){return this.readFeatureFromText(Ff(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(t,e){},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(Ff(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(t,e){},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText(Ff(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(t,e){},e.prototype.readProjection=function(t){return this.readProjectionFromText(Ff(t))},e.prototype.readProjectionFromText=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(t,e){},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(t,e){},e}(Up);function Ff(t){return"string"==typeof t?t:""}var Mf="barometric",Of="gps",Nf="none",Af=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Gf=/^H.([A-Z]{3}).*?:(.*)/,kf=/^HFDTE(\d{2})(\d{2})(\d{2})/,Df=/\r\n|\r|\n/,jf=function(i){function t(t){i.call(this);var e=t||{};this.dataProjection=ne("EPSG:4326"),this.altitudeMode_=e.altitudeMode?e.altitudeMode:Nf}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeatureFromText=function(t,e){var i,r,n=this.altitudeMode_,o=t.split(Df),s={},a=[],h=2e3,l=0,u=1,c=-1;for(i=0,r=o.length;i<r;++i){var p=o[i],d=void 0;if("B"==p.charAt(0)){if(d=Af.exec(p)){var f=parseInt(d[1],10),_=parseInt(d[2],10),g=parseInt(d[3],10),y=parseInt(d[4],10)+parseInt(d[5],10)/6e4;"S"==d[6]&&(y=-y);var v=parseInt(d[7],10)+parseInt(d[8],10)/6e4;if("W"==d[9]&&(v=-v),a.push(v,y),n!=Nf){var m=void 0;m=n==Of?parseInt(d[11],10):n==Mf?parseInt(d[12],10):0,a.push(m)}var x=Date.UTC(h,l,u,f,_,g);x<c&&(x=Date.UTC(h,l,u+1,f,_,g)),a.push(x/1e3),c=x}}else"H"==p.charAt(0)&&((d=kf.exec(p))?(u=parseInt(d[1],10),l=parseInt(d[2],10)-1,h=2e3+parseInt(d[3],10)):(d=Gf.exec(p))&&(s[d[1]]=d[2].trim()))}if(0===a.length)return null;var S=n==Nf?yr.XYM:yr.XYZM,C=new Sn(a,S),E=new Ji(Yp(C,!1,e));return E.setProperties(s),E},t.prototype.readFeaturesFromText=function(t,e){var i=this.readFeatureFromText(t,e);return i?[i]:[]},t.prototype.writeFeatureText=function(t,e){},t.prototype.writeFeaturesText=function(t,e){},t.prototype.writeGeometryText=function(t,e){},t.prototype.readGeometryFromText=function(t,e){},t}(Pf),Uf={FRACTION:"fraction",PIXELS:"pixels"},Yf=function(s){function t(t,e,i,r,n,o){s.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==r&&(this.image_.crossOrigin=r),this.canvas_=o?document.createElement("CANVAS"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=n,this.size_=i,this.src_=e,this.tainting_=!1,this.imageState_==di.LOADED&&this.determineTainting_()}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.determineTainting_=function(){var t=De(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainting_=!0}},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(w.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=di.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=di.LOADED,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.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.tainting_){var e=this.size_[0],i=this.size_[1],r=De(e,i);r.fillRect(0,0,e,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==di.IDLE){this.imageState_=di.LOADING,this.imageListenerKeys_=[p(this.image_,w.ERROR,this.handleImageError_,this),p(this.image_,w.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},t.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var e=t.getImageData(0,0,this.image_.width,this.image_.height),i=e.data,r=this.color_[0]/255,n=this.color_[1]/255,o=this.color_[2]/255,s=0,a=i.length;s<a;s+=4)i[s]*=r,i[s+1]*=n,i[s+2]*=o;t.putImageData(e,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(g),this.imageListenerKeys_=null},t}(i);var Bf,Xf,zf,Vf,Wf,Kf,Hf,Zf,qf,Jf={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Qf=function(v){function t(t){var e=t||{},i=void 0!==e.opacity?e.opacity:1,r=void 0!==e.rotation?e.rotation:0,n=void 0!==e.scale?e.scale:1,o=void 0!==e.rotateWithView&&e.rotateWithView,s=void 0===e.snapToPixel||e.snapToPixel;v.call(this,{opacity:i,rotation:r,scale:n,snapToPixel:s,rotateWithView:o}),this.anchor_=void 0!==e.anchor?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==e.anchorOrigin?e.anchorOrigin:Jf.TOP_LEFT,this.anchorXUnits_=void 0!==e.anchorXUnits?e.anchorXUnits:Uf.FRACTION,this.anchorYUnits_=void 0!==e.anchorYUnits?e.anchorYUnits:Uf.FRACTION,this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null;var a=void 0!==e.img?e.img:null,h=void 0!==e.imgSize?e.imgSize:null,l=e.src;Z(!(void 0!==l&&a),4),Z(!a||a&&h,5),void 0!==l&&0!==l.length||!a||(l=a.src||Et(a).toString()),Z(void 0!==l&&0<l.length,6);var u,c,p,d,f,_,g,y=void 0!==e.src?di.IDLE:di.LOADED;this.color_=void 0!==e.color?Ne(e.color):null,this.iconImage_=(u=a,c=l,p=h,d=this.crossOrigin_,f=y,_=this.color_,(g=Al.get(c,d,_))||(g=new Yf(u,c,p,d,f,_),Al.set(c,d,_,g)),g),this.offset_=void 0!==e.offset?e.offset:[0,0],this.offsetOrigin_=void 0!==e.offsetOrigin?e.offsetOrigin:Jf.TOP_LEFT,this.origin_=null,this.size_=void 0!==e.size?e.size:null}return v&&(t.__proto__=v),((t.prototype=Object.create(v&&v.prototype)).constructor=t).prototype.clone=function(){return new t({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:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Uf.FRACTION||this.anchorYUnits_==Uf.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Uf.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==Uf.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Jf.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Jf.TOP_RIGHT&&this.anchorOrigin_!=Jf.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Jf.BOTTOM_LEFT&&this.anchorOrigin_!=Jf.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},t.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(t){return this.iconImage_.getImage(t)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Jf.TOP_LEFT){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Jf.TOP_RIGHT&&this.offsetOrigin_!=Jf.BOTTOM_RIGHT||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Jf.BOTTOM_LEFT&&this.offsetOrigin_!=Jf.BOTTOM_RIGHT||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(t,e){return E(this.iconImage_,w.CHANGE,t,e)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(t,e){d(this.iconImage_,w.CHANGE,t,e)},t}(Yi),$f=["http://www.google.com/kml/ext/2.2"],t_=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],e_={fraction:Uf.FRACTION,pixels:Uf.PIXELS,insetPixels:Uf.PIXELS},i_=fd(t_,{ExtendedData:K_,Region:H_,MultiGeometry:hd(D_,"geometry"),LineString:hd(A_,"geometry"),LinearRing:hd(G_,"geometry"),Point:hd(j_,"geometry"),Polygon:hd(Y_,"geometry"),Style:hd(X_),StyleMap:function(t,e){var i=S_(t,e);if(!i)return;var r=e[e.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:Z(!1,38)},address:hd(Pd),description:hd(Pd),name:hd(Pd),open:hd(Ed),phoneNumber:hd(Pd),styleUrl:hd(v_),visibility:hd(Ed)},fd($f,{MultiTrack:hd(function(t,e){var i=gd([],L_,t,e);if(!i)return;return new eh(i)},"geometry"),Track:hd(P_,"geometry")})),r_=fd(t_,{ExtendedData:K_,Region:H_,Link:function(t,e){_d(n_,t,e)},address:hd(Pd),description:hd(Pd),name:hd(Pd),open:hd(Ed),phoneNumber:hd(Pd),visibility:hd(Ed)}),n_=fd(t_,{href:hd(v_)}),o_=fd(t_,{LatLonAltBox:function(t,e){var i=gd({},J_,t,e);if(!i)return;var r=e[e.length-1],n=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];r.extent=n,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){var i=gd({},Q_,t,e);if(!i)return;var r=e[e.length-1];r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),s_=fd(t_,["Document","Placemark"]),a_=fd(t_,{Document:ld(function(t,e,i){vd({node:t},rg,ng,e,i,void 0,this)}),Placemark:ld(Lg)}),h_=null,l_=null,u_=null,c_=null,p_=null,d_=null;var f_=function(i){function t(t){i.call(this);var e=t||{};d_||(h_=new zi({color:Bf=[255,255,255,1]}),Xf=[20,2],zf=Uf.PIXELS,Vf=Uf.PIXELS,Wf=[64,64],Kf="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Hf=.5,l_=new Qf({anchor:Xf,anchorOrigin:Jf.BOTTOM_LEFT,anchorXUnits:zf,anchorYUnits:Vf,crossOrigin:"anonymous",rotation:0,scale:Hf,size:Wf,src:Kf}),Zf="NO_IMAGE",u_=new Vi({color:Bf,width:1}),qf=new Vi({color:[51,51,51,1],width:2}),c_=new Ln({font:"bold 16px Helvetica",fill:h_,stroke:qf,scale:.8}),p_=new Wi({fill:h_,image:l_,text:c_,stroke:u_,zIndex:0}),d_=[p_]),this.dataProjection=ne("EPSG:4326"),this.defaultStyle_=e.defaultStyle?e.defaultStyle:d_,this.extractStyles_=void 0===e.extractStyles||e.extractStyles,this.writeStyles_=void 0===e.writeStyles||e.writeStyles,this.sharedStyles_={},this.showPointNames_=void 0===e.showPointNames||e.showPointNames}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readDocumentOrFolder_=function(t,e){var i=gd([],fd(t_,{Document:nd(this.readDocumentOrFolder_,this),Folder:nd(this.readDocumentOrFolder_,this),Placemark:od(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0},t.prototype.readPlacemark_=function(t,e){var i=gd({geometry:null},i_,t,e);if(i){var r=new Ji,n=t.getAttribute("id");null!==n&&r.setId(n);var a,h,l,u,c,o=e[0],s=i.geometry;if(s&&Yp(s,!1,o),r.setGeometry(s),delete i.geometry,this.extractStyles_){var p=i.Style,d=i.styleUrl,f=(a=p,h=d,l=this.defaultStyle_,u=this.sharedStyles_,c=this.showPointNames_,function(t,e){var i,r=c,n="";if(r){var o=t.getGeometry();o&&(r=o.getType()===Lt.POINT)}if(r&&(n=t.get("name"),r=r&&n),a)return r?(i=__(a[0],n),a.concat(i)):a;if(h){var s=function t(e,i,r){return Array.isArray(e)?e:"string"==typeof e?(!(e in r)&&"#"+e in r&&(e="#"+e),t(r[e],i,r)):i}(h,l,u);return r?(i=__(s[0],n),s.concat(i)):s}return r?(i=__(l[0],n),l.concat(i)):l});r.setStyle(f)}return delete i.Style,r.setProperties(i),r}},t.prototype.readSharedStyle_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=X_(t,e);if(r){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},t.prototype.readSharedStyleMap_=function(t,e){var i=t.getAttribute("id");if(null!==i){var r=S_(t,e);if(r){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+i,o).href;else n="#"+i;this.sharedStyles_[n]=r}}},t.prototype.readFeatureFromNode=function(t,e){if(!lr(t_,t.namespaceURI))return null;var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null},t.prototype.readFeaturesFromNode=function(t,e){var i;if(!lr(t_,t.namespaceURI))return[];var r=t.localName;if("Document"==r||"Folder"==r)return(i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==r){var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n?[n]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&pr(i,s)}return i}return[]},t.prototype.readName=function(t){if(ed(t))return this.readNameFromDocument(t);if(id(t))return this.readNameFromNode(t);if("string"==typeof t){var e=rd(t);return this.readNameFromDocument(e)}},t.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(e);if(i)return i}},t.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(lr(t_,e.namespaceURI)&&"name"==e.localName)return Pd(e);for(var i=t.firstElementChild;i;i=i.nextElementSibling){var r=i.localName;if(lr(t_,i.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(i);if(n)return n}}},t.prototype.readNetworkLinks=function(t){var e=[];if(ed(t))pr(e,this.readNetworkLinksFromDocument(t));else if(id(t))pr(e,this.readNetworkLinksFromNode(t));else if("string"==typeof t){var i=rd(t);pr(e,this.readNetworkLinksFromDocument(i))}return e},t.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&pr(e,this.readNetworkLinksFromNode(i));return e},t.prototype.readNetworkLinksFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(lr(t_,i.namespaceURI)&&"NetworkLink"==i.localName){var r=gd({},r_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!lr(t_,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||pr(e,this.readNetworkLinksFromNode(n))}return e},t.prototype.readRegion=function(t){var e=[];if(ed(t))pr(e,this.readRegionFromDocument(t));else if(id(t))pr(e,this.readRegionFromNode(t));else if("string"==typeof t){var i=rd(t);pr(e,this.readRegionFromDocument(i))}return e},t.prototype.readRegionFromDocument=function(t){for(var e=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&pr(e,this.readRegionFromNode(i));return e},t.prototype.readRegionFromNode=function(t){for(var e=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(lr(t_,i.namespaceURI)&&"Region"==i.localName){var r=gd({},o_,i,[]);e.push(r)}for(var n=t.firstElementChild;n;n=n.nextElementSibling){var o=n.localName;!lr(t_,n.namespaceURI)||"Document"!=o&&"Folder"!=o&&"kml"!=o||pr(e,this.readRegionFromNode(n))}return e},t.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var i=$p(t_[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",$f[0]),i.setAttributeNS(r,"xmlns:xsi",Qp),i.setAttributeNS(Qp,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:i},o={};1<t.length?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=s_[i.namespaceURI],a=dd(o,s);return vd(n,a_,pd,a,[e],s,this),i},t}(md);function __(t,e){var i=null,r=[0,0],n="start";if(t.getImage()){var o=t.getImage().getImageSize();if(null===o&&(o=Wf),2==o.length){var s=t.getImage().getScale();r[0]=s*o[0]/2,r[1]=-s*o[1]/2,n="left"}}if(null!==t.getText()){var a=t.getText();(i=a.clone()).setFont(a.getFont()||c_.getFont()),i.setScale(a.getScale()||c_.getScale()),i.setFill(a.getFill()||c_.getFill()),i.setStroke(a.getStroke()||qf)}else i=c_.clone();return i.setText(e),i.setOffsetX(r[0]),i.setOffsetY(r[1]),i.setTextAlign(n),new Wi({text:i})}function g_(t){var e=td(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function y_(t){for(var e,i=td(t,!1),r=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=n.exec(i);){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=e[3]?parseFloat(e[3]):0;r.push(o,s,a),i=i.substr(e[0].length)}if(""===i)return r}function v_(t){var e=td(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function m_(t){return Rd(t)}var x_=fd(t_,{Pair:function(t,e){var i=gd({},Z_,t,e);if(!i)return;var r=i.key;if(r&&"normal"==r){var n=i.styleUrl;n&&(e[e.length-1]=n);var o=i.Style;o&&(e[e.length-1]=o)}}});function S_(t,e){return gd(void 0,x_,t,e)}var C_=fd(t_,{Icon:hd(function(t,e){var i=gd({},F_,t,e);return i||null}),heading:hd(Rd),hotSpot:hd(function(t){var e,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==i?"insetPixels"!==r?Jf.BOTTOM_LEFT:Jf.TOP_LEFT:"insetPixels"!==r?Jf.BOTTOM_RIGHT:Jf.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:e_[i],y:parseFloat(t.getAttribute("y")),yunits:e_[r],origin:e}}),scale:hd(m_)});var E_=fd(t_,{color:hd(g_),scale:hd(m_)});var T_=fd(t_,{color:hd(g_),width:hd(Rd)});var w_=fd(t_,{color:hd(g_),fill:hd(Ed),outline:hd(Ed)});var R_=fd(t_,{coordinates:sd(y_)});function I_(t,e){return gd(null,R_,t,e)}var L_=fd($f,{Track:od(P_)});var b_=fd(t_,{when:function(t,e){var i=e[e.length-1].whens,r=td(t,!1),n=Date.parse(r);i.push(isNaN(n)?0:n)}},fd($f,{coord:function(t,e){var i=e[e.length-1].flatCoordinates,r=td(t,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(n){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);i.push(o,s,a,0)}else i.push(0,0,0,0)}}));function P_(t,e){var i=gd({flatCoordinates:[],whens:[]},b_,t,e);if(i){for(var r=i.flatCoordinates,n=i.whens,o=0,s=Math.min(r.length,n.length);o<s;++o)r[4*o+3]=n[o];return new Sn(r,yr.XYZM)}}var F_=fd(t_,{href:hd(v_)},fd($f,{x:hd(Rd),y:hd(Rd),w:hd(Rd),h:hd(Rd)}));var M_=fd(t_,{coordinates:sd(y_)});function O_(t,e){return gd(null,M_,t,e)}var N_=fd(t_,{extrude:hd(Ed),tessellate:hd(Ed),altitudeMode:hd(Pd)});function A_(t,e){var i=gd({},N_,t,e),r=O_(t,e);if(r){var n=new Sn(r,yr.XYZ);return n.setProperties(i),n}}function G_(t,e){var i=gd({},N_,t,e),r=O_(t,e);if(r){var n=new Qr(r,yr.XYZ,[r.length]);return n.setProperties(i),n}}var k_=fd(t_,{LineString:od(A_),LinearRing:od(G_),MultiGeometry:od(D_),Point:od(j_),Polygon:od(Y_)});function D_(t,e){var i,r=gd([],k_,t,e);if(!r)return null;if(0===r.length)return new Ef(r);for(var n,o,s=!0,a=r[0].getType(),h=1,l=r.length;h<l;++h)if(r[h].getType()!=a){s=!1;break}if(s)if(a==Lt.POINT){var u=r[0];n=u.getLayout(),o=u.getFlatCoordinates();for(var c=1,p=r.length;c<p;++c)pr(o,r[c].getFlatCoordinates());z_(i=new ih(o,n),r)}else a==Lt.LINE_STRING?z_(i=new eh(r),r):a==Lt.POLYGON?z_(i=new nh(r),r):a==Lt.GEOMETRY_COLLECTION?i=new Ef(r):Z(!1,37);else i=new Ef(r);return i}function j_(t,e){var i=gd({},N_,t,e),r=O_(t,e);if(r){var n=new Dr(r,yr.XYZ);return n.setProperties(i),n}}var U_=fd(t_,{innerBoundaryIs:function(t,e){var i=gd(void 0,$_,t,e);if(i){var r=e[e.length-1];r.push(i)}},outerBoundaryIs:function(t,e){var i=gd(void 0,tg,t,e);if(i){var r=e[e.length-1];r[0]=i}}});function Y_(t,e){var i=gd({},N_,t,e),r=gd([null],U_,t,e);if(r&&r[0]){for(var n=r[0],o=[n.length],s=1,a=r.length;s<a;++s)pr(n,r[s]),o.push(n.length);var h=new Qr(n,yr.XYZ,o);return h.setProperties(i),h}}var B_=fd(t_,{IconStyle:function(t,e){var i=gd({},C_,t,e);if(i){var r,n,o,s,a=e[e.length-1],h="Icon"in i?i.Icon:{},l=!("Icon"in i)||0<Object.keys(h).length,u=h.href;u?r=u:l&&(r=Kf);var c,p=Jf.BOTTOM_LEFT,d=i.hotSpot;d?(n=[d.x,d.y],o=d.xunits,s=d.yunits,p=d.origin):r===Kf?(n=Xf,o=zf,s=Vf):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(n=[.5,0],o=Uf.FRACTION,s=Uf.FRACTION);var f,_=h.x,g=h.y;void 0!==_&&void 0!==g&&(c=[_,g]);var y,v=h.w,m=h.h;void 0!==v&&void 0!==m&&(f=[v,m]);var x=i.heading;void 0!==x&&(y=St(x));var S=i.scale;if(l){r==Kf&&(f=Wf,void 0===S&&(S=Hf));var C=new Qf({anchor:n,anchorOrigin:p,anchorXUnits:o,anchorYUnits:s,crossOrigin:"anonymous",offset:c,offsetOrigin:Jf.BOTTOM_LEFT,rotation:y,scale:S,size:f,src:r});a.imageStyle=C}else a.imageStyle=Zf}},LabelStyle:function(t,e){var i=gd({},E_,t,e);if(i){var r=e[e.length-1],n=new Ln({fill:new zi({color:"color"in i?i.color:Bf}),scale:i.scale});r.textStyle=n}},LineStyle:function(t,e){var i=gd({},T_,t,e);if(i){var r=e[e.length-1],n=new Vi({color:"color"in i?i.color:Bf,width:"width"in i?i.width:1});r.strokeStyle=n}},PolyStyle:function(t,e){var i=gd({},w_,t,e);if(i){var r=e[e.length-1],n=new zi({color:"color"in i?i.color:Bf});r.fillStyle=n;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function X_(t,e){var i=gd({},B_,t,e);if(!i)return null;var r="fillStyle"in i?i.fillStyle:h_,n=i.fill;void 0===n||n||(r=null);var o="imageStyle"in i?i.imageStyle:l_;o==Zf&&(o=void 0);var s="textStyle"in i?i.textStyle:c_,a="strokeStyle"in i?i.strokeStyle:u_,h=i.outline;return void 0===h||h||(a=null),[new Wi({fill:r,image:o,stroke:a,text:s,zIndex:void 0})]}function z_(t,e){var i,r,n,o=e.length,s=new Array(e.length),a=new Array(e.length),h=new Array(e.length);i=r=n=!1;for(var l=0;l<o;++l){var u=e[l];s[l]=u.get("extrude"),a[l]=u.get("tessellate"),h[l]=u.get("altitudeMode"),i=i||void 0!==s[l],r=r||void 0!==a[l],n=n||h[l]}i&&t.set("extrude",s),r&&t.set("tessellate",a),n&&t.set("altitudeMode",h)}var V_=fd(t_,{displayName:hd(Pd),value:hd(Pd)});var W_=fd(t_,{Data:function(t,e){var i=t.getAttribute("name");_d(V_,t,e);var r=e[e.length-1];null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){_d(q_,t,e)}});function K_(t,e){_d(W_,t,e)}function H_(t,e){_d(o_,t,e)}var Z_=fd(t_,{Style:hd(X_),key:hd(Pd),styleUrl:hd(v_)});var q_=fd(t_,{SimpleData:function(t,e){var i=t.getAttribute("name");if(null!==i){var r=Pd(t),n=e[e.length-1];n[i]=r}}});var J_=fd(t_,{altitudeMode:hd(Pd),minAltitude:hd(Rd),maxAltitude:hd(Rd),north:hd(Rd),south:hd(Rd),east:hd(Rd),west:hd(Rd)});var Q_=fd(t_,{minLodPixels:hd(Rd),maxLodPixels:hd(Rd),minFadeExtent:hd(Rd),maxFadeExtent:hd(Rd)});var $_=fd(t_,{LinearRing:sd(I_)});var tg=fd(t_,{LinearRing:sd(I_)});function eg(t,e){for(var i=Ne(e),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],n=0;n<4;++n){var o=parseInt(r[n],10).toString(16);r[n]=1==o.length?"0"+o:o}Nd(t,r.join(""))}var ig=fd(t_,{Data:ld(function(t,e,i){t.setAttribute("name",e.name);var r={node:t},n=e.value;"object"==typeof n?(null!==n&&n.displayName&&vd(r,ig,pd,[n.displayName],i,["displayName"]),null!==n&&n.value&&vd(r,ig,pd,[n.value],i,["value"])):vd(r,ig,pd,[n],i,["value"])}),value:ld(function(t,e){Nd(t,e)}),displayName:ld(function(t,e){i=t,r=e,i.appendChild(Jp.createCDATASection(r));var i,r})});var rg=fd(t_,{Placemark:ld(Lg)}),ng=function(t,e,i){return $p(e[e.length-1].node.namespaceURI,"Placemark")};var og=cd("Data");var sg=fd(t_,["href"],fd($f,["x","y","w","h"])),ag=fd(t_,{href:ld(Nd)},fd($f,{x:ld(Md),y:ld(Md),w:ld(Md),h:ld(Md)})),hg=function(t,e,i){return $p($f[0],"gx:"+i)};var lg=fd(t_,["scale","heading","Icon","hotSpot"]),ug=fd(t_,{Icon:ld(function(t,e,i){var r={node:t},n=i[i.length-1].node,o=sg[n.namespaceURI],s=dd(e,o);vd(r,ag,pd,s,i,o),s=dd(e,o=sg[$f[0]]),vd(r,ag,hg,s,i,o)}),heading:ld(Md),hotSpot:ld(function(t,e){t.setAttribute("x",e.x),t.setAttribute("y",e.y),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)}),scale:ld(Dg)});var cg=fd(t_,["color","scale"]),pg=fd(t_,{color:ld(eg),scale:ld(Dg)});var dg=fd(t_,["color","width"]),fg=fd(t_,{color:ld(eg),width:ld(Md)});var _g={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},gg=function(t,e,i){if(t)return $p(e[e.length-1].node.namespaceURI,_g[t.getType()])},yg=cd("Point"),vg=cd("LineString"),mg=cd("LinearRing"),xg=cd("Polygon"),Sg=fd(t_,{LineString:ld(Fg),Point:ld(Fg),Polygon:ld(Ag),GeometryCollection:ld(Cg)});function Cg(t,e,i){var r,n,o={node:t},s=e.getType();s==Lt.GEOMETRY_COLLECTION?(r=e.getGeometries(),n=gg):s==Lt.MULTI_POINT?(r=e.getPoints(),n=yg):s==Lt.MULTI_LINE_STRING?(r=e.getLineStrings(),n=vg):s==Lt.MULTI_POLYGON?(r=e.getPolygons(),n=xg):Z(!1,39),vd(o,Sg,n,r,i)}var Eg=fd(t_,{LinearRing:ld(Fg)});function Tg(t,e,i){vd({node:t},Eg,mg,[e],i)}var wg=fd(t_,{ExtendedData:ld(function(t,e,i){for(var r={node:t},n=e.names,o=e.values,s=n.length,a=0;a<s;a++)vd(r,ig,og,[{name:n[a],value:o[a]}],i)}),MultiGeometry:ld(Cg),LineString:ld(Fg),LinearRing:ld(Fg),Point:ld(Fg),Polygon:ld(Ag),Style:ld(function(t,e,i){var r={node:t},n={},o=e.getFill(),s=e.getStroke(),a=e.getImage(),h=e.getText();a instanceof Qf&&(n.IconStyle=a);h&&(n.LabelStyle=h);s&&(n.LineStyle=s);o&&(n.PolyStyle=o);var l=i[i.length-1].node,u=jg[l.namespaceURI],c=dd(n,u);vd(r,Ug,pd,c,i,u)}),address:ld(Nd),description:ld(Nd),name:ld(Nd),open:ld(Fd),phoneNumber:ld(Nd),styleUrl:ld(Nd),visibility:ld(Fd)}),Rg=fd(t_,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Ig=cd("ExtendedData");function Lg(t,e,i){var r={node:t};e.getId()&&t.setAttribute("id",e.getId());var n=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(n||{}).sort().filter(function(t){return!o[t]});if(0<s.length){var a=dd(n,s);vd(r,wg,Ig,[{names:s,values:a}],i)}var h=e.getStyleFunction();if(h){var l=h(e,0);if(l){var u=Array.isArray(l)?l[0]:l;this.writeStyles_&&(n.Style=u);var c=u.getText();c&&(n.name=c.getText())}}var p=i[i.length-1].node,d=Rg[p.namespaceURI],f=dd(n,d);vd(r,wg,pd,f,i,d);var _=i[0],g=e.getGeometry();g&&(g=Yp(g,!0,_)),vd(r,wg,gg,[g],i)}var bg=fd(t_,["extrude","tessellate","altitudeMode","coordinates"]),Pg=fd(t_,{extrude:ld(Fd),tessellate:ld(Fd),altitudeMode:ld(Nd),coordinates:ld(function(t,e,i){var r,n=i[i.length-1],o=n.layout,s=n.stride;o==yr.XY||o==yr.XYM?r=2:o==yr.XYZ||o==yr.XYZM?r=3:Z(!1,34);var a=e.length,h="";if(0<a){h+=e[0];for(var l=1;l<r;++l)h+=","+e[l];for(var u=s;u<a;u+=s){h+=" "+e[u];for(var c=1;c<r;++c)h+=","+e[u+c]}}Nd(t,h)})});function Fg(t,e,i){var r=e.getFlatCoordinates(),n={node:t};n.layout=e.getLayout(),n.stride=e.getStride();var o=e.getProperties();o.coordinates=r;var s=i[i.length-1].node,a=bg[s.namespaceURI],h=dd(o,a);vd(n,Pg,pd,h,i,a)}var Mg=fd(t_,{outerBoundaryIs:ld(Tg),innerBoundaryIs:ld(Tg)}),Og=cd("innerBoundaryIs"),Ng=cd("outerBoundaryIs");function Ag(t,e,i){var r=e.getLinearRings(),n=r.shift(),o={node:t};vd(o,Mg,Og,r,i),vd(o,Mg,Ng,[n],i)}var Gg=fd(t_,{color:ld(eg)}),kg=cd("color");function Dg(t,e){Md(t,Math.round(1e6*e)/1e6)}var jg=fd(t_,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Ug=fd(t_,{IconStyle:ld(function(t,e,i){var r={node:t},n={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),h={href:o};if(s){h.w=s[0],h.h=s[1];var l=e.getAnchor(),u=e.getOrigin();if(u&&a&&0!==u[0]&&u[1]!==s[1]&&(h.x=u[0],h.y=a[1]-(u[1]+s[1])),l&&(l[0]!==s[0]/2||l[1]!==s[1]/2)){var c={x:l[0],xunits:Uf.PIXELS,y:s[1]-l[1],yunits:Uf.PIXELS};n.hotSpot=c}}n.Icon=h;var p=e.getScale();1!==p&&(n.scale=p);var d=e.getRotation();0!==d&&(n.heading=d);var f=i[i.length-1].node,_=lg[f.namespaceURI],g=dd(n,_);vd(r,ug,pd,g,i,_)}),LabelStyle:ld(function(t,e,i){var r={node:t},n={},o=e.getFill();o&&(n.color=o.getColor());var s=e.getScale();s&&1!==s&&(n.scale=s);var a=i[i.length-1].node,h=cg[a.namespaceURI],l=dd(n,h);vd(r,pg,pd,l,i,h)}),LineStyle:ld(function(t,e,i){var r={node:t},n={color:e.getColor(),width:e.getWidth()},o=i[i.length-1].node,s=dg[o.namespaceURI],a=dd(n,s);vd(r,fg,pd,a,i,s)}),PolyStyle:ld(function(t,e,i){vd({node:t},Gg,kg,[e.getColor()],i)})});var Yg=function(t,e,i,r,n){var o,s,a=8*n-r-1,h=(1<<a)-1,l=h>>1,u=-7,c=i?n-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-u)-1,d>>=-u,u+=a;0<u;o=256*o+t[e+c],c+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;0<u;s=256*s+t[e+c],c+=p,u-=8);if(0===o)o=1-l;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=l}return(d?-1:1)*s*Math.pow(2,o-r)},Bg=function(t,e,i,r,n,o){var s,a,h,l=8*o-n-1,u=(1<<l)-1,c=u>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),2<=(e+=1<=s+c?p/h:p*Math.pow(2,1-c))*h&&(s++,h/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*h-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));8<=n;t[i+d]=255&a,d+=f,a/=256,n-=8);for(s=s<<n|a,l+=n;0<l;t[i+d]=255&s,d+=f,s/=256,l-=8);t[i+d-f]|=128*_},Xg=zg;function zg(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}zg.Varint=0,zg.Fixed64=1,zg.Bytes=2,zg.Fixed32=5;var Vg=4294967296,Wg=1/Vg;function Kg(t){return t.type===zg.Bytes?t.readVarint()+t.pos:t.pos+1}function Hg(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Zg(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;t<=n;n--)i.buf[n+r]=i.buf[n]}function qg(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Jg(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Qg(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function $g(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function ty(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function ey(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function iy(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function ry(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function ny(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function oy(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function sy(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function ay(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}zg.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=oy(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ay(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=oy(this.buf,this.pos)+oy(this.buf,this.pos+4)*Vg;return this.pos+=8,t},readSFixed64:function(){var t=oy(this.buf,this.pos)+ay(this.buf,this.pos+4)*Vg;return this.pos+=8,t},readFloat:function(){var t=Yg(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Yg(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(n=o[i.pos++],r=(112&n)>>4,n<128)return Hg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<3,n<128)return Hg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<10,n<128)return Hg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<17,n<128)return Hg(t,r,e);if(n=o[i.pos++],r|=(127&n)<<24,n<128)return Hg(t,r,e);if(n=o[i.pos++],r|=(1&n)<<31,n<128)return Hg(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,i){var r="",n=e;for(;n<i;){var o,s,a,h=t[n],l=null,u=239<h?4:223<h?3:191<h?2:1;if(i<n+u)break;1===u?h<128&&(l=h):2===u?128==(192&(o=t[n+1]))&&(l=(31&h)<<6|63&o)<=127&&(l=null):3===u?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((l=(15&h)<<12|(63&o)<<6|63&s)<=2047||55296<=l&&l<=57343)&&(l=null)):4===u&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((l=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||1114112<=l)&&(l=null)),null===l?(l=65533,u=1):65535<l&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=u}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var i=Kg(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=Kg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===zg.Varint)for(;127<this.buf[this.pos++];);else if(e===zg.Bytes)this.pos=this.readVarint()+this.pos;else if(e===zg.Fixed32)this.pos+=4;else{if(e!==zg.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),sy(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),sy(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),sy(this.buf,-1&t,this.pos),sy(this.buf,Math.floor(t*Wg),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),sy(this.buf,-1&t,this.pos),sy(this.buf,Math.floor(t*Wg),this.pos+4),this.pos+=8},writeVarint:function(t){268435455<(t=+t||0)||t<0?function(t,e){var i,r;0<=t?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:r=r+1|(i=0));if(0x10000000000000000<=t||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),n=i,o=e,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos++]=127&n|128,n>>>=7,o.buf[o.pos]=127&n,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}(r,e);var n,o}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?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 r,n,o=0;o<e.length;o++){if(55295<(r=e.charCodeAt(o))&&r<57344){if(!n){56319<r||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;128<=i&&Zg(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Bg(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Bg(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 r=this.pos-i;128<=r&&Zg(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,zg.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){this.writeMessage(t,qg,e)},writePackedSVarint:function(t,e){this.writeMessage(t,Jg,e)},writePackedBoolean:function(t,e){this.writeMessage(t,ty,e)},writePackedFloat:function(t,e){this.writeMessage(t,Qg,e)},writePackedDouble:function(t,e){this.writeMessage(t,$g,e)},writePackedFixed32:function(t,e){this.writeMessage(t,ey,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,iy,e)},writePackedFixed64:function(t,e){this.writeMessage(t,ry,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,ny,e)},writeBytesField:function(t,e){this.writeTag(t,zg.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,zg.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,zg.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,zg.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,zg.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,zg.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,zg.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,zg.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,zg.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,zg.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var hy=[1,0,0,1,0,0],ly=function(t,e,i,r,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};ly.prototype.get=function(t){return this.properties_[t]},ly.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Lt.POINT?V(this.flatCoordinates_):K(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},ly.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=ot(this.getExtent());this.flatInteriorPoints_=Br(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},ly.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=rh(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Xr(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},ly.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=vn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},ly.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,r=0,n=i.length;r<n;++r){var o=i[r],s=vn(t,e,o,2,.5);pr(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},ly.prototype.getId=function(){return this.id_},ly.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},ly.prototype.getGeometry=function(){return this},ly.prototype.getProperties=function(){return this.properties_},ly.prototype.getStride=function(){return 2},ly.prototype.getType=function(){return this.type_},ly.prototype.transform=function(t,e){var i=(t=ne(t)).getExtent(),r=t.getWorldExtent(),n=at(r)/at(i);Te(hy,r[0],r[3],n,-n,0,0,0),Rt(this.flatCoordinates_,0,this.flatCoordinates_.length,2,hy,this.flatCoordinates_)},ly.prototype.getEnds=ly.prototype.getEndss=function(){return this.ends_},ly.prototype.getFlatCoordinates=ly.prototype.getOrientedFlatCoordinates,ly.prototype.getSimplifiedGeometry=ly.prototype.getGeometry,ly.prototype.getStyleFunction=L;var uy=function(i){function t(t){i.call(this);var e=t||{};this.dataProjection=new At({code:"",units:Ot.TILE_PIXELS}),this.featureClass_=e.featureClass?e.featureClass:ly,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.extent_=null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readRawGeometry_=function(t,e,i,r){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,o=1,s=0,a=0,h=0,l=0,u=0;t.pos<n;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),h+=t.readSVarint(),1===o&&u<l&&(r.push(l),u=l),i.push(a,h),l+=2):7===o?u<l&&(i.push(i[u],i[u+1]),l+=2):Z(!1,59)}u<l&&(r.push(l),u=l)},t.prototype.createFeature_=function(t,e,i){var r,n=e.type;if(0===n)return null;var o=e.id,s=e.properties;s[this.layerName_]=e.layer.name;var a=[],h=[];this.readRawGeometry_(t,e,a,h);var l=function(t,e){var i;1===t?i=1===e?Lt.POINT:Lt.MULTI_POINT:2===t?i=1===e?Lt.LINE_STRING:Lt.MULTI_LINE_STRING:3===t&&(i=Lt.POLYGON);return i}(n,h.length);if(this.featureClass_===ly)r=new this.featureClass_(l,a,h,s,o);else{var u;if(l==Lt.POLYGON){for(var c=[],p=0,d=0,f=0,_=h.length;f<_;++f){var g=h[f];Hr(a,p,g,2)||(c.push(h.slice(d,f)),d=f),p=g}u=1<c.length?new nh(a,yr.XY,c):new Qr(a,yr.XY,h)}else u=l===Lt.POINT?new Dr(a,yr.XY):l===Lt.LINE_STRING?new Sn(a,yr.XY):l===Lt.POLYGON?new Qr(a,yr.XY,h):l===Lt.MULTI_POINT?new ih(a,yr.XY):l===Lt.MULTI_LINE_STRING?new eh(a,yr.XY,h):null;r=new this.featureClass_,this.geometryName_&&r.setGeometryName(this.geometryName_);var y=Yp(u,!1,this.adaptOptions(i));r.setGeometry(y),r.setId(o),r.setProperties(s)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return uh.ARRAY_BUFFER},t.prototype.readFeatures=function(t,e){var i=this.layers_,r=new Xg(t),n=r.readFields(cy,{}),o=[];for(var s in n)if(!i||-1!=i.indexOf(s)){for(var a=n[s],h=0,l=a.length;h<l;++h){var u=fy(r,a,h);o.push(this.createFeature_(r,u))}this.extent_=a?[0,0,a.extent,a.extent]:null}return o},t.prototype.readProjection=function(t){return this.dataProjection},t.prototype.setLayers=function(t){this.layers_=t},t.prototype.readFeature=function(){},t.prototype.readGeometry=function(){},t.prototype.writeFeature=function(){},t.prototype.writeGeometry=function(){},t.prototype.writeFeatures=function(){},t}(Up);function cy(t,e,i){if(3===t){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(py,r,n),r.length=r.features.length,r.length&&(e[r.name]=r)}}function py(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 r=null,n=i.readVarint()+i.pos;i.pos<n;)r=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(r)}}function dy(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[n]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function fy(t,e,i){t.pos=e.features[i];var r=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(dy,n,r),n}var _y=[null],gy=fd(_y,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:xy}),yy=fd(_y,{node:function(t,e){var i=e[0],r=e[e.length-1],n=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];r.nodes[n]=o;var s=gd({tags:{}},my,t,e);if(!Tt(s.tags)){var a=new Dr(o);Yp(a,!1,i);var h=new Ji(a);h.setId(n),h.setProperties(s.tags),r.features.push(h)}},way:function(t,e){var i=gd({id:t.getAttribute("id"),ndrefs:[],tags:{}},gy,t,e);e[e.length-1].ways.push(i)}}),vy=function(t){function e(){t.call(this),this.dataProjection=ne("EPSG:4326")}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.readFeaturesFromNode=function(t,e){var i=this.getReadOptions(t,e);if("osm"==t.localName){for(var r=gd({nodes:{},ways:[],features:[]},yy,t,[i]),n=0;n<r.ways.length;n++){for(var o=r.ways[n],s=[],a=0,h=o.ndrefs.length;a<h;a++){pr(s,r.nodes[o.ndrefs[a]])}var l=void 0;Yp(l=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new Qr(s,yr.XY,[s.length]):new Sn(s,yr.XY),!1,i);var u=new Ji(l);u.setId(o.id),u.setProperties(o.tags),r.features.push(u)}if(r.features)return r.features}return[]},e.prototype.writeFeatureNode=function(t,e){},e.prototype.writeFeaturesNode=function(t,e){},e.prototype.writeGeometryNode=function(t,e){},e}(md),my=fd(_y,{tag:xy});function xy(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}function Sy(t,e,i,r,n,o){var s,a;void 0!==n?(s=n,a=void 0!==o?o:0):(s=[],a=0);for(var h=e;h<i;){var l=t[h++];s[a++]=t[h++],s[a++]=l;for(var u=2;u<r;++u)s[a++]=t[h++]}return s.length=a,s}var Cy=function(i){function t(t){i.call(this);var e=t||{};this.dataProjection=ne("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:yr.XY}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);return new Ji(i)},t.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},t.prototype.readGeometryFromText=function(t,e){var i=mr(this.geometryLayout_),r=Ty(t,i,this.factor_);Sy(r,0,r.length,i,r);var n=Pr(r,0,r.length,i);return Yp(new Sn(n,this.geometryLayout_),!1,this.adaptOptions(e))},t.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):(Z(!1,40),"")},t.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},t.prototype.writeGeometryText=function(t,e){var i=(t=Yp(t,!0,this.adaptOptions(e))).getFlatCoordinates(),r=t.getStride();return Sy(i,0,i.length,r,i),Ey(i,r,this.factor_)},t}(Pf);function Ey(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=0,a=t.length;s<a;)for(r=0;r<e;++r,++s){var h=t[s],l=h-o[r];o[r]=h,t[s]=l}return wy(t,n)}function Ty(t,e,i){var r,n=i||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var s=Ry(t,n),a=0,h=s.length;a<h;)for(r=0;r<e;++r,++a)o[r]+=s[a],s[a]=o[r];return s}function wy(t,e){for(var i=e||1e5,r=0,n=t.length;r<n;++r)t[r]=Math.round(t[r]*i);return function(t){for(var e=0,i=t.length;e<i;++e){var r=t[e];t[e]=r<0?~(r<<1):r<<1}return function(t){for(var e="",i=0,r=t.length;i<r;++i)e+=Iy(t[i]);return e}(t)}(t)}function Ry(t,e){for(var i=e||1e5,r=function(t){for(var e=function(t){for(var e=[],i=0,r=0,n=0,o=t.length;n<o;++n){var s=t.charCodeAt(n)-63;i|=(31&s)<<r,s<32?(e.push(i),r=i=0):r+=5}return e}(t),i=0,r=e.length;i<r;++i){var n=e[i];e[i]=1&n?~(n>>1):n>>1}return e}(t),n=0,o=r.length;n<o;++n)r[n]/=i;return r}function Iy(t){for(var e,i="";32<=t;)e=63+(32|31&t),i+=String.fromCharCode(e),t>>=5;return e=t+63,i+=String.fromCharCode(e)}var Ly=function(i){function t(t){i.call(this);var e=t||{};this.layerName_=e.layerName,this.layers_=e.layers?e.layers:null,this.dataProjection=ne(e.dataProjection?e.dataProjection:"EPSG:4326")}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var i,r=t,n=null,o=null;r.transform&&(n=(i=r.transform).scale,o=i.translate);var s=r.arcs;i&&function(t,e,i){for(var r=0,n=t.length;r<n;++r)Oy(t[r],e,i)}(s,n,o);var a,h=[],l=r.objects,u=this.layerName_;for(var c in l)this.layers_&&-1==this.layers_.indexOf(c)||("GeometryCollection"===l[c].type?(a=l[c],h.push.apply(h,Fy(a,s,n,o,u,c,e))):(a=l[c],h.push(My(a,s,n,o,u,c,e))));return h}return[]},t.prototype.readProjectionFromObject=function(t){return this.dataProjection},t.prototype.writeFeatureObject=function(t,e){},t.prototype.writeFeaturesObject=function(t,e){},t.prototype.writeGeometryObject=function(t,e){},t.prototype.readGeometryFromObject=function(){},t.prototype.readFeatureFromObject=function(){},t}(Bp),by={Point:function(t,e,i){var r=t.coordinates;e&&i&&Ny(r,e,i);return new Dr(r)},LineString:function(t,e){var i=Py(t.arcs,e);return new Sn(i)},Polygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=Py(t.arcs[r],e);return new Qr(i)},MultiPoint:function(t,e,i){var r=t.coordinates;if(e&&i)for(var n=0,o=r.length;n<o;++n)Ny(r[n],e,i);return new ih(r)},MultiLineString:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r)i[r]=Py(t.arcs[r],e);return new eh(i)},MultiPolygon:function(t,e){for(var i=[],r=0,n=t.arcs.length;r<n;++r){for(var o=t.arcs[r],s=[],a=0,h=o.length;a<h;++a)s[a]=Py(o[a],e);i[r]=s}return new nh(i)}};function Py(t,e){for(var i,r,n=[],o=0,s=t.length;o<s;++o)i=t[o],0<o&&n.pop(),r=0<=i?e[i]:e[~i].slice().reverse(),n.push.apply(n,r);for(var a=0,h=n.length;a<h;++a)n[a]=n[a].slice();return n}function Fy(t,e,i,r,n,o,s){for(var a=t.geometries,h=[],l=0,u=a.length;l<u;++l)h[l]=My(a[l],e,i,r,n,o,s);return h}function My(t,e,i,r,n,o,s){var a,h=t.type,l=by[h];a="Point"===h||"MultiPoint"===h?l(t,i,r):l(t,e);var u=new Ji;u.setGeometry(Yp(a,!1,s)),void 0!==t.id&&u.setId(t.id);var c=t.properties;return n&&(c||(c={}),c[n]=o),c&&u.setProperties(c),u}function Oy(t,e,i){for(var r=0,n=0,o=0,s=t.length;o<s;++o){var a=t[o];r+=a[0],n+=a[1],a[0]=r,a[1]=n,Ny(a,e,i)}}function Ny(t,e,i){t[0]=t[0]*e[0]+i[0],t[1]=t[1]*e[1]+i[1]}var Ay=function(t){this.tagName_=t};Ay.prototype.getTagName=function(){return this.tagName_};var Gy=function(i){function t(t,e){i.call(this,t),this.conditions=Array.prototype.slice.call(arguments,1),Z(2<=this.conditions.length,57)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Ay),ky=function(i){function t(t){var e=["And"].concat(Array.prototype.slice.call(arguments));i.apply(this,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Gy),Dy=function(r){function t(t,e,i){r.call(this,"BBOX"),this.geometryName=t,this.extent=e,this.srsName=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Ay),jy=function(n){function t(t,e,i,r){n.call(this,t),this.geometryName=e||"the_geom",this.geometry=i,this.srsName=r}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(Ay),Uy=function(r){function t(t,e,i){r.call(this,"Contains",t,e,i)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(jy),Yy=function(i){function t(t,e){i.call(this,t),this.propertyName=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Ay),By=function(r){function t(t,e,i){r.call(this,"During",t),this.begin=e,this.end=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Yy),Xy=function(n){function t(t,e,i,r){n.call(this,t,e),this.expression=i,this.matchCase=r}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(Yy),zy=function(r){function t(t,e,i){r.call(this,"PropertyIsEqualTo",t,e,i)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Xy),Vy=function(i){function t(t,e){i.call(this,"PropertyIsGreaterThan",t,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Xy),Wy=function(i){function t(t,e){i.call(this,"PropertyIsGreaterThanOrEqualTo",t,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Xy),Ky=function(r){function t(t,e,i){r.call(this,"Intersects",t,e,i)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(jy),Hy=function(r){function t(t,e,i){r.call(this,"PropertyIsBetween",t),this.lowerBoundary=e,this.upperBoundary=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Yy),Zy=function(s){function t(t,e,i,r,n,o){s.call(this,"PropertyIsLike",t),this.pattern=e,this.wildCard=void 0!==i?i:"*",this.singleChar=void 0!==r?r:".",this.escapeChar=void 0!==n?n:"!",this.matchCase=o}return s&&(t.__proto__=s),(t.prototype=Object.create(s&&s.prototype)).constructor=t}(Yy),qy=function(e){function t(t){e.call(this,"PropertyIsNull",t)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(Yy),Jy=function(i){function t(t,e){i.call(this,"PropertyIsLessThan",t,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Xy),Qy=function(i){function t(t,e){i.call(this,"PropertyIsLessThanOrEqualTo",t,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Xy),$y=function(e){function t(t){e.call(this,"Not"),this.condition=t}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(Ay),tv=function(r){function t(t,e,i){r.call(this,"PropertyIsNotEqualTo",t,e,i)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(Xy),ev=function(i){function t(t){var e=["Or"].concat(Array.prototype.slice.call(arguments));i.apply(this,e)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Gy),iv=function(r){function t(t,e,i){r.call(this,"Within",t,e,i)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(jy);function rv(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(ky,e))}function nv(t,e,i){return new Dy(t,e,i)}var ov={"http://www.opengis.net/gml":{boundedBy:hd(Cd.prototype.readGeometryElement,"bounds")}},sv={"http://www.opengis.net/wfs":{totalInserted:hd(Ld),totalUpdated:hd(Ld),totalDeleted:hd(Ld)}},av={"http://www.opengis.net/wfs":{TransactionSummary:hd(function(t,e){return gd({},sv,t,e)},"transactionSummary"),InsertResults:hd(function(t,e){return gd([],yv,t,e)},"insertIds")}},hv={"http://www.opengis.net/wfs":{PropertyName:ld(Nd)}},lv={"http://www.opengis.net/wfs":{Insert:ld(function(t,e,i){var r=i[i.length-1],n=r.featureType,o=r.featureNS,s=r.gmlVersion,a=$p(o,n);t.appendChild(a),2===s?Yd.prototype.writeFeatureElement(a,e,i):kd.prototype.writeFeatureElement(a,e,i)}),Update:ld(function(t,e,i){var r=i[i.length-1];Z(void 0!==e.getId(),27);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=mv(o,n),h=e.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(cv,"xmlns:"+o,s);var l=e.getId();if(void 0!==l){for(var u=e.getKeys(),c=[],p=0,d=u.length;p<d;p++){var f=e.get(u[p]);if(void 0!==f){var _=u[p];f instanceof Ie&&(_=h),c.push({name:_,value:f})}}vd({gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},lv,cd("Property"),c,i),vv(t,l,i)}}),Delete:ld(function(t,e,i){var r=i[i.length-1];Z(void 0!==e.getId(),26);var n=r.featureType,o=r.featurePrefix,s=r.featureNS,a=mv(o,n);t.setAttribute("typeName",a),t.setAttributeNS(cv,"xmlns:"+o,s);var h=e.getId();void 0!==h&&vv(t,h,i)}),Property:ld(function(t,e,i){var r=$p(dv,"Name"),n=i[i.length-1].gmlVersion;if(t.appendChild(r),Nd(r,e.name),void 0!==e.value&&null!==e.value){var o=$p(dv,"Value");t.appendChild(o),e.value instanceof Ie?2===n?Yd.prototype.writeGeometryElement(o,e.value,i):kd.prototype.writeGeometryElement(o,e.value,i):Nd(o,e.value)}}),Native:ld(function(t,e,i){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",e.safeToIgnore);void 0!==e.value&&Nd(t,e.value)})}},uv="feature",cv="http://www.w3.org/2000/xmlns/",pv="http://www.opengis.net/ogc",dv="http://www.opengis.net/wfs",fv={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},_v=function(i){function t(t){i.call(this);var e=t||{};this.featureType_=e.featureType,this.featureNS_=e.featureNS,this.gmlFormat_=e.gmlFormat?e.gmlFormat:new kd,this.schemaLocation_=e.schemaLocation?e.schemaLocation:fv["1.1.0"]}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getFeatureType=function(){return this.featureType_},t.prototype.setFeatureType=function(t){this.featureType_=t},t.prototype.readFeaturesFromNode=function(t,e){var i={featureType:this.featureType_,featureNS:this.featureNS_};C(i,this.getReadOptions(t,e||{}));var r=[i];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[xd].featureMember=od(Cd.prototype.readFeaturesInternal);var n=gd([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,r,this.gmlFormat_);return n||(n=[]),n},t.prototype.readTransactionResponse=function(t){if(ed(t))return this.readTransactionResponseFromDocument(t);if(id(t))return this.readTransactionResponseFromNode(t);if("string"==typeof t){var e=rd(t);return this.readTransactionResponseFromDocument(e)}},t.prototype.readFeatureCollectionMetadata=function(t){if(ed(t))return this.readFeatureCollectionMetadataFromDocument(t);if(id(t))return this.readFeatureCollectionMetadataFromNode(t);if("string"==typeof t){var e=rd(t);return this.readFeatureCollectionMetadataFromDocument(e)}},t.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},t.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},i=bd(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=i,gd(e,ov,t,[],this.gmlFormat_)},t.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},t.prototype.readTransactionResponseFromNode=function(t){return gd({},av,t,[])},t.prototype.writeGetFeature=function(t){var e,i=$p(dv,"GetFeature");if(i.setAttribute("service","WFS"),i.setAttribute("version","1.1.0"),t&&(t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",t.maxFeatures),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",t.startIndex),void 0!==t.count&&i.setAttribute("count",t.count),e=t.filter,t.bbox)){Z(t.geometryName,12);var r=nv(t.geometryName,t.bbox,t.srsName);e=e?rv(e,r):r}i.setAttributeNS(Qp,"xsi:schemaLocation",this.schemaLocation_);var n,o,s,a,h,l={node:i,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]};return Z(Array.isArray(t.featureTypes),11),n=i,o=t.featureTypes,a=(s=[l])[s.length-1],(h=C({},a)).node=n,vd(h,xv,cd("Query"),o,s),i},t.prototype.writeTransaction=function(t,e,i,r){var n,o,s=[],a=$p(dv,"Transaction"),h=r.version?r.version:"1.1.0",l="1.0.0"===h?2:3;a.setAttribute("service","WFS"),a.setAttribute("version",h),r&&(n=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle));var u=fv[h];a.setAttributeNS(Qp,"xsi:schemaLocation",u);var c=r.featurePrefix?r.featurePrefix:uv;return t&&(o={node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName},C(o,n),vd(o,lv,cd("Insert"),t,s)),e&&(o={node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,hasZ:r.hasZ,srsName:r.srsName},C(o,n),vd(o,lv,cd("Update"),e,s)),i&&vd({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},lv,cd("Delete"),i,s),r.nativeElements&&vd({node:a,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:c,gmlVersion:l,srsName:r.srsName},lv,cd("Native"),r.nativeElements,s),a},t.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},t.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var i=[{}];return this.gmlFormat_.readGeometryElement(e,i),ne(i.pop().srsName)}return null},t}(md);var gv={"http://www.opengis.net/ogc":{FeatureId:od(function(t,e){return t.getAttribute("fid")})}};var yv={"http://www.opengis.net/wfs":{Feature:function(t,e){_d(gv,t,e)}}};function vv(t,e,i){var r=$p(pv,"Filter"),n=$p(pv,"FeatureId");r.appendChild(n),n.setAttribute("fid",e),t.appendChild(r)}function mv(t,e){var i=(t=t||uv)+":";return 0===e.indexOf(i)?e:i+e}var xv={"http://www.opengis.net/wfs":{Query:ld(function(t,e,i){var r,n=i[i.length-1],o=n.featurePrefix,s=n.featureNS,a=n.propertyNames,h=n.srsName;r=o?mv(o,e):e;t.setAttribute("typeName",r),h&&t.setAttribute("srsName",h);s&&t.setAttributeNS(cv,"xmlns:"+o,s);var l=C({},n);l.node=t,vd(l,hv,cd("PropertyName"),a,i);var u=n.filter;if(u){var c=$p(pv,"Filter");t.appendChild(c),Sv(c,u,i)}})},"http://www.opengis.net/ogc":{During:ld(function(t,e,i){var r=$p("http://www.opengis.net/fes","ValueReference");Nd(r,e.propertyName),t.appendChild(r);var n=$p(xd,"TimePeriod");t.appendChild(n);var o=$p(xd,"begin");n.appendChild(o),Iv(o,e.begin);var s=$p(xd,"end");n.appendChild(s),Iv(s,e.end)}),And:ld(Cv),Or:ld(Cv),Not:ld(function(t,e,i){var r={node:t},n=e.condition;vd(r,xv,cd(n.getTagName()),[n],i)}),BBOX:ld(function(t,e,i){i[i.length-1].srsName=e.srsName,wv(t,e.geometryName),kd.prototype.writeGeometryElement(t,e.extent,i)}),Contains:ld(function(t,e,i){i[i.length-1].srsName=e.srsName,wv(t,e.geometryName),kd.prototype.writeGeometryElement(t,e.geometry,i)}),Intersects:ld(function(t,e,i){i[i.length-1].srsName=e.srsName,wv(t,e.geometryName),kd.prototype.writeGeometryElement(t,e.geometry,i)}),Within:ld(function(t,e,i){i[i.length-1].srsName=e.srsName,wv(t,e.geometryName),kd.prototype.writeGeometryElement(t,e.geometry,i)}),PropertyIsEqualTo:ld(Ev),PropertyIsNotEqualTo:ld(Ev),PropertyIsLessThan:ld(Ev),PropertyIsLessThanOrEqualTo:ld(Ev),PropertyIsGreaterThan:ld(Ev),PropertyIsGreaterThanOrEqualTo:ld(Ev),PropertyIsNull:ld(function(t,e,i){wv(t,e.propertyName)}),PropertyIsBetween:ld(function(t,e,i){wv(t,e.propertyName);var r=$p(pv,"LowerBoundary");t.appendChild(r),Rv(r,""+e.lowerBoundary);var n=$p(pv,"UpperBoundary");t.appendChild(n),Rv(n,""+e.upperBoundary)}),PropertyIsLike:ld(function(t,e,i){t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());wv(t,e.propertyName),Rv(t,""+e.pattern)})}};function Sv(t,e,i){vd({node:t},xv,cd(e.getTagName()),[e],i)}function Cv(t,e,i){for(var r={node:t},n=e.conditions,o=0,s=n.length;o<s;++o){var a=n[o];vd(r,xv,cd(a.getTagName()),[a],i)}}function Ev(t,e,i){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),wv(t,e.propertyName),Rv(t,""+e.expression)}function Tv(t,e,i){var r=$p(pv,t);Nd(r,i),e.appendChild(r)}function wv(t,e){Tv("PropertyName",t,e)}function Rv(t,e){Tv("Literal",t,e)}function Iv(t,e){var i=$p(xd,"TimeInstant");t.appendChild(i);var r=$p(xd,"timePosition");i.appendChild(r),Nd(r,e)}var Lv={POINT:Dr,LINESTRING:Sn,POLYGON:Qr,MULTIPOINT:ih,MULTILINESTRING:eh,MULTIPOLYGON:nh},bv="EMPTY",Pv="Z",Fv="M",Mv=1,Ov=2,Nv=3,Av=4,Gv=5,kv=6,Dv={};for(var jv in Lt)Dv[jv]=Lt[jv].toUpperCase();var Uv=function(t){this.wkt=t,this.index_=-1};Uv.prototype.isAlpha_=function(t){return"a"<=t&&t<="z"||"A"<=t&&t<="Z"},Uv.prototype.isNumeric_=function(t,e){return"0"<=t&&t<="9"||"."==t&&!(void 0!==e&&e)},Uv.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},Uv.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},Uv.prototype.nextToken=function(){var t=this.nextChar_(),e={position:this.index_,value:t};if("("==t)e.type=Ov;else if(","==t)e.type=Gv;else if(")"==t)e.type=Nv;else if(this.isNumeric_(t)||"-"==t)e.type=Av,e.value=this.readNumber_();else if(this.isAlpha_(t))e.type=Mv,e.value=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(""!==t)throw new Error("Unexpected character: "+t);e.type=kv}return e},Uv.prototype.readNumber_=function(){for(var t,e=this.index_,i=!1,r=!1;"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_(),this.isNumeric_(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t););return parseFloat(this.wkt.substring(e,this.index_--))},Uv.prototype.readText_=function(){for(var t,e=this.index_;t=this.nextChar_(),this.isAlpha_(t););return this.wkt.substring(e,this.index_--).toUpperCase()};var Yv=function(t){this.lexer_=t,this.token_,this.layout_=yr.XY};Yv.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},Yv.prototype.isTokenType=function(t){return this.token_.type==t},Yv.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},Yv.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},Yv.prototype.parseGeometryLayout_=function(){var t=yr.XY,e=this.token_;if(this.isTokenType(Mv)){var i=e.value;i===Pv?t=yr.XYZ:i===Fv?t=yr.XYM:"ZM"===i&&(t=yr.XYZM),t!==yr.XY&&this.consume_()}return t},Yv.prototype.parseGeometryCollectionText_=function(){if(this.match(Ov)){for(var t=[];t.push(this.parseGeometry_()),this.match(Gv););if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parsePointText_=function(){if(this.match(Ov)){var t=this.parsePoint_();if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},Yv.prototype.parseLineStringText_=function(){if(this.match(Ov)){var t=this.parsePointList_();if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parsePolygonText_=function(){if(this.match(Ov)){var t=this.parseLineStringTextList_();if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parseMultiPointText_=function(){var t;if(this.match(Ov)){if(t=this.token_.type==Ov?this.parsePointTextList_():this.parsePointList_(),this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parseMultiLineStringText_=function(){if(this.match(Ov)){var t=this.parseLineStringTextList_();if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parseMultiPolygonText_=function(){if(this.match(Ov)){var t=this.parsePolygonTextList_();if(this.match(Nv))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},Yv.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,i=0;i<e;++i){var r=this.token_;if(!this.match(Av))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},Yv.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(Gv);)t.push(this.parsePoint_());return t},Yv.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(Gv);)t.push(this.parsePointText_());return t},Yv.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(Gv);)t.push(this.parseLineStringText_());return t},Yv.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(Gv);)t.push(this.parsePolygonText_());return t},Yv.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(Mv)&&this.token_.value==bv;return t&&this.consume_(),t},Yv.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},Yv.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(Mv)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==e){var i=this.parseGeometryCollectionText_();return new Ef(i)}var r,n=Lv[e];if(!n)throw new Error("Invalid geometry type: "+e);switch(e){case"POINT":r=this.parsePointText_();break;case"LINESTRING":r=this.parseLineStringText_();break;case"POLYGON":r=this.parsePolygonText_();break;case"MULTIPOINT":r=this.parseMultiPointText_();break;case"MULTILINESTRING":r=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":r=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+e)}return r||(r=n===Lv.POINT?[NaN,NaN]:[]),new n(r,this.layout_)}throw new Error(this.formatErrorMessage_())};var Bv=function(i){function t(t){i.call(this);var e=t||{};this.splitCollection_=void 0!==e.splitCollection&&e.splitCollection}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.parse_=function(t){var e=new Uv(t);return new Yv(e).parse()},t.prototype.readFeatureFromText=function(t,e){var i=this.readGeometryFromText(t,e);if(i){var r=new Ji;return r.setGeometry(i),r}return null},t.prototype.readFeaturesFromText=function(t,e){for(var i=[],r=this.readGeometryFromText(t,e),n=[],o=0,s=(i=this.splitCollection_&&r.getType()==Lt.GEOMETRY_COLLECTION?r.getGeometriesArray():[r]).length;o<s;++o){var a=new Ji;a.setGeometry(i[o]),n.push(a)}return n},t.prototype.readGeometryFromText=function(t,e){var i=this.parse_(t);return i?Yp(i,!1,e):null},t.prototype.writeFeatureText=function(t,e){var i=t.getGeometry();return i?this.writeGeometryText(i,e):""},t.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var i=[],r=0,n=t.length;r<n;++r)i.push(t[r].getGeometry());var o=new Ef(i);return this.writeGeometryText(o,e)},t.prototype.writeGeometryText=function(t,e){return Kv(Yp(t,!0,e))},t}(Pf);function Xv(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function zv(t){for(var e=t.getCoordinates(),i=[],r=0,n=e.length;r<n;++r)i.push(e[r].join(" "));return i.join(",")}function Vv(t){for(var e=[],i=t.getLinearRings(),r=0,n=i.length;r<n;++r)e.push("("+zv(i[r])+")");return e.join(",")}var Wv={Point:Xv,LineString:zv,Polygon:Vv,MultiPoint:function(t){for(var e=[],i=t.getPoints(),r=0,n=i.length;r<n;++r)e.push("("+Xv(i[r])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],i=t.getLineStrings(),r=0,n=i.length;r<n;++r)e.push("("+zv(i[r])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],i=t.getPolygons(),r=0,n=i.length;r<n;++r)e.push("("+Vv(i[r])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],i=t.getGeometries(),r=0,n=i.length;r<n;++r)e.push(Kv(i[r]));return e.join(",")}};function Kv(t){var e,i,r=t.getType(),n=(0,Wv[r])(t);if(r=r.toUpperCase(),t instanceof vr){var o=(e=t.getLayout(),i="",e!==yr.XYZ&&e!==yr.XYZM||(i+=Pv),e!==yr.XYM&&e!==yr.XYZM||(i+=Fv),i);0<o.length&&(r+=" "+o)}return 0===n.length?r+" "+bv:r+"("+n+")"}var Hv="http://www.w3.org/1999/xlink";function Zv(t){return t.getAttributeNS(Hv,"href")}var qv=function(){};qv.prototype.read=function(t){if(ed(t))return this.readFromDocument(t);if(id(t))return this.readFromNode(t);if("string"==typeof t){var e=rd(t);return this.readFromDocument(e)}return null},qv.prototype.readFromDocument=function(t){},qv.prototype.readFromNode=function(t){};var Jv=[null,"http://www.opengis.net/wms"],Qv=fd(Jv,{Service:hd(function(t,e){return gd({},em,t,e)}),Capability:hd(function(t,e){return gd({},$v,t,e)})}),$v=fd(Jv,{Request:hd(function(t,e){return gd({},lm,t,e)}),Exception:hd(function(t,e){return gd([],om,t,e)}),Layer:hd(function(t,e){return gd({},sm,t,e)})}),tm=function(t){function e(){t.call(this),this.version=void 0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=gd({version:this.version},Qv,t,[]);return e||null},e}(qv),em=fd(Jv,{Name:hd(Pd),Title:hd(Pd),Abstract:hd(Pd),KeywordList:hd(mm),OnlineResource:hd(Zv),ContactInformation:hd(function(t,e){return gd({},im,t,e)}),Fees:hd(Pd),AccessConstraints:hd(Pd),LayerLimit:hd(Ld),MaxWidth:hd(Ld),MaxHeight:hd(Ld)}),im=fd(Jv,{ContactPersonPrimary:hd(function(t,e){return gd({},rm,t,e)}),ContactPosition:hd(Pd),ContactAddress:hd(function(t,e){return gd({},nm,t,e)}),ContactVoiceTelephone:hd(Pd),ContactFacsimileTelephone:hd(Pd),ContactElectronicMailAddress:hd(Pd)}),rm=fd(Jv,{ContactPerson:hd(Pd),ContactOrganization:hd(Pd)}),nm=fd(Jv,{AddressType:hd(Pd),Address:hd(Pd),City:hd(Pd),StateOrProvince:hd(Pd),PostCode:hd(Pd),Country:hd(Pd)}),om=fd(Jv,{Format:od(Pd)}),sm=fd(Jv,{Name:hd(Pd),Title:hd(Pd),Abstract:hd(Pd),KeywordList:hd(mm),CRS:ad(Pd),EX_GeographicBoundingBox:hd(function(t,e){var i=gd({},hm,t,e);if(!i)return;var r=i.westBoundLongitude,n=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===n||void 0===o||void 0===s)return;return[r,n,o,s]}),BoundingBox:ad(function(t,e){var i=[Id(t.getAttribute("minx")),Id(t.getAttribute("miny")),Id(t.getAttribute("maxx")),Id(t.getAttribute("maxy"))],r=[Id(t.getAttribute("resx")),Id(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}}),Dimension:ad(function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Td(t.getAttribute("multipleValues")),nearestValue:Td(t.getAttribute("nearestValue")),current:Td(t.getAttribute("current")),values:Pd(t)}}),Attribution:hd(function(t,e){return gd({},am,t,e)}),AuthorityURL:ad(function(t,e){var i=gm(t,e);if(i)return i.name=t.getAttribute("name"),i;return}),Identifier:ad(Pd),MetadataURL:ad(function(t,e){var i=gm(t,e);if(i)return i.type=t.getAttribute("type"),i;return}),DataURL:ad(gm),FeatureListURL:ad(gm),Style:ad(function(t,e){return gd({},dm,t,e)}),MinScaleDenominator:hd(Rd),MaxScaleDenominator:hd(Rd),Layer:ad(function(t,e){var i=e[e.length-1],r=gd({},sm,t,e);if(!r)return;var n=Td(t.getAttribute("queryable"));void 0===n&&(n=i.queryable);r.queryable=void 0!==n&&n;var o=bd(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded);r.cascaded=o;var s=Td(t.getAttribute("opaque"));void 0===s&&(s=i.opaque);r.opaque=void 0!==s&&s;var a=Td(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets);r.noSubsets=void 0!==a&&a;var h=Id(t.getAttribute("fixedWidth"));h||(h=i.fixedWidth);r.fixedWidth=h;var l=Id(t.getAttribute("fixedHeight"));l||(l=i.fixedHeight);r.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(t){if(t in i){var e=r[t]||[];r[t]=e.concat(i[t])}});return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(t){if(!(t in r)){var e=i[t];r[t]=e}}),r})}),am=fd(Jv,{Title:hd(Pd),OnlineResource:hd(Zv),LogoURL:hd(vm)}),hm=fd(Jv,{westBoundLongitude:hd(Rd),eastBoundLongitude:hd(Rd),southBoundLatitude:hd(Rd),northBoundLatitude:hd(Rd)}),lm=fd(Jv,{GetCapabilities:hd(ym),GetMap:hd(ym),GetFeatureInfo:hd(ym)}),um=fd(Jv,{Format:ad(Pd),DCPType:ad(function(t,e){return gd({},cm,t,e)})}),cm=fd(Jv,{HTTP:hd(function(t,e){return gd({},pm,t,e)})}),pm=fd(Jv,{Get:hd(gm),Post:hd(gm)}),dm=fd(Jv,{Name:hd(Pd),Title:hd(Pd),Abstract:hd(Pd),LegendURL:ad(vm),StyleSheetURL:hd(gm),StyleURL:hd(gm)}),fm=fd(Jv,{Format:hd(Pd),OnlineResource:hd(Zv)}),_m=fd(Jv,{Keyword:od(Pd)});function gm(t,e){return gd({},fm,t,e)}function ym(t,e){return gd({},um,t,e)}function vm(t,e){var i=gm(t,e);if(i){var r=[bd(t.getAttribute("width")),bd(t.getAttribute("height"))];return i.size=r,i}}function mm(t,e){return gd([],_m,t,e)}var xm=function(i){function t(t){i.call(this);var e=t||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new Yd,this.layers_=e.layers?e.layers:null}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getLayers=function(){return this.layers_},t.prototype.setLayers=function(t){this.layers_=t},t.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var n=0,o=t.childNodes.length;n<o;n++){var s=t.childNodes[n];if(s.nodeType===Node.ELEMENT_NODE){var a=e[0],h=s.localName.replace("_layer","");if(!this.layers_||lr(this.layers_,h)){var l=h+"_feature";a.featureType=l,a.featureNS=this.featureNS_;var u={};u[l]=od(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var c=fd([a.featureNS,null],u);s.setAttribute("namespaceURI",this.featureNS_);var p=gd([],c,s,e,this.gmlFormat_);p&&pr(r,p)}}}if("FeatureCollection"==i){var d=gd([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);d&&(r=d)}return r},t.prototype.readFeaturesFromNode=function(t,e){var i={};return e&&C(i,this.getReadOptions(t,e)),this.readFeatures_(t,[i])},t.prototype.writeFeatureNode=function(t,e){},t.prototype.writeFeaturesNode=function(t,e){},t.prototype.writeGeometryNode=function(t,e){},t}(md),Sm=[null,"http://www.opengis.net/ows/1.1"],Cm=fd(Sm,{ServiceIdentification:hd(function(t,e){return gd({},Am,t,e)}),ServiceProvider:hd(function(t,e){return gd({},Gm,t,e)}),OperationsMetadata:hd(function(t,e){return gd({},Fm,t,e)})}),Em=function(t){function e(){t.call(this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=gd({},Cm,t,[]);return e||null},e}(qv),Tm=fd(Sm,{DeliveryPoint:hd(Pd),City:hd(Pd),AdministrativeArea:hd(Pd),PostalCode:hd(Pd),Country:hd(Pd),ElectronicMailAddress:hd(Pd)}),wm=fd(Sm,{Value:ad(function(t,e){return Pd(t)})}),Rm=fd(Sm,{AllowedValues:hd(function(t,e){return gd({},wm,t,e)})}),Im=fd(Sm,{Phone:hd(function(t,e){return gd({},Mm,t,e)}),Address:hd(function(t,e){return gd({},Tm,t,e)})}),Lm=fd(Sm,{HTTP:hd(function(t,e){return gd({},bm,t,e)})}),bm=fd(Sm,{Get:ad(function(t,e){var i=Zv(t);if(!i)return;return gd({href:i},Om,t,e)}),Post:void 0}),Pm=fd(Sm,{DCP:hd(function(t,e){return gd({},Lm,t,e)})}),Fm=fd(Sm,{Operation:function(t,e){var i=t.getAttribute("name"),r=gd({},Pm,t,e);if(!r)return;e[e.length-1][i]=r}}),Mm=fd(Sm,{Voice:hd(Pd),Facsimile:hd(Pd)}),Om=fd(Sm,{Constraint:ad(function(t,e){var i=t.getAttribute("name");if(!i)return;return gd({name:i},Rm,t,e)})}),Nm=fd(Sm,{IndividualName:hd(Pd),PositionName:hd(Pd),ContactInfo:hd(function(t,e){return gd({},Im,t,e)})}),Am=fd(Sm,{Abstract:hd(Pd),AccessConstraints:hd(Pd),Fees:hd(Pd),Title:hd(Pd),ServiceTypeVersion:hd(Pd),ServiceType:hd(Pd)}),Gm=fd(Sm,{ProviderName:hd(Pd),ProviderSite:hd(Zv),ServiceContact:hd(function(t,e){return gd({},Nm,t,e)})});var km=[null,"http://www.opengis.net/wmts/1.0"],Dm=[null,"http://www.opengis.net/ows/1.1"],jm=fd(km,{Contents:hd(function(t,e){return gd({},Ym,t,e)})}),Um=function(t){function e(){t.call(this),this.owsParser_=new Em}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=t.getAttribute("version").trim(),i=this.owsParser_.readFromNode(t);return i?(i.version=e,(i=gd(i,jm,t,[]))||null):null},e}(qv),Ym=fd(km,{Layer:ad(function(t,e){return gd({},Bm,t,e)}),TileMatrixSet:ad(function(t,e){return gd({},Zm,t,e)})}),Bm=fd(km,{Style:ad(function(t,e){var i=gd({},Xm,t,e);if(!i)return;var r="true"===t.getAttribute("isDefault");return i.isDefault=r,i}),Format:ad(Pd),TileMatrixSetLink:ad(function(t,e){return gd({},zm,t,e)}),Dimension:ad(function(t,e){return gd({},Km,t,e)}),ResourceURL:ad(function(t,e){var i=t.getAttribute("format"),r=t.getAttribute("template"),n=t.getAttribute("resourceType"),o={};i&&(o.format=i);r&&(o.template=r);n&&(o.resourceType=n);return o})},fd(Dm,{Title:hd(Pd),Abstract:hd(Pd),WGS84BoundingBox:hd(function(t,e){var i=gd([],Hm,t,e);if(2!=i.length)return;return A(i)}),Identifier:hd(Pd)})),Xm=fd(km,{LegendURL:ad(function(t,e){var i={};return i.format=t.getAttribute("format"),i.href=Zv(t),i})},fd(Dm,{Title:hd(Pd),Identifier:hd(Pd)})),zm=fd(km,{TileMatrixSet:hd(Pd),TileMatrixSetLimits:hd(function(t,e){return gd([],Vm,t,e)})}),Vm=fd(km,{TileMatrixLimits:od(function(t,e){return gd({},Wm,t,e)})}),Wm=fd(km,{TileMatrix:hd(Pd),MinTileRow:hd(Ld),MaxTileRow:hd(Ld),MinTileCol:hd(Ld),MaxTileCol:hd(Ld)}),Km=fd(km,{Default:hd(Pd),Value:ad(Pd)},fd(Dm,{Identifier:hd(Pd)})),Hm=fd(Dm,{LowerCorner:od(Jm),UpperCorner:od(Jm)}),Zm=fd(km,{WellKnownScaleSet:hd(Pd),TileMatrix:ad(function(t,e){return gd({},qm,t,e)})},fd(Dm,{SupportedCRS:hd(Pd),Identifier:hd(Pd)})),qm=fd(km,{TopLeftCorner:hd(Jm),ScaleDenominator:hd(Rd),TileWidth:hd(Ld),TileHeight:hd(Ld),MatrixWidth:hd(Ld),MatrixHeight:hd(Ld)},fd(Dm,{Identifier:hd(Pd)}));function Jm(t,e){var i=Pd(t).split(" ");if(i&&2==i.length){var r=+i[0],n=+i[1];if(!isNaN(r)&&!isNaN(n))return[r,n]}}var Qm="blur",$m="gradient",tx="radius",ex=["#00f","#0ff","#0f0","#ff0","#f00"],ix=function(n){function t(t){var e=t||{},i=C({},e);delete i.gradient,delete i.radius,delete i.blur,delete i.shadow,delete i.weight,n.call(this,i),this.gradient_=null,this.shadow_=void 0!==e.shadow?e.shadow:250,this.circleImage_=void 0,this.styleCache_=null,E(this,b($m),this.handleGradientChanged_,this),this.setGradient(e.gradient?e.gradient:ex),this.setBlur(void 0!==e.blur?e.blur:15),this.setRadius(void 0!==e.radius?e.radius:8),E(this,b(Qm),this.handleStyleChanged_,this),E(this,b(tx),this.handleStyleChanged_,this),this.handleStyleChanged_();var s,r=e.weight?e.weight:"weight";s="string"==typeof r?function(t){return t.get(r)}:r,this.setStyle(function(t,e){var i=s(t),r=void 0!==i?gt(i,0,1):1,n=255*r|0,o=this.styleCache_[n];return o||(o=[new Wi({image:new Qf({opacity:r,src:this.circleImage_})})],this.styleCache_[n]=o),o}.bind(this)),this.setRenderOrder(null),E(this,wn,this.handleRender_,this)}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.createCircle_=function(){var t=this.getRadius(),e=this.getBlur(),i=t+e+1,r=2*i,n=De(r,r);n.shadowOffsetX=n.shadowOffsetY=this.shadow_,n.shadowBlur=e,n.shadowColor="#000",n.beginPath();var o=i-this.shadow_;return n.arc(o,o,t,0,2*Math.PI,!0),n.fill(),n.canvas.toDataURL()},t.prototype.getBlur=function(){return this.get(Qm)},t.prototype.getGradient=function(){return this.get($m)},t.prototype.getRadius=function(){return this.get(tx)},t.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=De(1,256),i=e.createLinearGradient(0,0,1,256),r=1/(t.length-1),n=0,o=t.length;n<o;++n)i.addColorStop(n*r,t[n]);return e.fillStyle=i,e.fillRect(0,0,1,256),e.getImageData(0,0,1,256).data}(this.getGradient())},t.prototype.handleStyleChanged_=function(){this.circleImage_=this.createCircle_(),this.styleCache_=new Array(256),this.changed()},t.prototype.handleRender_=function(t){for(var e=t.context,i=e.canvas,r=e.getImageData(0,0,i.width,i.height),n=r.data,o=0,s=n.length;o<s;o+=4){var a=4*n[o+3];a&&(n[o]=this.gradient_[a],n[o+1]=this.gradient_[a+1],n[o+2]=this.gradient_[a+2])}e.putImageData(r,0,0)},t.prototype.setBlur=function(t){this.set(Qm,t)},t.prototype.setGradient=function(t){this.set($m,t)},t.prototype.setRadius=function(t){this.set(tx,t)},t}(lh);var rx=function(i){function t(t){var e=t||{};i.call(this,e),this.type=oh.IMAGE}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Ls);rx.prototype.getSource;var nx="preload",ox="useInterimTilesOnError",sx=function(r){function t(t){var e=t||{},i=C({},e);delete i.preload,delete i.useInterimTilesOnError,r.call(this,i),this.setPreload(void 0!==e.preload?e.preload:0),this.setUseInterimTilesOnError(void 0===e.useInterimTilesOnError||e.useInterimTilesOnError),this.type=oh.TILE}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.getPreload=function(){return this.get(nx)},t.prototype.setPreload=function(t){this.set(nx,t)},t.prototype.getUseInterimTilesOnError=function(){return this.get(ox)},t.prototype.setUseInterimTilesOnError=function(t){this.set(ox,t)},t}(Ls);sx.prototype.getSource;var ax=function(n){function t(t){var e=t||{},i=e.renderMode||Au;Z(null==i||i==Nu||i==Au||i==Gu,28),e.declutter&&i==Nu&&(i=Au),e.renderMode=i;var r=C({},e);delete r.preload,delete r.useInterimTilesOnError,n.call(this,r),this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(void 0===e.useInterimTilesOnError||e.useInterimTilesOnError),this.type=oh.VECTOR_TILE}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.getPreload=function(){return this.get(nx)},t.prototype.getUseInterimTilesOnError=function(){return this.get(ox)},t.prototype.setPreload=function(t){this.set(nx,t)},t.prototype.setUseInterimTilesOnError=function(t){this.set(ox,t)},t}(lh);function hx(t,e,i,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=i,r):[t,e,i]}function lx(t,e,i){return t+"/"+e+"/"+i}function ux(t){return lx(t[0],t[1],t[2])}function cx(t){return(t[1]<<t[0])+t[2]}function px(r,n){var o=/\{z\}/g,s=/\{x\}/g,a=/\{y\}/g,h=/\{-y\}/g;return function(i,t,e){return i?r.replace(o,i[0].toString()).replace(s,i[1].toString()).replace(a,function(){return(-i[2]-1).toString()}).replace(h,function(){var t=i[0],e=n.getFullTileRange(t);return Z(e,55),(e.getHeight()+i[2]).toString()}):void 0}}function dx(t,e){for(var i=t.length,r=new Array(i),n=0;n<i;++n)r[n]=px(t[n],e);return fx(r)}function fx(n){return 1===n.length?n[0]:function(t,e,i){if(t){var r=Ct(cx(t),n.length);return n[r](t,e,i)}}}function _x(t,e,i){}function gx(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r,n=i[1].charCodeAt(0),o=i[2].charCodeAt(0);for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}function yx(t,e,i,r){var n=document.createElement("script"),o="olc_"+Et(e);function s(){delete window[o],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+o;var a=setTimeout(function(){s(),i&&i()},1e4);window[o]=function(t){clearTimeout(a),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}ax.prototype.getSource;var vx=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),i=e.tileCoord[0].toString();if(i in t&&t[i].contains(e.tileCoord))break;this.pop().dispose()}},t.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=t.split("/").map(Number)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(ux(t.tileCoord)),t.dispose())},this)}},t}(mi);function mx(t,e,i,r){var n=de(i,e,t),o=oe(e,r,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var h=t.getExtent();if(!h||j(h,n)){var l=oe(t,o,n)/o;isFinite(l)&&0<l&&(o/=l)}return o}function xx(t,e,i,r){var n=i-t,o=r-e,s=Math.sqrt(n*n+o*o);return[Math.round(i+n/s),Math.round(r+o/s)]}function Sx(t,e,w,R,i,I,r,n,o,a,s){var L=De(Math.round(w*t),Math.round(w*e));if(0===o.length)return L.canvas;L.scale(w,w);var b=[1/0,1/0,-1/0,-1/0];o.forEach(function(t,e,i){H(b,t.extent)});var h=ct(b),l=at(b),P=De(Math.round(w*h/R),Math.round(w*l/R)),u=w/R;o.forEach(function(t,e,i){var r=t.extent[0]-b[0],n=-(t.extent[3]-b[3]),o=ct(t.extent),s=at(t.extent);P.drawImage(t.image,a,a,t.image.width-2*a,t.image.height-2*a,r*u,n*u,o*u,s*u)});var F=lt(r);return n.getTriangles().forEach(function(t,e,i){var r=t.source,n=t.target,o=r[0][0],s=r[0][1],a=r[1][0],h=r[1][1],l=r[2][0],u=r[2][1],c=(n[0][0]-F[0])/I,p=-(n[0][1]-F[1])/I,d=(n[1][0]-F[0])/I,f=-(n[1][1]-F[1])/I,_=(n[2][0]-F[0])/I,g=-(n[2][1]-F[1])/I,y=o,v=s,m=function(t){for(var e=t.length,i=0;i<e;i++){for(var r=i,n=Math.abs(t[i][i]),o=i+1;o<e;o++){var s=Math.abs(t[o][i]);n<s&&(n=s,r=o)}if(0===n)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var h=i+1;h<e;h++)for(var l=-t[h][i]/t[i][i],u=i;u<e+1;u++)i==u?t[h][u]=0:t[h][u]+=l*t[i][u]}for(var c=new Array(e),p=e-1;0<=p;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;0<=d;d--)t[d][e]-=t[d][p]*c[p]}return c}([[a-=y,h-=v,s=o=0,0,d-c],[l-=y,u-=v,0,0,_-c],[0,0,a,h,f-p],[0,0,l,u,g-p]]);if(m){L.save(),L.beginPath();var x=(c+d+_)/3,S=(p+f+g)/3,C=xx(x,S,c,p),E=xx(x,S,d,f),T=xx(x,S,_,g);L.moveTo(E[0],E[1]),L.lineTo(C[0],C[1]),L.lineTo(T[0],T[1]),L.clip(),L.transform(m[0],m[2],m[1],m[3],c,p),L.translate(b[0]-y,b[3]-v),L.scale(R/w,-R/w),L.drawImage(P.canvas,0,0),L.restore()}}),s&&(L.save(),L.strokeStyle="black",L.lineWidth=1,n.getTriangles().forEach(function(t,e,i){var r=t.target,n=(r[0][0]-F[0])/I,o=-(r[0][1]-F[1])/I,s=(r[1][0]-F[0])/I,a=-(r[1][1]-F[1])/I,h=(r[2][0]-F[0])/I,l=-(r[2][1]-F[1])/I;L.beginPath(),L.moveTo(s,a),L.lineTo(n,o),L.lineTo(h,l),L.closePath(),L.stroke()}),L.restore()),L.canvas}var Cx=function(t,e,i,r,n){this.sourceProj_=t,this.targetProj_=e;var o={},s=pe(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=s(t)),o[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&ct(r)==ct(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ct(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ct(this.targetProj_.getExtent()):null;var a=lt(i),h=ut(i),l=nt(i),u=rt(i),c=this.transformInv_(a),p=this.transformInv_(h),d=this.transformInv_(l),f=this.transformInv_(u);if(this.addQuad_(a,h,l,u,c,p,d,f,10),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach(function(t,e,i){_=Math.min(_,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])-_>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]-_>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-_>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-_>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))}o={}};Cx.prototype.addTriangle_=function(t,e,i,r,n,o){this.triangles_.push({source:[r,n,o],target:[t,e,i]})},Cx.prototype.addQuad_=function(t,e,i,r,n,o,s,a,h){var l=A([n,o,s,a]),u=this.sourceWorldWidth_?ct(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&.5<u&&u<1,d=!1;if(0<h){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d|=.25<ct(A([t,e,i,r]))/this.targetWorldWidth_;!p&&this.sourceProj_.isGlobal()&&u&&(d|=.25<u)}if(d||!this.maxSourceExtent_||wt(l,this.maxSourceExtent_)){if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(0<h))return;d=!0}if(0<h){if(!d){var f,_=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_);if(p)f=(Ct(n[0],c)+Ct(s[0],c))/2-Ct(g[0],c);else f=(n[0]+s[0])/2-g[0];var y=(n[1]+s[1])/2-g[1];d=f*f+y*y>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var v=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(v),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],S=this.transformInv_(x);this.addQuad_(t,e,v,x,n,o,m,S,h-1),this.addQuad_(x,v,i,r,S,m,s,a,h-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+r[0])/2,(i[1]+r[1])/2],w=this.transformInv_(T);this.addQuad_(t,C,T,r,n,E,w,a,h-1),this.addQuad_(C,e,i,T,E,o,s,w,h-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,r,n,s,a),this.addTriangle_(t,e,i,n,o,s)}},Cx.prototype.calculateSourceExtent=function(){var n=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(t,e,i){var r=t.source;q(n,r[0]),q(n,r[1]),q(n,r[2])}),n},Cx.prototype.getTriangles=function(){return this.triangles_};var Ex=function(T){function t(t,e,i,r,n,o,s,a,h,l,u){T.call(this,n,Nn),this.renderEdges_=void 0!==u&&u,this.pixelRatio_=s,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=r,this.wrappedTileCoord_=o||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var c=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),d=this.sourceTileGrid_.getExtent(),f=p?ht(c,p):c;if(0!==it(f)){var _=t.getExtent();_&&(d=d?ht(d,_):_);var g=r.getResolution(this.wrappedTileCoord_[0]),y=mx(t,i,ot(f),g);if(!isFinite(y)||y<=0)this.state=Dn;else{var v=void 0!==l?l:.5;if(this.triangulation_=new Cx(t,i,f,d,y*v),0!==this.triangulation_.getTriangles().length){this.sourceZ_=e.getZForResolution(y);var m=this.triangulation_.calculateSourceExtent();if(d&&(t.canWrapX()?(m[1]=gt(m[1],d[1],d[3]),m[3]=gt(m[3],d[1],d[3])):m=ht(m,d)),it(m)){for(var x=e.getTileRangeForExtentAndZ(m,this.sourceZ_),S=x.minX;S<=x.maxX;S++)for(var C=x.minY;C<=x.maxY;C++){var E=h(this.sourceZ_,S,C,s);E&&this.sourceTiles_.push(E)}0===this.sourceTiles_.length&&(this.state=Dn)}else this.state=Dn}else this.state=Dn}}else this.state=Dn}return T&&(t.__proto__=T),((t.prototype=Object.create(T&&T.prototype)).constructor=t).prototype.disposeInternal=function(){this.state==An&&this.unlistenSources_(),T.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.canvas_},t.prototype.reproject_=function(){var r=[];if(this.sourceTiles_.forEach(function(t,e,i){t&&t.getState()==Gn&&r.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}.bind(this)),(this.sourceTiles_.length=0)===r.length)this.state=kn;else{var t=this.wrappedTileCoord_[0],e=this.targetTileGrid_.getTileSize(t),i="number"==typeof e?e:e[0],n="number"==typeof e?e:e[1],o=this.targetTileGrid_.getResolution(t),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Sx(i,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,r,this.gutter_,this.renderEdges_),this.state=Gn}this.changed()},t.prototype.load=function(){if(this.state==Nn){this.state=An,this.changed();var o=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(i,t,e){var r=i.getState();if(r==Nn||r==An){o++;var n=E(i,w.CHANGE,function(t){var e=i.getState();e!=Gn&&e!=kn&&e!=Dn||(g(n),0===--o&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}.bind(this)),this.sourceTiles_.forEach(function(t,e,i){t.getState()==Nn&&t.load()}),0===o&&setTimeout(this.reproject_.bind(this),0)}},t.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(g),this.sourcesListenerKeys_=null},t}(zn),Tx=[0,0,0],wx=function(t){var r,n,o,e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Z((r=this.resolutions_,n=!0,o=function(t,e){return e-t}||hr,r.every(function(t,e){if(0===e)return!0;var i=o(r[e-1],t);return!(0<i||n&&0===i)})),17),!t.origins)for(var i=0,s=this.resolutions_.length-1;i<s;++i)if(e){if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}else e=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=e,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,Z(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=lt(a)),Z(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Z(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:$o,Z(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map(function(t,e){return new Vl(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this):a&&this.calculateTileRanges_(a)};function Rx(t){var e=t.getDefaultTileGrid();return e||(e=Px(t),t.setDefaultTileGrid(e)),e}function Ix(t,e,i,r){var n,o,s,a=void 0!==r?r:O.TOP_LEFT,h=bx(t,e,i);return new wx({extent:t,origin:(n=t,o=a,o===O.BOTTOM_LEFT?s=rt(n):o===O.BOTTOM_RIGHT?s=nt(n):o===O.TOP_LEFT?s=lt(n):o===O.TOP_RIGHT?s=ut(n):Z(!1,13),s),resolutions:h,tileSize:i})}function Lx(t){var e={};return C(e,void 0!==t?t:{}),void 0===e.extent&&(e.extent=ne("EPSG:3857").getExtent()),e.resolutions=bx(e.extent,e.maxZoom,e.tileSize),delete e.maxZoom,new wx(e)}function bx(t,e,i){for(var r=void 0!==e?e:Qo,n=at(t),o=ct(t),s=ws(void 0!==i?i:$o),a=Math.max(o/s[0],n/s[1]),h=r+1,l=new Array(h),u=0;u<h;++u)l[u]=a/Math.pow(2,u);return l}function Px(t,e,i,r){return Ix(Fx(t),e,i,r)}function Fx(t){var e=(t=ne(t)).getExtent();if(!e){var i=180*Nt[Ot.DEGREES]/t.getMetersPerUnit();e=X(-i,-i,i,i)}return e}wx.prototype.forEachTileCoord=function(t,e,i){for(var r=this.getTileRangeForExtentAndZ(t,e),n=r.minX,o=r.maxX;n<=o;++n)for(var s=r.minY,a=r.maxY;s<=a;++s)i([e,n,s])},wx.prototype.forEachTileCoordParentTileRange=function(t,e,i,r,n){var o,s,a,h=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],a=t[2]):h=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(o=2===this.zoomFactor_?Wl(s=Math.floor(s/2),s,a=Math.floor(a/2),a,r):this.getTileRangeForExtentAndZ(h,l,r),e.call(i,l,o))return!0;--l}return!1},wx.prototype.getExtent=function(){return this.extent_},wx.prototype.getMaxZoom=function(){return this.maxZoom},wx.prototype.getMinZoom=function(){return this.minZoom},wx.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},wx.prototype.getResolution=function(t){return this.resolutions_[t]},wx.prototype.getResolutions=function(){return this.resolutions_},wx.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],n=2*t[2];return Wl(r,r+1,n,n+1,e)}var o=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},wx.prototype.getTileRangeExtent=function(t,e,i){var r=this.getOrigin(t),n=this.getResolution(t),o=ws(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*n,a=r[0]+(e.maxX+1)*o[0]*n;return X(s,r[1]+e.minY*o[1]*n,a,r[1]+(e.maxY+1)*o[1]*n,i)},wx.prototype.getTileRangeForExtentAndZ=function(t,e,i){var r=Tx;this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r);var n=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[3],e,!0,r),Wl(n,r[1],o,r[2],i)},wx.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=ws(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*i,e[1]+(t[2]+.5)*r[1]*i]},wx.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=ws(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*n[0]*r,s=i[1]+t[2]*n[1]*r;return X(o,s,o+n[0]*r,s+n[1]*r,e)},wx.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},wx.prototype.getTileCoordForXYAndResolution_=function(t,e,i,r,n){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),h=ws(this.getTileSize(o),this.tmpSize_),l=r?.5:0,u=r?0:.5,c=Math.floor((t-a[0])/i+l),p=Math.floor((e-a[1])/i+u),d=s*c/h[0],f=s*p/h[1];return r?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),hx(o,d,f,n)},wx.prototype.getTileCoordForXYAndZ_=function(t,e,i,r,n){var o=this.getOrigin(i),s=this.getResolution(i),a=ws(this.getTileSize(i),this.tmpSize_),h=r?.5:0,l=r?0:.5,u=Math.floor((t-o[0])/s+h),c=Math.floor((e-o[1])/s+l),p=u/a[0],d=c/a[1];return r?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),hx(i,p,d,n)},wx.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},wx.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},wx.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},wx.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},wx.prototype.getZForResolution=function(t,e){return gt(ur(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},wx.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),r=this.minZoom;r<e;++r)i[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=i};var Mx=function(e){function t(t){e.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new vx(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},t.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},t.prototype.forEachLoadedTile=function(t,e,i,r){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,s,a,h=!0,l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u)s=lx(e,l,u),a=!1,n.containsKey(s)&&(a=(o=n.get(s)).getState()===Gn)&&(a=!1!==r(o)),a||(h=!1);return h},t.prototype.getGutter=function(t){return 0},t.prototype.getKey=function(){return this.key_},t.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},t.prototype.getOpaque=function(t){return this.opaque_},t.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},t.prototype.getTile=function(t,e,i,r,n){},t.prototype.getTileGrid=function(){return this.tileGrid},t.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Rx(t)},t.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!ue(e,t)?null:this.tileCache},t.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},t.prototype.getTilePixelSize=function(t,e,i){var r=this.getTileGridForProjection(i),n=this.getTilePixelRatio(e),o=ws(r.getTileSize(t),this.tmpSize);return 1==n?o:Ts(o,n,this.tmpSize)},t.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var r=e[0],n=t.getTileCoordCenter(e),o=Fx(i);if(j(o,n))return e;var s=ct(o),a=Math.ceil((o[0]-n[0])/s);return n[0]+=s*a,t.getTileCoordForCoordAndZ(n,r)}(r,t,i)),function(t,e){var i=t[0],r=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||o.containsXY(r,n)}(t,r)?t:null},t.prototype.refresh=function(){this.tileCache.clear(),this.changed()},t}(fh);Mx.prototype.useTile=L;var Ox=function(i){function t(t,e){i.call(this,t),this.tile=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(m),Nx="tileloadstart",Ax="tileloadend",Gx="tileloaderror",kx=function(e){function t(t){e.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):_x,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getTileLoadFunction=function(){return this.tileLoadFunction},t.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},t.prototype.getUrls=function(){return this.urls},t.prototype.handleTileChange=function(t){var e,i=t.target,r=Et(i),n=i.getState();n==An?(this.tileLoadingKeys_[r]=!0,e=Nx):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=n==kn?Gx:n==Gn||n==jn?Ax:void 0),null!=e&&this.dispatchEvent(new Ox(e,i))},t.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},t.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},t.prototype.setUrl=function(t){var e=this.urls=gx(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):dx(e,this.tileGrid),t)},t.prototype.setUrls=function(t){var e=(this.urls=t).join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):dx(t,this.tileGrid),e)},t.prototype.useTile=function(t,e,i){var r=lx(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},t}(Mx);kx.prototype.fixedTileUrlFunction;var Dx=function(e){function t(t){e.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:jx,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Vn,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},t.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[r];n.expireCache(n==i?e:{})}},t.prototype.getGutter=function(t){return this.getProjection()&&t&&!ue(this.getProjection(),t)?0:this.getGutterInternal()},t.prototype.getGutterInternal=function(){return 0},t.prototype.getOpaque=function(t){return!(this.getProjection()&&t&&!ue(this.getProjection(),t))&&e.prototype.getOpaque.call(this,t)},t.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!ue(e,t)){var i=Et(t).toString();return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Rx(t)),this.tileGridForProjection[i]}return this.tileGrid},t.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||ue(e,t))return this.tileCache;var i=Et(t).toString();return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new vx(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},t.prototype.createTile_=function(t,e,i,r,n,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=a?this.tileUrlFunction(a,r,n):void 0,l=new this.tileClass(s,void 0!==h?Nn:Dn,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,E(l,w.CHANGE,this.handleTileChange,this),l},t.prototype.getTile=function(t,e,i,r,n){var o=this.getProjection();if(o&&n&&!ue(o,n)){var s,a=this.getTileCacheForProjection(n),h=[t,e,i],l=ux(h);a.containsKey(l)&&(s=a.get(l));var u=this.getKey();if(s&&s.key==u)return s;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(h,n),f=new Ex(o,c,n,p,h,d,this.getTilePixelRatio(r),this.getGutterInternal(),function(t,e,i,r){return this.getTileInternal(t,e,i,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=u,s?(f.interimTile=s,f.refreshInterimChain(),a.replace(l,f)):a.set(l,f),f}return this.getTileInternal(t,e,i,r,o||n)},t.prototype.getTileInternal=function(t,e,i,r,n){var o=null,s=lx(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var h=o;o=this.createTile_(t,e,i,r,n,a),h.getState()==Nn?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,r,n,a),this.tileCache.set(s,o);return o},t.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},t.prototype.setTileGridForProjection=function(t,e){var i=ne(t);if(i){var r=Et(i).toString();r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}},t}(kx);function jx(t,e){t.getImage().src=e}var Ux=function(i){function t(t){var e=void 0!==t.hidpi&&t.hidpi;i.call(this,{cacheSize:t.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:ne("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:vs,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.hidpi_=e,this.culture_=void 0!==t.culture?t.culture:"en-us",this.maxZoom_=void 0!==t.maxZoom?t.maxZoom:-1,this.apiKey_=t.key,this.imagerySet_=t.imagerySet,yx("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getApiKey=function(){return this.apiKey_},t.prototype.getImagerySet=function(){return this.imagerySet_},t.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],i=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,r=Fx(this.getProjection()),n=e.imageWidth==e.imageHeight?e.imageWidth:[e.imageWidth,e.imageHeight],o=Lx({extent:r,minZoom:e.zoomMin,maxZoom:i,tileSize:n/(this.hidpi_?2:1)});this.tileGrid=o;var s=this.culture_,a=this.hidpi_;if(this.tileUrlFunction=fx(e.imageUrlSubdomains.map(function(t){var n=[0,0,0],o=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){hx(t[0],t[1],-t[2]-1,n);var r=o;return a&&(r+="&dpi=d1&device=mobile"),r.replace("{quadkey}",function(t){var e,i,r=t[0],n=new Array(r),o=1<<r-1;for(e=0;e<r;++e)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),n[e]=String.fromCharCode(i),o>>=1;return n.join("")}(n))}}})),e.imageryProviders){var u=ce(ne("EPSG:4326"),this.getProjection());this.setAttributions(function(a){var h=[],l=a.viewState.zoom;return e.imageryProviders.map(function(t){for(var e=!1,i=t.coverageAreas,r=0,n=i.length;r<n;++r){var o=i[r];if(l>=o.zoomMin&&l<=o.zoomMax){var s=o.bbox;if(wt(ft([s[1],s[0],s[3],s[2]],u),a.extent)){e=!0;break}}}e&&h.push(t.attribution)}),h.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'),h})}this.setState(ms)}else this.setState(xs)},t}(Dx),Yx=function(n){function t(t){var e=t||{},i=void 0!==e.projection?e.projection:"EPSG:3857",r=void 0!==e.tileGrid?e.tileGrid:Lx({extent:Fx(i),maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});n.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,opaque:e.opaque,projection:i,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(Dx),Bx=function(e){function t(t){e.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,state:vs,wrapX:t.wrapX}),this.account_=t.account,this.mapId_=t.map||"",this.config_=t.config||{},this.templateCache_={},this.initializeMap_()}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getConfig=function(){return this.config_},t.prototype.updateConfig=function(t){C(this.config_,t),this.initializeMap_()},t.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},t.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,t)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",e),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}},t.prototype.handleInitResponse_=function(t,e){var i=e.target;if(!i.status||200<=i.status&&i.status<300){var r;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState(xs)}this.applyTemplate_(r),this.templateCache_[t]=r,this.setState(ms)}else this.setState(xs)},t.prototype.handleInitError_=function(t){this.setState(xs)},t.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},t}(Yx),Xx=function(e){function t(t){e.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.features=[],this.geometryFunction=t.geometryFunction||function(t){var e=t.getGeometry();return Z(e instanceof Dr,10),e},this.source=t.source,E(this.source,w.CHANGE,this.refresh,this)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getDistance=function(){return this.distance},t.prototype.getSource=function(){return this.source},t.prototype.loadFeatures=function(t,e,i){this.source.loadFeatures(t,e,i),e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},t.prototype.setDistance=function(t){this.distance=t,this.refresh()},t.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features),e.prototype.refresh.call(this)},t.prototype.cluster=function(){if(void 0!==this.resolution)for(var t=[1/(this.features.length=0),1/0,-1/0,-1/0],e=this.distance*this.resolution,i=this.source.getFeatures(),r={},n=0,o=i.length;n<o;n++){var s=i[n];if(!(Et(s).toString()in r)){var a=this.geometryFunction(s);if(a){V(a.getCoordinates(),t),G(t,e,t);var h=this.source.getFeaturesInExtent(t);h=h.filter(function(t){var e=Et(t).toString();return!(e in r)&&(r[e]=!0)}),this.features.push(this.createCluster(h))}}}},t.prototype.createCluster=function(t){for(var e=[0,0],i=t.length-1;0<=i;--i){var r=this.geometryFunction(t[i]);r?an(e,r.getCoordinates()):t.splice(i,1)}dn(e,1/t.length);var n=new Ji(new Dr(e));return n.set("features",t),n},t}(Dh),zx=function(f){function t(t,e,i,r,n,o){var s=t.getExtent(),a=e.getExtent(),h=a?ht(i,a):i,l=mx(t,e,ot(h),r),u=new Cx(t,e,h,s,.5*l),c=o(u.calculateSourceExtent(),l,n),p=di.LOADED;c&&(p=di.IDLE);var d=c?c.getPixelRatio():1;f.call(this,i,r,d,p),this.targetProj_=e,this.maxSourceExtent_=s,this.triangulation_=u,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=c,this.sourcePixelRatio_=d,this.canvas_=null,this.sourceListenerKey_=null}return f&&(t.__proto__=f),((t.prototype=Object.create(f&&f.prototype)).constructor=t).prototype.disposeInternal=function(){this.state==di.LOADING&&this.unlistenSource_(),f.prototype.disposeInternal.call(this)},t.prototype.getImage=function(){return this.canvas_},t.prototype.getProjection=function(){return this.targetProj_},t.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==di.LOADED){var e=ct(this.targetExtent_)/this.targetResolution_,i=at(this.targetExtent_)/this.targetResolution_;this.canvas_=Sx(e,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},t.prototype.load=function(){if(this.state==di.IDLE){this.state=di.LOADING,this.changed();var t=this.sourceImage_.getState();t==di.LOADED||t==di.ERROR?this.reproject_():(this.sourceListenerKey_=E(this.sourceImage_,w.CHANGE,function(t){var e=this.sourceImage_.getState();e!=di.LOADED&&e!=di.ERROR||(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},t.prototype.unlistenSource_=function(){g(this.sourceListenerKey_),this.sourceListenerKey_=null},t}(Mn),Vx="imageloadstart",Wx="imageloadend",Kx="imageloaderror",Hx=function(i){function t(t,e){i.call(this,t),this.image=e}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(m),Zx=function(e){function t(t){e.call(this,{attributions:t.attributions,extent:t.extent,projection:t.projection,state:t.state}),this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getResolutions=function(){return this.resolutions_},t.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=ur(this.resolutions_,t,0);t=this.resolutions_[e]}return t},t.prototype.getImage=function(t,e,i,r){var n=this.getProjection();if(n&&r&&!ue(n,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ue(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&$(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new zx(n,r,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,n)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(r=n),this.getImageInternal(t,e,i,r)},t.prototype.getImageInternal=function(t,e,i,r){},t.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case di.LOADING:this.dispatchEvent(new Hx(Vx,e));break;case di.LOADED:this.dispatchEvent(new Hx(Wx,e));break;case di.ERROR:this.dispatchEvent(new Hx(Kx,e))}},t}(fh);function qx(t,e){t.getImage().src=e}function Jx(t,e){var i=[];Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))});var r=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var Qx=function(i){function t(t){var e=t||{};i.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,this.hidpi_=void 0===e.hidpi||e.hidpi,this.url_=e.url,this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:qx,this.params_=e.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==e.ratio?e.ratio:1.5}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&Q(n.getExtent(),t))return n;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};C(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){var h=this.ratio_*ct(t)/2,l=this.ratio_*at(t)/2;t[0]=s-h,t[1]=a-l,t[2]=s+h,t[3]=a+l}var u=e/i,c=Math.ceil(ct(t)/u),p=Math.ceil(at(t)/u);t[0]=s-u*c/2,t[2]=s+u*c/2,t[1]=a-u*p/2,t[3]=a+u*p/2,this.imageSize_[0]=c,this.imageSize_[1]=p;var d=this.getRequestUrl_(t,this.imageSize_,i,r,o);return this.image_=new On(t,e,i,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),E(this.image_,w.CHANGE,this.handleImageChange,this),this.image_},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.getRequestUrl_=function(t,e,i,r,n){var o=r.getCode().split(":").pop();n.SIZE=e[0]+","+e[1],n.BBOX=t.join(","),n.BBOXSR=o,n.IMAGESR=o,n.DPI=Math.round(90*i);var s=this.url_,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&Z(!1,50),Jx(a,n)},t.prototype.getUrl=function(){return this.url_},t.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},t.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},t.prototype.updateParams=function(t){C(this.params_,t),this.image_=null,this.changed()},t}(Zx),$x=function(e){function t(t){e.call(this,{attributions:t.attributions,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e);var n=this.canvas_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&Q(n.getExtent(),t))return n;dt(t=t.slice(),this.ratio_);var o=[ct(t)/e*i,at(t)/e*i],s=this.canvasFunction_(t,e,i,o,r);return s&&(n=new bl(t,e,i,s)),this.canvas_=n,this.renderedRevision_=this.getRevision(),n},t}(Zx),tS=function(e){function t(t){e.call(this,{projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.displayDpi_=void 0!==t.displayDpi?t.displayDpi:96,this.params_=t.params||{},this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:qx,this.hidpi_=void 0===t.hidpi||t.hidpi,this.metersPerUnit_=void 0!==t.metersPerUnit?t.metersPerUnit:1,this.ratio_=void 0!==t.ratio?t.ratio:1,this.useOverlay_=void 0!==t.useOverlay&&t.useOverlay,this.image_=null,this.renderedRevision_=0}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(t,e,i,r){e=this.findNearestResolution(e),i=this.hidpi_?i:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==i&&Q(n.getExtent(),t))return n;1!=this.ratio_&&dt(t=t.slice(),this.ratio_);var o=[ct(t)/e*i,at(t)/e*i];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,r);E(n=new On(t,e,i,s,this.crossOrigin_,this.imageLoadFunction_),w.CHANGE,this.handleImageChange,this)}else n=null;return this.image_=n,this.renderedRevision_=this.getRevision(),n},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.updateParams=function(t){C(this.params_,t),this.changed()},t.prototype.getUrl=function(t,e,i,r,n){var o,s,a,h,l,u,c,p,d,f=(o=i,s=r,a=this.metersPerUnit_,h=this.displayDpi_,l=ct(o),u=at(o),c=s[0],p=s[1],d=.0254/h,c*u<p*l?l*a/(c*d):u*a/(p*d)),_=ot(i),g={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:f,SETVIEWCENTERX:_[0],SETVIEWCENTERY:_[1]};return C(g,e),Jx(t,g)},t.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},t}(Zx);var eS=function(l){function t(t){var e=t.imageExtent,i=void 0!==t.crossOrigin?t.crossOrigin:null,r=void 0!==t.imageLoadFunction?t.imageLoadFunction:qx;l.call(this,{attributions:t.attributions,projection:ne(t.projection)}),this.image_=new On(e,void 0,1,t.url,i,r),this.imageSize_=t.imageSize?t.imageSize:null,E(this.image_,w.CHANGE,this.handleImageChange,this)}return l&&(t.__proto__=l),((t.prototype=Object.create(l&&l.prototype)).constructor=t).prototype.getImageInternal=function(t,e,i,r){return wt(t,this.image_.getExtent())?this.image_:null},t.prototype.handleImageChange=function(t){if(this.image_.getState()==di.LOADED){var e,i,r=this.image_.getExtent(),n=this.image_.getImage();this.imageSize_?(e=this.imageSize_[0],i=this.imageSize_[1]):(e=n.width,i=n.height);var o=at(r)/i,s=Math.ceil(ct(r)/o);if(s!=e){var a=De(s,i),h=a.canvas;a.drawImage(n,0,0,e,i,0,0,h.width,h.height),this.image_.setImage(h)}}l.prototype.handleImageChange.call(this,t)},t}(Zx),iS="1.3.0",rS="carmentaserver",nS="geoserver",oS="mapserver",sS="qgis",aS=[101,101],hS=function(i){function t(t){var e=t||{};i.call(this,{attributions:e.attributions,projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,this.url_=e.url,this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:qx,this.params_=e.params||{},this.v13_=!0,this.updateV13_(),this.serverType_=e.serverType,this.hidpi_=void 0===e.hidpi||e.hidpi,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==e.ratio?e.ratio:1.5}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getGetFeatureInfoUrl=function(t,e,i,r){if(void 0!==this.url_){var n=ne(i),o=this.getProjection();o&&o!==n&&(e=mx(o,n,t,e),t=de(t,n,o));var s=st(t,e,0,aS),a={SERVICE:"WMS",VERSION:iS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};C(a,this.params_,r);var h=Math.floor((t[0]-s[0])/e),l=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=h,a[this.v13_?"J":"Y"]=l,this.getRequestUrl_(s,aS,1,o||n,a)}},t.prototype.getParams=function(){return this.params_},t.prototype.getImageInternal=function(t,e,i,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);var n=e/i,o=ot(t),s=st(o,n,0,[Math.ceil(ct(t)/n),Math.ceil(at(t)/n)]),a=st(o,n,0,[Math.ceil(this.ratio_*ct(t)/n),Math.ceil(this.ratio_*at(t)/n)]),h=this.image_;if(h&&this.renderedRevision_==this.getRevision()&&h.getResolution()==e&&h.getPixelRatio()==i&&Q(h.getExtent(),s))return h;var l={SERVICE:"WMS",VERSION:iS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};C(l,this.params_),this.imageSize_[0]=Math.round(ct(a)/n),this.imageSize_[1]=Math.round(at(a)/n);var u=this.getRequestUrl_(a,this.imageSize_,i,r,l);return this.image_=new On(a,e,i,u,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),E(this.image_,w.CHANGE,this.handleImageChange,this),this.image_},t.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},t.prototype.getRequestUrl_=function(t,e,i,r,n){if(Z(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=i)switch(this.serverType_){case nS:var o=90*i+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case oS:n.MAP_RESOLUTION=90*i;break;case rS:case sS:n.DPI=90*i;break;default:Z(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=s.join(","),Jx(this.url_,n)},t.prototype.getUrl=function(){return this.url_},t.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},t.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},t.prototype.updateParams=function(t){C(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},t.prototype.updateV13_=function(){var t=this.params_.VERSION||iS;this.v13_=0<=sn(t,"1.3")},t}(Zx),lS='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',uS=function(o){function t(t){var e,i=t||{};e=void 0!==i.attributions?i.attributions:[lS];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",n=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";o.call(this,{attributions:e,cacheSize:i.cacheSize,crossOrigin:r,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:n,wrapX:i.wrapX})}return o&&(t.__proto__=o),(t.prototype=Object.create(o&&o.prototype)).constructor=t}(Yx),cS=!0;try{new ImageData(10,10)}catch(t){cS=!1}var pS=document.createElement("canvas").getContext("2d");var dS={newImageData:function(t,e,i){if(cS)return new ImageData(t,e,i);var r=pS.createImageData(e,i);return r.data.set(t),r}}.newImageData;function fS(x){var S=!0;try{new ImageData(10,10)}catch(t){S=!1}return function(t){var e,i,r,n,o,s=t.buffers,a=t.meta,h=t.imageOps,l=t.width,u=t.height,c=s.length,p=s[0].byteLength;if(h){var d=new Array(c);for(i=0;i<c;++i)d[i]=(r=new Uint8ClampedArray(s[i]),n=l,o=u,S?new ImageData(r,n,o):{data:r,width:n,height:o});e=x(d,a).data}else{e=new Uint8ClampedArray(p);var f=new Array(c),_=new Array(c);for(i=0;i<c;++i)f[i]=new Uint8ClampedArray(s[i]),_[i]=[0,0,0,0];for(var g=0;g<p;g+=4){for(var y=0;y<c;++y){var v=f[y];_[y][0]=v[g],_[y][1]=v[g+1],_[y][2]=v[g+2],_[y][3]=v[g+3]}var m=x(_,a);e[g]=m[0],e[g+1]=m[1],e[g+2]=m[2],e[g+3]=m[3]}}return e.buffer}}function _S(e,t){var i=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+fS.toString()+")(",e.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Blob(i,{type:"text/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return o.addEventListener("message",t),o}function gS(t){var e;this._imageOps=!!t.imageOps;var i,r,n,o=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var s=0;s<e;++s)o[s]=_S(t,this._onWorkerMessage.bind(this,s));else o[0]=(i=t,r=this._onWorkerMessage.bind(this,0),n=fS(i.operation),{postMessage:function(t){setTimeout(function(){r({data:{buffer:n(t),meta:t.meta}})},0)}});this._workers=o,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}gS.prototype.process=function(t,e,i){this._enqueue({inputs:t,meta:e,callback:i}),this._dispatch()},gS.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0},gS.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},gS.prototype._dispatch=function(){if(0===this._running&&0<this._queue.length){var t=this._job=this._queue.shift(),e=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map(function(t){return t.data.buffer}),n=this._workers.length;if(1===(this._running=n))this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:e,height:i},r);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/n),a=0;a<n;++a){for(var h=a*s,l=[],u=0,c=r.length;u<c;++u)l.push(r[a].slice(h,h+s));this._workers[a].postMessage({buffers:l,meta:t.meta,imageOps:this._imageOps,width:e,height:i},l)}}},gS.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},gS.prototype._resolveJob=function(){var t,e,i=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var n=i.inputs[0].data.length;t=new Uint8ClampedArray(n),e=new Array(n);for(var o=4*Math.ceil(n/4/r),s=0;s<r;++s){var a=this._dataLookup[s].buffer,h=s*o;t.set(new Uint8ClampedArray(a),h),e[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},i.callback(null,dS(t,i.inputs[0].width,i.inputs[0].height),e),this._dispatch()};var yS=gS,vS="beforeoperations",mS="afteroperations",xS="pixel",SS="image",CS=function(r){function t(t,e,i){r.call(this,t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=i}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t}(m),ES=function(a){function t(t){a.call(this,{}),this.worker_=null,this.operationType_=void 0!==t.operationType?t.operationType:xS,this.threads_=void 0!==t.threads?t.threads:1,this.renderers_=function(t){for(var e=t.length,i=new Array(e),r=0;r<e;++r)i[r]=RS(t[r]);return i}(t.sources);for(var e=0,i=this.renderers_.length;e<i;++e)E(this.renderers_[e],w.CHANGE,this.changed,this);this.tileQueue_=new Jo(function(){return 1},this.changed.bind(this));for(var r=this.renderers_.map(function(t){return t.getLayer().getLayerState()}),n={},o=0,s=r.length;o<s;++o)n[Et(r[o].layer)]=r[o];this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,focus:null,index:0,layerStates:n,layerStatesArray:r,pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],skippedFeatureUids:{},tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},void 0!==t.operation&&this.setOperation(t.operation,t.lib)}return a&&(t.__proto__=a),((t.prototype=Object.create(a&&a.prototype)).constructor=t).prototype.setOperation=function(t,e){this.worker_=new yS({operation:t,imageOps:this.operationType_===SS,queue:1,lib:e,threads:this.threads_}),this.changed()},t.prototype.updateFrameState_=function(t,e,i){var r=C({},this.frameState_);r.viewState=C({},r.viewState);var n=ot(t);r.extent=t.slice(),r.focus=n,r.size[0]=Math.round(ct(t)/e),r.size[1]=Math.round(at(t)/e),r.time=Date.now(),r.animate=!1;var o=r.viewState;return o.center=n,o.projection=i,o.resolution=e,r},t.prototype.allSourcesReady_=function(){for(var t=!0,e=0,i=this.renderers_.length;e<i;++e)if(this.renderers_[e].getLayer().getSource().getState()!==ms){t=!1;break}return t},t.prototype.getImage=function(t,e,i,r){if(!this.allSourcesReady_())return null;var n=this.updateFrameState_(t,e,r);if(this.requestedFrameState_=n,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),s=this.renderedImageCanvas_.getExtent();e===o&&$(t,s)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),n.tileQueue.loadMoreTiles(16,16),n.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},t.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.renderers_.length,i=new Array(e),r=0;r<e;++r){var n=wS(this.renderers_[r],t,t.layerStatesArray[r]);if(!n)return;i[r]=n}var o={};this.dispatchEvent(new CS(vS,t,o)),this.worker_.process(i,o,this.onWorkerComplete_.bind(this,t))},t.prototype.onWorkerComplete_=function(t,e,i,r){if(!e&&i){var n=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&$(n,this.requestedFrameState_.extent)){var s;if(this.renderedImageCanvas_)s=this.renderedImageCanvas_.getImage().getContext("2d");else s=De(Math.round(ct(n)/o),Math.round(at(n)/o)),this.renderedImageCanvas_=new bl(n,o,1,s.canvas);s.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new CS(mS,t,r))}}},t.prototype.getImageInternal=function(){return null},t}(Zx),TS=null;function wS(t,e,i){if(!t.prepareFrame(e,i))return null;var r=e.size[0],n=e.size[1];if(TS){var o=TS.canvas;o.width!==r||o.height!==n?TS=De(r,n):TS.clearRect(0,0,r,n)}else TS=De(r,n);return t.composeFrame(e,i,TS),TS.getImageData(0,0,r,n)}function RS(t){var e,i,r=null;return t instanceof Mx?(i=new sx({source:t}),r=new Kl(i)):t instanceof Zx?(e=new rx({source:t}),r=new zl(e)):t instanceof sx?r=new Kl(t):t instanceof Ls&&(t.getType()==oh.IMAGE||t.getType()==oh.VECTOR)&&(r=new zl(t)),r}var IS=['Map tiles by <a href="https://stamen.com/">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.',lS],LS={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},bS={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}},PS=function(s){function t(t){var e=t.layer.indexOf("-"),i=-1==e?t.layer:t.layer.slice(0,e),r=bS[i],n=LS[t.layer],o=void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+n.extension;s.call(this,{attributions:IS,cacheSize:t.cacheSize,crossOrigin:"anonymous",maxZoom:null!=t.maxZoom?t.maxZoom:r.maxZoom,minZoom:null!=t.minZoom?t.minZoom:r.minZoom,opaque:n.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:o,wrapX:t.wrapX})}return s&&(t.__proto__=s),(t.prototype=Object.create(s&&s.prototype)).constructor=t}(Yx),FS=function(i){function t(t){var e=t||{};i.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.params_=e.params||{},this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.setKey(this.getKeyForParams_())}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},t.prototype.getParams=function(){return this.params_},t.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){var a,h=n.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=i.join(","),o.BBOXSR=h,o.IMAGESR=h,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)a=s[0];else a=s[Ct(cx(t),s.length)];return Jx(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},t.prototype.getTilePixelRatio=function(t){return t},t.prototype.fixedTileUrlFunction=function(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){var n=r.getTileCoordExtent(t,this.tmpExtent_),o=ws(r.getTileSize(t[0]),this.tmpSize);1!=e&&(o=Ts(o,e,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return C(s,this.params_),this.getRequestUrl_(t,o,n,e,i,s)}},t.prototype.updateParams=function(t){C(this.params_,t),this.setKey(this.getKeyForParams_())},t}(Dx),MS=function(r){function t(t,e,i){r.call(this,t,Gn),this.tileSize_=e,this.text_=i,this.canvas_=null}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=De(t[0],t[1]);return e.strokeStyle="black",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.fillText(this.text_,t[0]/2,t[1]/2),this.canvas_=e.canvas,e.canvas},t.prototype.load=function(){},t}(zn),OS=function(e){function t(t){e.call(this,{opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX})}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getTile=function(t,e,i){var r=lx(t,e,i);if(this.tileCache.containsKey(r))return this.tileCache.get(r);var n=ws(this.tileGrid.getTileSize(t)),o=[t,e,i],s=this.getTileCoordForTileUrlFunction(o),a=s?this.getTileCoordForTileUrlFunction(s).toString():"",h=new MS(o,n,a);return this.tileCache.set(r,h),h},t}(Mx),NS=function(i){function t(t){if(i.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:ne("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:vs,tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.tileJSON_=null,t.url)if(t.jsonp)yx(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):Z(!1,51)}return i&&(t.__proto__=i),((t.prototype=Object.create(i&&i.prototype)).constructor=t).prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},t.prototype.onXHRError_=function(t){this.handleTileJSONError()},t.prototype.getTileJSON=function(){return this.tileJSON_},t.prototype.handleTileJSONResponse=function(e){var t,i=ne("EPSG:4326"),r=this.getProjection();if(void 0!==e.bounds){var n=ce(i,r);t=ft(e.bounds,n)}var o=e.minzoom||0,s=e.maxzoom||22,a=Lx({extent:Fx(r),maxZoom:s,minZoom:o});if(this.tileGrid=a,this.tileUrlFunction=dx(e.tiles,a),void 0!==e.attribution&&!this.getAttributions()){var h=void 0!==t?t:i.getExtent();this.setAttributions(function(t){return wt(h,t.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(ms)},t.prototype.handleTileJSONError=function(){this.setState(xs)},t}(Dx),AS=function(n){function t(t){var e=t||{},i=e.params||{},r=!("TRANSPARENT"in i)||i.TRANSPARENT;n.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,opaque:!r,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.gutter_=void 0!==e.gutter?e.gutter:0,this.params_=i,this.v13_=!0,this.serverType_=e.serverType,this.hidpi_=void 0===e.hidpi||e.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.getGetFeatureInfoUrl=function(t,e,i,r){var n=ne(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(n));var a=s.getTileCoordForCoordAndResolution(t,e);if(!(s.getResolutions().length<=a[0])){var h=s.getResolution(a[0]),l=s.getTileCoordExtent(a,this.tmpExtent_),u=ws(s.getTileSize(a[0]),this.tmpSize),c=this.gutter_;0!==c&&(u=Es(u,c,this.tmpSize),l=G(l,h*c,l)),o&&o!==n&&(h=mx(o,n,t,h),l=fe(l,n,o),t=de(t,n,o));var p={SERVICE:"WMS",VERSION:iS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};C(p,this.params_,r);var d=Math.floor((t[0]-l[0])/h),f=Math.floor((l[3]-t[1])/h);return p[this.v13_?"I":"X"]=d,p[this.v13_?"J":"Y"]=f,this.getRequestUrl_(a,u,l,1,o||n,p)}},t.prototype.getGutterInternal=function(){return this.gutter_},t.prototype.getParams=function(){return this.params_},t.prototype.getRequestUrl_=function(t,e,i,r,n,o){var s=this.urls;if(s){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=r)switch(this.serverType_){case nS:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case oS:o.MAP_RESOLUTION=90*r;break;case rS:case sS:o.DPI=90*r;break;default:Z(!1,52)}var h,l,u=n.getAxisOrientation(),c=i;if(this.v13_&&"ne"==u.substr(0,2))h=i[0],c[0]=i[1],c[1]=h,h=i[2],c[2]=i[3],c[3]=h;if(o.BBOX=c.join(","),1==s.length)l=s[0];else l=s[Ct(cx(t),s.length)];return Jx(l,o)}},t.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},t.prototype.getKeyForParams_=function(){var t=0,e=[];for(var i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")},t.prototype.fixedTileUrlFunction=function(t,e,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var n=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.tmpExtent_),s=ws(r.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=Es(s,a,this.tmpSize),o=G(o,n*a,o)),1!=e&&(s=Ts(s,e,this.tmpSize));var h={SERVICE:"WMS",VERSION:iS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return C(h,this.params_),this.getRequestUrl_(t,s,o,e,i,h)}},t.prototype.updateParams=function(t){C(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},t.prototype.updateV13_=function(){var t=this.params_.VERSION||iS;this.v13_=0<=sn(t,"1.3")},t}(Dx),GS=function(s){function t(t,e,i,r,n,o){s.call(this,t,e),this.src_=i,this.extent_=r,this.preemptive_=n,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o}return s&&(t.__proto__=s),(t.prototype=Object.create(s&&s.prototype)).constructor=t}(zn);GS.prototype.getImage=function(){return null},GS.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-i)*this.grid_.length)];if("string"!=typeof r)return null;var n=r.charCodeAt(Math.floor(e*r.length));93<=n&&n--,35<=n&&n--;var o=null;if((n-=32)in this.keys_){var s=this.keys_[n];o=this.data_&&s in this.data_?this.data_[s]:s}return o},GS.prototype.forDataAtCoordinate=function(e,i,r,t){this.state==Nn&&!0===t?(p(this,w.CHANGE,function(t){i.call(r,this.getData(e))},this),this.loadInternal_()):!0===t?setTimeout(function(){i.call(r,this.getData(e))}.bind(this),0):i.call(r,this.getData(e))},GS.prototype.getKey=function(){return this.src_},GS.prototype.handleError_=function(){this.state=kn,this.changed()},GS.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=Dn,this.changed()},GS.prototype.loadInternal_=function(){if(this.state==Nn)if(this.state=An,this.jsonp_)yx(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},GS.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(i)}else this.handleError_()},GS.prototype.onXHRError_=function(t){this.handleError_()},GS.prototype.load=function(){this.preemptive_&&this.loadInternal_()};var kS=function(i){function t(t){if(i.call(this,{projection:ne("EPSG:3857"),state:vs}),this.preemptive_=void 0===t.preemptive||t.preemptive,this.tileUrlFunction_=_x,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)yx(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{var e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):Z(!1,51)}return i&&(t.__proto__=i),(t.prototype=Object.create(i&&i.prototype)).constructor=t}(Mx);kS.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||200<=e.status&&e.status<300){var i;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},kS.prototype.onXHRError_=function(t){this.handleTileJSONError()},kS.prototype.getTemplate=function(){return this.template_},kS.prototype.forDataAtCoordinateAndResolution=function(t,e,i,r){if(this.tileGrid){var n=this.tileGrid.getTileCoordForCoordAndResolution(t,e);this.getTile(n[0],n[1],n[2],1,this.getProjection()).forDataAtCoordinate(t,i,null,r)}else!0===r?setTimeout(function(){i(null)},0):i(null)},kS.prototype.handleTileJSONError=function(){this.setState(xs)},kS.prototype.handleTileJSONResponse=function(e){var t,i=ne("EPSG:4326"),r=this.getProjection();if(void 0!==e.bounds){var n=ce(i,r);t=ft(e.bounds,n)}var o=e.minzoom||0,s=e.maxzoom||22,a=Lx({extent:Fx(r),maxZoom:s,minZoom:o});this.tileGrid=a,this.template_=e.template;var h=e.grids;if(h){if(this.tileUrlFunction_=dx(h,a),void 0!==e.attribution){var l=void 0!==t?t:i.getExtent();this.setAttributions(function(t){return wt(l,t.extent)?[e.attribution]:null})}this.setState(ms)}else this.setState(xs)},kS.prototype.getTile=function(t,e,i,r,n){var o=lx(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=this.tileUrlFunction_(a,r,n),l=new GS(s,void 0!==h?Nn:Dn,void 0!==h?h:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,l),l},kS.prototype.useTile=function(t,e,i){var r=lx(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)};var DS=function(S){function C(t,e,i,s,a,r,h,l,n,u,c,p,d,f,o){if(S.call(this,t,e,{transition:0}),this.context_={},this.loader_,this.replayState_={},this.sourceTiles_=u,this.tileKeys=[],this.extent=null,this.sourceRevision_=i,this.wrappedTileCoord=r,this.loadListenerKeys_=[],this.sourceTileListenerKeys_=[],r){var _=this.extent=n.getTileCoordExtent(r),g=n.getResolution(o),y=l.getZForResolution(g),v=o!=t[0],m=0;if(l.forEachTileCoord(_,y,function(t){var e=ht(_,l.getTileCoordExtent(t)),i=l.getExtent();if(i&&(e=ht(e,i,e)),.5<=ct(e)/g&&.5<=at(e)/g){++m;var r=t.toString(),n=u[r];if(!n&&!v){var o=h(t,c,p);n=u[r]=new d(t,null==o?Dn:Nn,null==o?"":o,s,a),this.sourceTileListenerKeys_.push(E(n,w.CHANGE,f))}!n||v&&n.getState()!=Gn||(n.consumers++,this.tileKeys.push(r))}}.bind(this)),v&&m==this.tileKeys.length&&this.finishLoading_(),o<=t[0]&&this.state!=Gn)for(;o>n.getMinZoom();){var x=new C(t,e,i,s,a,r,h,l,n,u,c,p,d,L,--o);if(x.state==Gn){this.interimTile=x;break}}}}return S&&(C.__proto__=S),((C.prototype=Object.create(S&&S.prototype)).constructor=C).prototype.disposeInternal=function(){this.state=jn,this.changed(),this.interimTile&&this.interimTile.dispose();for(var t=0,e=this.tileKeys.length;t<e;++t){var i=this.tileKeys[t],r=this.getTile(i);r.consumers--,0==r.consumers&&(delete this.sourceTiles_[i],r.dispose())}this.tileKeys.length=0,this.sourceTiles_=null,this.loadListenerKeys_.forEach(g),this.loadListenerKeys_.length=0,this.sourceTileListenerKeys_.forEach(g),this.sourceTileListenerKeys_.length=0,S.prototype.disposeInternal.call(this)},C.prototype.getContext=function(t){var e=Et(t).toString();return e in this.context_||(this.context_[e]=De()),this.context_[e]},C.prototype.getImage=function(t){return-1==this.getReplayState(t).renderedTileRevision?null:this.getContext(t).canvas},C.prototype.getReplayState=function(t){var e=Et(t).toString();return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedRevision:-1,renderedTileRevision:-1}),this.replayState_[e]},C.prototype.getKey=function(){return this.tileKeys.join("/")+"-"+this.sourceRevision_},C.prototype.getTile=function(t){return this.sourceTiles_[t]},C.prototype.load=function(){var n=0,o={};this.state==Nn&&this.setState(An),this.state==An&&this.tileKeys.forEach(function(t){var r=this.getTile(t);if(r.state==Nn&&(r.setLoader(this.loader_),r.load()),r.state==An){var e=E(r,w.CHANGE,function(t){var e=r.getState();if(e==Gn||e==kn){var i=Et(r);e==kn?o[i]=!0:(--n,delete o[i]),n-Object.keys(o).length==0&&this.finishLoading_()}}.bind(this));this.loadListenerKeys_.push(e),++n}}.bind(this)),n-Object.keys(o).length==0&&setTimeout(this.finishLoading_.bind(this),0)},C.prototype.finishLoading_=function(){for(var t=this.tileKeys.length,e=0,i=t-1;0<=i;--i){var r=this.getTile(this.tileKeys[i]).getState();r!=Gn&&--t,r==Dn&&++e}t==this.tileKeys.length?(this.loadListenerKeys_.forEach(g),this.loadListenerKeys_.length=0,this.setState(Gn)):this.setState(e==this.tileKeys.length?Dn:kn)},C}(zn);function jS(t,e){var i=ch(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(i)}var US=function(n){function t(t){var e=t.projection||"EPSG:3857",i=t.extent||Fx(e),r=t.tileGrid||Lx({extent:i,maxZoom:t.maxZoom||22,minZoom:t.minZoom,tileSize:t.tileSize||512});n.call(this,{attributions:t.attributions,cacheSize:void 0!==t.cacheSize?t.cacheSize:128,extent:i,opaque:!1,projection:e,state:t.state,tileGrid:r,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:jS,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition}),this.format_=t.format?t.format:null,this.sourceTiles_={},this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:nc,this.tileGrids_={}}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(kx);US.prototype.getOverlaps=function(){return this.overlaps_},US.prototype.clear=function(){this.tileCache.clear(),this.sourceTiles_={}},US.prototype.getTile=function(t,e,i,r,n){var o=lx(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,n),h=new DS(s,null!==a?Nn:Dn,this.getRevision(),this.format_,this.tileLoadFunction,a,this.tileUrlFunction,this.tileGrid,this.getTileGridForProjection(n),this.sourceTiles_,r,n,this.tileClass,this.handleTileChange.bind(this),s[0]);return this.tileCache.set(o,h),h},US.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var r=this.tileGrid;i=this.tileGrids_[e]=Px(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0)}return i},US.prototype.getTilePixelRatio=function(t){return t},US.prototype.getTilePixelSize=function(t,e,i){var r=ws(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*e),Math.round(r[1]*e)]};var YS={KVP:"KVP",REST:"REST"},BS=function(e){function t(t){e.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.getMatrixId=function(t){return this.matrixIds_[t]},t.prototype.getMatrixIds=function(){return this.matrixIds_},t}(wx);function XS(n,t,e){var o=[],s=[],a=[],h=[],l=[],u=void 0!==e?e:[],c="TileMatrix",p="Identifier",d="ScaleDenominator",f="TopLeftCorner",i=n.SupportedCRS,r=ne(i.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ne(i),_=r.getMetersPerUnit(),g="ne"==r.getAxisOrientation().substr(0,2);return n[c].sort(function(t,e){return e[d]-t[d]}),n[c].forEach(function(e){if(!(0<u.length)||dr(u,function(t){return e[p]==t[c]||-1===e[p].indexOf(":")&&n[p]+":"+e[p]===t[c]})){s.push(e[p]);var t=28e-5*e[d]/_,i=e.TileWidth,r=e.TileHeight;g?a.push([e[f][1],e[f][0]]):a.push(e[f]),o.push(t),h.push(i==r?i:[i,r]),l.push([e.MatrixWidth,-e.MatrixHeight])}}),new BS({extent:t,origins:a,resolutions:o,matrixIds:s,tileSizes:h,sizes:l})}var zS=function(n){function t(t){var e=void 0!==t.requestEncoding?t.requestEncoding:YS.KVP,i=t.tileGrid,r=t.urls;void 0===r&&void 0!==t.url&&(r=gx(t.url)),n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:_x,urls:r,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}),this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),r&&0<r.length&&(this.tileUrlFunction=fx(r.map(VS.bind(this))))}return n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t}(Dx);function VS(o){var s=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==YS.KVP&&C(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),o=s==YS.KVP?Jx(o,i):o.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t});var a=this.tileGrid;return function(t,e,i){if(t){var r={TileMatrix:a.getMatrixId(t[0]),TileCol:t[1],TileRow:-t[2]-1};C(r,this.dimensions_);var n=o;return n=s==YS.KVP?Jx(n,r):n.replace(/\{(\w+?)\}/g,function(t,e){return r[e]})}}}zS.prototype.setUrls=function(t){var e=(this.urls=t).join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):fx(t.map(VS.bind(this))),e)},zS.prototype.getDimensions=function(){return this.dimensions_},zS.prototype.getFormat=function(){return this.format_},zS.prototype.getLayer=function(){return this.layer_},zS.prototype.getMatrixSet=function(){return this.matrixSet_},zS.prototype.getRequestEncoding=function(){return this.requestEncoding_},zS.prototype.getStyle=function(){return this.style_},zS.prototype.getVersion=function(){return this.version_},zS.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var i in this.dimensions_)e[t++]=i+"-"+this.dimensions_[i];return e.join("/")},zS.prototype.updateDimensions=function(t){C(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())};var WS="default",KS="truncated",HS=function(a){function t(t,e,i,r,n,o,s){a.call(this,e,i,r,n,o,s),this.zoomifyImage_=null,this.tileSize_=ws(t.getTileSize(e[0]))}return a&&(t.__proto__=a),(t.prototype=Object.create(a&&a.prototype)).constructor=t}(Vn);HS.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var t=Vn.prototype.getImage.call(this);if(this.state==Gn){var e=this.tileSize_;if(t.width==e[0]&&t.height==e[1])return this.zoomifyImage_=t;var i=De(e[0],e[1]);return i.drawImage(t,0,0),this.zoomifyImage_=i.canvas,i.canvas}return t};var ZS=function(x){function t(t){var e=t||{},i=e.size,r=void 0!==e.tierSizeCalculation?e.tierSizeCalculation:WS,n=i[0],o=i[1],s=e.extent||[0,-i[1],i[0],0],u=[],a=e.tileSize||$o,h=a;switch(r){case WS:for(;h<n||h<o;)u.push([Math.ceil(n/h),Math.ceil(o/h)]),h+=h;break;case KS:for(var l=n,c=o;h<l||h<c;)u.push([Math.ceil(l/h),Math.ceil(c/h)]),l>>=1,c>>=1;break;default:Z(!1,53)}u.push([1,1]),u.reverse();for(var p=[1],d=[0],f=1,_=u.length;f<_;f++)p.push(1<<f),d.push(u[f-1][0]*u[f-1][1]+d[f-1]);p.reverse();var g=new wx({tileSize:a,extent:s,origin:lt(s),resolutions:p}),y=e.url;y&&-1==y.indexOf("{TileGroup}")&&-1==y.indexOf("{tileIndex}")&&(y+="{TileGroup}/{z}-{x}-{y}.jpg");var v=fx(gx(y).map(function(l){return function(t,e,i){if(t){var r=t[0],n=t[1],o=-t[2]-1,s=n+o*u[r][0],a=g.getTileSize(r),h={z:r,x:n,y:o,tileIndex:s,TileGroup:"TileGroup"+((s+d[r])/a|0)};return l.replace(/\{(\w+?)\}/g,function(t,e){return h[e]})}}})),m=HS.bind(null,g);x.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:m,tileGrid:g,tileUrlFunction:v,transition:e.transition})}return x&&(t.__proto__=x),(t.prototype=Object.create(x&&x.prototype)).constructor=t}(Dx);var qS=window.ol={};qS.color={},qS.colorlike={},qS.control={},qS.coordinate={},qS.easing={},qS.events={},qS.events.condition={},qS.extent={},qS.featureloader={},qS.format={},qS.format.filter={},qS.geom={},qS.has={},qS.interaction={},qS.layer={},qS.loadingstrategy={},qS.proj={},qS.proj.Units={},qS.proj.proj4={},qS.render={},qS.render.canvas={},qS.renderer={},qS.renderer.canvas={},qS.renderer.webgl={},qS.size={},qS.source={},qS.sphere={},qS.style={},qS.style.IconImageCache={},qS.tilegrid={},qS.xml={},qS.Collection=M,qS.Feature=Ji,qS.Geolocation=nn,qS.Graticule=Fn,qS.Kinetic=Kn,qS.Map=Yu,qS.Object=R,qS.Observable=S,qS.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)g(t[e]);else g(t)},qS.Overlay=ic,qS.PluggableMap=Rs,qS.View=as,qS.WebGLMap=Ap,qS.color.asArray=Ne,qS.color.asString=Pe,qS.colorlike.asColorLike=ke,qS.control.Attribution=Ps,qS.control.Attribution.render=Fs,qS.control.Control=Is,qS.control.FullScreen=sc,qS.control.MousePosition=Dp,qS.control.MousePosition.render=jp,qS.control.OverviewMap=uc,qS.control.OverviewMap.render=cc,qS.control.Rotate=Ms,qS.control.Rotate.render=Os,qS.control.ScaleLine=mc,qS.control.ScaleLine.render=xc,qS.control.Zoom=Ns,qS.control.ZoomSlider=Ec,qS.control.ZoomSlider.render=Tc,qS.control.ZoomToExtent=wc,qS.control.defaults=As,qS.coordinate.add=an,qS.coordinate.createStringXY=function(e){return function(t){return yn(t,e)}},qS.coordinate.format=un,qS.coordinate.rotate=pn,qS.coordinate.toStringHDMS=function(t,e){return t?ln("NS",t[1],e)+" "+ln("EW",t[0],e):""},qS.coordinate.toStringXY=yn,qS.easing.easeIn=Un,qS.easing.easeOut=Yn,qS.easing.inAndOut=Bn,qS.easing.linear=Xn,qS.easing.upAndDown=function(t){return t<.5?Bn(2*t):1-Bn(2*(t-.5))},qS.events.condition.altKeyOnly=Vs,qS.events.condition.altShiftKeysOnly=Ws,qS.events.condition.always=Ks,qS.events.condition.click=function(t){return t.type==qn.CLICK},qS.events.condition.doubleClick=function(t){return t.type==qn.DBLCLICK},qS.events.condition.focus=function(t){return t.target.getTargetElement()===document.activeElement},qS.events.condition.mouseOnly=ea,qS.events.condition.never=Zs,qS.events.condition.noModifierKeys=Qs,qS.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(si?e.metaKey:e.ctrlKey)&&!e.shiftKey},qS.events.condition.pointerMove=qs,qS.events.condition.primaryAction=ia,qS.events.condition.shiftKeyOnly=$s,qS.events.condition.singleClick=Js,qS.events.condition.targetNotEditable=ta,qS.extent.applyTransform=ft,qS.extent.boundingExtent=A,qS.extent.buffer=G,qS.extent.containsCoordinate=j,qS.extent.containsExtent=Q,qS.extent.containsXY=U,qS.extent.createEmpty=B,qS.extent.equals=$,qS.extent.extend=H,qS.extent.getArea=it,qS.extent.getBottomLeft=rt,qS.extent.getBottomRight=nt,qS.extent.getCenter=ot,qS.extent.getHeight=at,qS.extent.getIntersection=ht,qS.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},qS.extent.getTopLeft=lt,qS.extent.getTopRight=ut,qS.extent.getWidth=ct,qS.extent.intersects=wt,qS.extent.isEmpty=pt,qS.featureloader.xhr=ph,qS.format.EsriJSON=Wp,qS.format.Feature=Up,qS.format.GML=Dd,qS.format.GML2=Yd,qS.format.GML3=kd,qS.format.GPX=Kd,qS.format.GeoJSON=wf,qS.format.IGC=jf,qS.format.KML=f_,qS.format.MVT=uy,qS.format.OSMXML=vy,qS.format.Polyline=Cy,qS.format.Polyline.decodeDeltas=Ty,qS.format.Polyline.decodeFloats=Ry,qS.format.Polyline.encodeDeltas=Ey,qS.format.Polyline.encodeFloats=wy,qS.format.TopoJSON=Ly,qS.format.WFS=_v,qS.format.WFS.writeFilter=function(t){var e=$p(pv,"Filter");return Sv(e,t,[]),e},qS.format.WKT=Bv,qS.format.WMSCapabilities=tm,qS.format.WMSGetFeatureInfo=xm,qS.format.WMTSCapabilities=Um,qS.format.filter.Bbox=Dy,qS.format.filter.Contains=Uy,qS.format.filter.During=By,qS.format.filter.EqualTo=zy,qS.format.filter.GreaterThan=Vy,qS.format.filter.GreaterThanOrEqualTo=Wy,qS.format.filter.Intersects=Ky,qS.format.filter.IsBetween=Hy,qS.format.filter.IsLike=Zy,qS.format.filter.IsNull=qy,qS.format.filter.LessThan=Jy,qS.format.filter.LessThanOrEqualTo=Qy,qS.format.filter.Not=$y,qS.format.filter.NotEqualTo=tv,qS.format.filter.Or=ev,qS.format.filter.Within=iv,qS.format.filter.and=rv,qS.format.filter.bbox=nv,qS.format.filter.between=function(t,e,i){return new Hy(t,e,i)},qS.format.filter.contains=function(t,e,i){return new Uy(t,e,i)},qS.format.filter.during=function(t,e,i){return new By(t,e,i)},qS.format.filter.equalTo=function(t,e,i){return new zy(t,e,i)},qS.format.filter.greaterThan=function(t,e){return new Vy(t,e)},qS.format.filter.greaterThanOrEqualTo=function(t,e){return new Wy(t,e)},qS.format.filter.intersects=function(t,e,i){return new Ky(t,e,i)},qS.format.filter.isNull=function(t){return new qy(t)},qS.format.filter.lessThan=function(t,e){return new Jy(t,e)},qS.format.filter.lessThanOrEqualTo=function(t,e){return new Qy(t,e)},qS.format.filter.like=function(t,e,i,r,n,o){return new Zy(t,e,i,r,n,o)},qS.format.filter.not=function(t){return new $y(t)},qS.format.filter.notEqualTo=function(t,e,i){return new tv(t,e,i)},qS.format.filter.or=function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(ev,e))},qS.format.filter.within=function(t,e,i){return new iv(t,e,i)},qS.geom.Circle=th,qS.geom.Geometry=Ie,qS.geom.GeometryCollection=Ef,qS.geom.LineString=Sn,qS.geom.LinearRing=kr,qS.geom.MultiLineString=eh,qS.geom.MultiPoint=ih,qS.geom.MultiPolygon=nh,qS.geom.Point=Dr,qS.geom.Polygon=Qr,qS.geom.Polygon.circular=$r,qS.geom.Polygon.fromCircle=en,qS.geom.Polygon.fromExtent=tn,qS.geom.SimpleGeometry=vr,qS.has.DEVICE_PIXEL_RATIO=ai,qS.has.GEOLOCATION=li,qS.has.TOUCH=ui,qS.inherits=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},qS.interaction.DoubleClickZoom=Xs,qS.interaction.DragAndDrop=Ka,qS.interaction.DragBox=Ca,qS.interaction.DragPan=ca,qS.interaction.DragRotate=_a,qS.interaction.DragRotateAndZoom=qa,qS.interaction.DragZoom=Ia,qS.interaction.Draw=Xh,qS.interaction.Draw.createBox=function(){return function(t,e){var i=A(t),r=[[rt(i),nt(i),ut(i),lt(i),rt(i)]],n=e;return n?n.setCoordinates(r):n=new Qr(r),n}},qS.interaction.Draw.createRegularPolygon=function(s,a){return function(t,e){var i=t[0],r=t[1],n=Math.sqrt(fn(i,r)),o=e||en(new th(i),s);return rn(o,i,n,a||Math.atan((r[1]-i[1])/(r[0]-i[0]))),o}},qS.interaction.Draw.handleEvent=zh,qS.interaction.Extent=Zh,qS.interaction.Interaction=ks,qS.interaction.KeyboardPan=Pa,qS.interaction.KeyboardZoom=Ma,qS.interaction.Modify=sl,qS.interaction.MouseWheelZoom=Aa,qS.interaction.PinchRotate=ka,qS.interaction.PinchZoom=Ya,qS.interaction.Pointer=aa,qS.interaction.Pointer.handleEvent=la,qS.interaction.Select=gl,qS.interaction.Snap=vl,qS.interaction.Translate=El,qS.interaction.defaults=Ll,qS.layer.Base=gs,qS.layer.Group=Cs,qS.layer.Heatmap=ix,qS.layer.Image=rx,qS.layer.Tile=sx,qS.layer.Vector=lh,qS.layer.VectorTile=ax,qS.loadingstrategy.all=dh,qS.loadingstrategy.bbox=function(t,e){return[t]},qS.loadingstrategy.tile=function(s){return function(t,e){var i=s.getZForResolution(e),r=s.getTileRangeForExtentAndZ(t,i),n=[],o=[i,0,0];for(o[1]=r.minX;o[1]<=r.maxX;++o[1])for(o[2]=r.minY;o[2]<=r.maxY;++o[2])n.push(s.getTileCoordExtent(o));return n}},qS.proj.Projection=At,qS.proj.Units.METERS_PER_UNIT=Nt,qS.proj.addCoordinateTransforms=le,qS.proj.addEquivalentProjections=se,qS.proj.addProjection=re,qS.proj.equivalent=ue,qS.proj.fromLonLat=function(t,e){return de(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},qS.proj.get=ne,qS.proj.getPointResolution=oe,qS.proj.getTransform=pe,qS.proj.proj4.register=function(t){var e,i,r=Object.keys(t.defs),n=r.length;for(e=0;e<n;++e){var o=r[e];if(!ne(o)){var s=t.defs(o);re(new At({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:s.units}))}}for(e=0;e<n;++e){var a=r[e],h=ne(a);for(i=0;i<n;++i){var l=r[i],u=ne(l);if(!te(a,l))if(t.defs[a]===t.defs[l])se([h,u]);else{var c=t(a,l);le(h,u,c.forward,c.inverse)}}}},qS.proj.toLonLat=function(t,e){var i=de(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||180<r)&&(i[0]=Ct(r+180,360)-180),i},qS.proj.transform=de,qS.proj.transformExtent=fe,qS.render.VectorContext=Fl,qS.render.canvas.labelCache=Li,qS.render.toContext=function(t,e){var i=t.canvas,r=e||{},n=r.pixelRatio||ai,o=r.size;o&&(i.width=o[0]*n,i.height=o[1]*n,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],a=Ce([1,0,0,1,0,0],n,n);return new Ml(t,n,s,a,0)},qS.renderer.canvas.ImageLayer=zl,qS.renderer.canvas.Map=Ul,qS.renderer.canvas.TileLayer=Kl,qS.renderer.canvas.VectorLayer=Ou,qS.renderer.canvas.VectorTileLayer=ju,qS.renderer.webgl.ImageLayer=Lp,qS.renderer.webgl.Map=bp,qS.renderer.webgl.TileLayer=Op,qS.renderer.webgl.VectorLayer=Np,qS.size.toSize=ws,qS.source.BingMaps=Ux,qS.source.CartoDB=Bx,qS.source.Cluster=Xx,qS.source.Image=Zx,qS.source.ImageArcGISRest=Qx,qS.source.ImageCanvas=$x,qS.source.ImageMapGuide=tS,qS.source.ImageStatic=eS,qS.source.ImageWMS=hS,qS.source.OSM=uS,qS.source.OSM.ATTRIBUTION=lS,qS.source.Raster=ES,qS.source.Source=fh,qS.source.Stamen=PS,qS.source.Tile=Mx,qS.source.TileArcGISRest=FS,qS.source.TileDebug=OS,qS.source.TileImage=Dx,qS.source.TileJSON=NS,qS.source.TileWMS=AS,qS.source.UTFGrid=kS,qS.source.Vector=Dh,qS.source.VectorTile=US,qS.source.WMTS=zS,qS.source.WMTS.optionsFromCapabilities=function(t,s){var e=dr(t.Contents.Layer,function(t,e,i){return t.Identifier==s.layer});if(null===e)return null;var i,a=t.Contents.TileMatrixSet;(i=1<e.TileMatrixSetLink.length?gr(e.TileMatrixSetLink,"projection"in s?function(e,t,i){var r=dr(a,function(t){return t.Identifier==e.TileMatrixSet}).SupportedCRS,n=ne(r.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ne(r),o=ne(s.projection);return n&&o?ue(n,o):r==s.projection}:function(t,e,i){return t.TileMatrixSet==s.matrixSet}):0)<0&&(i=0);var r=e.TileMatrixSetLink[i].TileMatrixSet,n=e.TileMatrixSetLink[i].TileMatrixSetLimits,o=e.Format[0];"format"in s&&(o=s.format),(i=gr(e.Style,function(t,e,i){return"style"in s?t.Title==s.style:t.isDefault}))<0&&(i=0);var h=e.Style[i].Identifier,l={};"Dimension"in e&&e.Dimension.forEach(function(t,e,i){var r=t.Identifier,n=t.Default;void 0===n&&(n=t.Value[0]),l[r]=n});var u,c=dr(t.Contents.TileMatrixSet,function(t,e,i){return t.Identifier==r}),p=c.SupportedCRS;if(p&&(u=ne(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||ne(p)),"projection"in s){var d=ne(s.projection);d&&(u&&!ue(d,u)||(u=d))}var f,_,g=e.WGS84BoundingBox;if(void 0!==g){var y=ne("EPSG:4326").getExtent();_=g[0]==y[0]&&g[2]==y[2],f=fe(g,"EPSG:4326",u);var v=u.getExtent();v&&(Q(v,f)||(f=void 0))}var m=XS(c,f,n),x=[],S=s.requestEncoding;if(S=void 0!==S?S:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var C=t.OperationsMetadata.GetTile.DCP.HTTP.Get,E=0,T=C.length;E<T;++E)if(C[E].Constraint){var w=dr(C[E].Constraint,function(t){return"GetEncoding"==t.name}).AllowedValues.Value;if(""===S&&(S=w[0]),S!==YS.KVP)break;lr(w,YS.KVP)&&x.push(C[E].href)}else C[E].href&&(S=YS.KVP,x.push(C[E].href));return 0===x.length&&(S=YS.REST,e.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(o=t.format,x.push(t.template))})),{urls:x,layer:s.layer,matrixSet:r,format:o,projection:u,requestEncoding:S,tileGrid:m,style:h,dimensions:l,wrapX:_,crossOrigin:s.crossOrigin}},qS.source.XYZ=Yx,qS.source.Zoomify=ZS,qS.sphere.getArea=function t(e,i){var r=i||{},n=r.radius||bt,o=r.projection||"EPSG:3857",s=e.getType();s!==Lt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,c,p,d=0;switch(s){case Lt.POINT:case Lt.MULTI_POINT:case Lt.LINE_STRING:case Lt.MULTI_LINE_STRING:case Lt.LINEAR_RING:break;case Lt.POLYGON:for(a=e.getCoordinates(),d=Math.abs(Mt(a[0],n)),l=1,u=a.length;l<u;++l)d-=Math.abs(Mt(a[l],n));break;case Lt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(h=a[l],d+=Math.abs(Mt(h[0],n)),c=1,p=h.length;c<p;++c)d-=Math.abs(Mt(h[c],n));break;case Lt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},qS.sphere.getDistance=Pt,qS.sphere.getLength=function t(e,i){var r=i||{},n=r.radius||bt,o=r.projection||"EPSG:3857",s=e.getType();s!==Lt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,h,l,u,c,p,d=0;switch(s){case Lt.POINT:case Lt.MULTI_POINT:break;case Lt.LINE_STRING:case Lt.LINEAR_RING:d=Ft(a=e.getCoordinates(),n);break;case Lt.MULTI_LINE_STRING:case Lt.POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)d+=Ft(a[l],n);break;case Lt.MULTI_POLYGON:for(l=0,u=(a=e.getCoordinates()).length;l<u;++l)for(c=0,p=(h=a[l]).length;c<p;++c)d+=Ft(h[c],n);break;case Lt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(l=0,u=f.length;l<u;++l)d+=t(f[l],i);break;default:throw new Error("Unsupported geometry type: "+s)}return d},qS.style.AtlasManager=vp,qS.style.Circle=Xi,qS.style.Fill=zi,qS.style.Icon=Qf,qS.style.IconImageCache.shared=Al,qS.style.Image=Yi,qS.style.RegularShape=Bi,qS.style.Stroke=Vi,qS.style.Style=Wi,qS.style.Text=Ln,qS.tilegrid.TileGrid=wx,qS.tilegrid.WMTS=BS,qS.tilegrid.WMTS.createFromCapabilitiesMatrixSet=XS,qS.tilegrid.createXYZ=Lx,qS.xml.getAllTextContent=td,qS.xml.parse=rd}();
//# sourceMappingURL=ol.js.map