/*! * 基于MikesWei的CesiumVectorTile代码整理规范修改,并用webpack打包 * 版本信息:v2.0.0, hash值: 6a3f822c63f0b0504916 * 编译日期:2022-04-30 17:22:29 * Github:https://github.com/muyao1987/CesiumVectorTile/ * */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("mars3d-cesium"),require("@turf/turf")):"function"==typeof define&&define.amd?define("CesiumVectorTile",["mars3d-cesium","@turf/turf"],e):"object"==typeof exports?exports.CesiumVectorTile=e(require("mars3d-cesium"),require("@turf/turf")):t.CesiumVectorTile=e(t.Cesium,t.turf)}(window,(function(t,e){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=64)}([function(e,i){e.exports=t},function(t,i){t.exports=e},function(t,e,i){"use strict";var r=i(4),n=i(10),s=i(12);function a(t){return t}function o(t,e){for(var i=0;i1;)try{"array"===a||"nodebuffer"===a?r.push(String.fromCharCode.apply(null,t.slice(o,Math.min(o+i,n)))):r.push(String.fromCharCode.apply(null,t.subarray(o,Math.min(o+i,n)))),o+=i}catch(t){i=Math.floor(i/2)}return r.join("")}function l(t,e){for(var i=0;i * @license MIT */ var r=i(30),n=i(31),s=i(32);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return F(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,i);case"utf8":case"utf-8":return k(this,e,i);case"ascii":return E(this,e,i);case"latin1":case"binary":return A(this,e,i);case"base64":return S(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function _(t,e,i,r,n){if(0===t.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof e&&(e=h.from(e,r)),h.isBuffer(e))return 0===e.length?-1:y(t,e,i,r,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):y(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,r,n){var s,a=1,o=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,o/=2,h/=2,i/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var u=-1;for(s=i;so&&(i=o-h),s=i;s>=0;s--){for(var f=!0,c=0;cn&&(r=n):r=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a>8,n=i%256,s.push(n),s.push(r);return s}(e,t.length-i),t,i,r)}function S(t,e,i){return 0===e&&i===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,i))}function k(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n239?4:l>223?3:l>191?2:1;if(n+f<=i)switch(f){case 1:l<128&&(u=l);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&l)<<6|63&s)>127&&(u=h);break;case 3:s=t[n+1],a=t[n+2],128==(192&s)&&128==(192&a)&&(h=(15&l)<<12|(63&s)<<6|63&a)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:s=t[n+1],a=t[n+2],o=t[n+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(h=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(u=h)}null===u?(u=65533,f=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),n+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",r=0;for(;r0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),""},h.prototype.compare=function(t,e,i,r,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return-1;if(e>=i)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(r>>>=0),a=(i>>>=0)-(e>>>=0),o=Math.min(s,a),l=this.slice(r,n),u=t.slice(e,i),f=0;fn)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return v(this,t,e,i);case"utf8":case"utf-8":return b(this,t,e,i);case"ascii":return M(this,t,e,i);case"latin1":case"binary":return w(this,t,e,i);case"base64":return x(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;nr)&&(i=r);for(var n="",s=e;si)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,i,r,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function L(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-i,2);n>>8*(r?n:1-n)}function T(t,e,i,r){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-i,4);n>>8*(r?n:3-n)&255}function R(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(t,e,i,r,s){return s||R(t,0,i,4),n.write(t,e,i,r,23,4),i+4}function B(t,e,i,r,s){return s||R(t,0,i,8),n.write(t,e,i,r,52,8),i+8}h.prototype.slice=function(t,e){var i,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(n*=256);)r+=this[t+--e]*n;return r},h.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||O(t,e,this.length);for(var r=this[t],n=1,s=0;++s=(n*=128)&&(r-=Math.pow(2,8*e)),r},h.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||O(t,e,this.length);for(var r=e,n=1,s=this[t+--r];r>0&&(n*=256);)s+=this[t+--r]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,i,r){(t=+t,e|=0,i|=0,r)||N(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+i},h.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):T(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);N(this,t,e,i,n-1,-n)}var s=0,a=1,o=0;for(this[e]=255&t;++s>0)-o&255;return e+i},h.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);N(this,t,e,i,n-1,-n)}var s=i-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+i},h.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):T(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,i){return z(this,t,e,!0,i)},h.prototype.writeFloatBE=function(t,e,i){return z(this,t,e,!1,i)},h.prototype.writeDoubleLE=function(t,e,i){return B(this,t,e,!0,i)},h.prototype.writeDoubleBE=function(t,e,i){return B(this,t,e,!1,i)},h.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--n)t[n+e]=this[n+i];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function F(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,i,r){for(var n=0;n=e.length||n>=t.length);++n)e[n+i]=t[n];return n}}).call(this,i(7))},function(t,e,i){"use strict";(function(e){var r=i(63);r.default&&(r=r.default);var n=i(28),s=i(51),a=i(54),o=i(55),h=i(26),l=i(62),u=i(5).Buffer,f=new l({max:20});function c(t){if(!t)throw new Error("forgot to pass buffer");return u.isBuffer(t)?t:t instanceof e.ArrayBuffer?u.from(t):t.buffer instanceof e.ArrayBuffer?1===t.BYTES_PER_ELEMENT?u.from(t):u.from(t.buffer):void 0}function d(t,e){return"string"==typeof t&&f.has(t)?h.resolve(f.get(t)):d.getShapefile(t,e).then((function(e){return"string"==typeof t&&f.set(t,e),e}))}d.combine=function(t){for(var e={type:"FeatureCollection",features:[]},i=0,r=t[0].length;i-1?h.push(i.slice(0,-3)+i.slice(-3).toLowerCase()):"dbf"!==i.slice(-3).toLowerCase()&&"cpg"!==i.slice(-3).toLowerCase()||(s[i.slice(0,-3)+i.slice(-3).toLowerCase()]=s[i]));if(!h.length)throw new Error("no layers founds");var l=h.map((function(t){var i,r,n=t.lastIndexOf(".");return n>-1&&t.slice(n).indexOf("json")>-1?(i=JSON.parse(s[t])).fileName=t.slice(0,n):e.indexOf(t.slice(n+1))>-1?(i=s[t]).fileName=t:(s[t+".dbf"]&&(r=o(s[t+".dbf"],s[t+".cpg"])),(i=d.combine([a(s[t+".shp"],s[t+".prj"]),r])).fileName=t),i}));return 1===l.length?l[0]:l},d.getShapefile=function(t,e){return"string"==typeof t?".zip"===t.slice(-4).toLowerCase()?function(t,e){return s(t).then((function(t){return d.parseZip(t,e)}))}(t,e):h.all([h.all([s(t+".shp"),s(t+".prj")]).then((function(t){var e=!1;try{t[1]&&(e=r(t[1]))}catch(t){e=!1}return a(t[0],e)})),h.all([s(t+".dbf"),s(t+".cpg")]).then((function(t){return o(t[0],t[1])}))]).then(d.combine):new h((function(e){e(d.parseZip(t))}))},d.parseShp=function(t,e){if(t=c(t),u.isBuffer(e)&&(e=e.toString()),"string"==typeof e)try{e=r(e)}catch(t){e=!1}return a(t,e)},d.parseDbf=function(t,e){return t=c(t),o(t,e)},t.exports=d}).call(this,i(7))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t,e){for(var i,n,s,a,o,h,l,u="",f=0;f>2,o=(3&i)<<4|(n=t.charCodeAt(f++))>>4,h=(15&n)<<2|(s=t.charCodeAt(f++))>>6,l=63&s,isNaN(n)?h=l=64:isNaN(s)&&(l=64),u=u+r.charAt(a)+r.charAt(o)+r.charAt(h)+r.charAt(l);return u},e.decode=function(t,e){var i,n,s,a,o,h,l="",u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,n=(15&a)<<4|(o=r.indexOf(t.charAt(u++)))>>2,s=(3&o)<<6|(h=r.indexOf(t.charAt(u++))),l+=String.fromCharCode(i),64!=o&&(l+=String.fromCharCode(n)),64!=h&&(l+=String.fromCharCode(s));return l}},function(t,e,i){"use strict";var r=i(4),n=i(2),s=i(43),a=i(18),o=i(19),h=i(8),l=i(10),u=i(20),f=i(12),c=i(21),d=i(44),p=i(45),g=function(t){if(t._data instanceof u&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===n.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data},m=function(t){var e=g(t);return"string"===n.getTypeOf(e)?!t.options.binary&&r.nodebuffer?f(e,"utf-8"):t.asBinary():e},_=function(t){var e=g(this);return null==e?"":(this.options.base64&&(e=h.decode(e)),e=t&&this.options.binary?k.utf8decode(e):n.transformTo("string",e),t||this.options.binary||(e=n.transformTo("string",k.utf8encode(e))),e)},y=function(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this.options=i,this._initialMetadata={dir:i.dir,date:i.date}};y.prototype={asText:function(){return _.call(this,!0)},asBinary:function(){return _.call(this,!1)},asNodeBuffer:function(){var t=m(this);return n.transformTo("nodebuffer",t)},asUint8Array:function(){var t=m(this);return n.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var v=function(t,e){var i,r="";for(i=0;i>>=8;return r},b=function(t,e,i){var r,s=n.getTypeOf(e);if("string"==typeof(i=function(t){return!0!==(t=t||{}).base64||null!==t.binary&&void 0!==t.binary||(t.binary=!0),(t=n.extend(t,o)).date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t}(i)).unixPermissions&&(i.unixPermissions=parseInt(i.unixPermissions,8)),i.unixPermissions&&16384&i.unixPermissions&&(i.dir=!0),i.dosPermissions&&16&i.dosPermissions&&(i.dir=!0),i.dir&&(t=w(t)),i.createFolders&&(r=M(t))&&x.call(this,r,!0),i.dir||null==e)i.base64=!1,i.binary=!1,e=null,s=null;else if("string"===s)i.binary&&!i.base64&&!0!==i.optimizedBinaryString&&(e=n.string2binary(e));else{if(i.base64=!1,i.binary=!0,!(s||e instanceof u))throw new Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===s&&(e=n.transformTo("uint8array",e))}var a=new y(t,e,i);return this.files[t]=a,a},M=function(t){"/"==t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},w=function(t){return"/"!=t.slice(-1)&&(t+="/"),t},x=function(t,e){return e=void 0!==e&&e,t=w(t),this.files[t]||b.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]},C=function(t,e,i){var r,a=new u;return t._data instanceof u?(a.uncompressedSize=t._data.uncompressedSize,a.crc32=t._data.crc32,0===a.uncompressedSize||t.dir?(e=l.STORE,a.compressedContent="",a.crc32=0):t._data.compressionMethod===e.magic?a.compressedContent=t._data.getCompressedContent():(r=t._data.getContent(),a.compressedContent=e.compress(n.transformTo(e.compressInputType,r),i))):((r=m(t))&&0!==r.length&&!t.dir||(e=l.STORE,r=""),a.uncompressedSize=r.length,a.crc32=s(r),a.compressedContent=e.compress(n.transformTo(e.compressInputType,r),i)),a.compressedSize=a.compressedContent.length,a.compressionMethod=e.magic,a},S=function(t,e,i,r,o,h){i.compressedContent;var l,u,f,d,p=h!==c.utf8encode,g=n.transformTo("string",h(e.name)),m=n.transformTo("string",c.utf8encode(e.name)),_=e.comment||"",y=n.transformTo("string",h(_)),b=n.transformTo("string",c.utf8encode(_)),M=m.length!==e.name.length,w=b.length!==_.length,x=e.options,C="",S="",k="";f=e._initialMetadata.dir!==e.dir?e.dir:x.dir,d=e._initialMetadata.date!==e.date?e.date:x.date;var E,A,P,I=0,O=0;f&&(I|=16),"UNIX"===o?(O=798,I|=(E=e.unixPermissions,A=f,P=E,E||(P=A?16893:33204),(65535&P)<<16)):(O=20,I|=63&(e.dosPermissions||0)),l=d.getHours(),l<<=6,l|=d.getMinutes(),l<<=5,l|=d.getSeconds()/2,u=d.getFullYear()-1980,u<<=4,u|=d.getMonth()+1,u<<=5,u|=d.getDate(),M&&(S=v(1,1)+v(s(g),4)+m,C+="up"+v(S.length,2)+S),w&&(k=v(1,1)+v(this.crc32(y),4)+b,C+="uc"+v(k.length,2)+k);var N="";return N+="\n\0",N+=p||!M&&!w?"\0\0":"\0\b",N+=i.compressionMethod,N+=v(l,2),N+=v(u,2),N+=v(i.crc32,4),N+=v(i.compressedSize,4),N+=v(i.uncompressedSize,4),N+=v(g.length,2),N+=v(C.length,2),{fileRecord:a.LOCAL_FILE_HEADER+N+g+C,dirRecord:a.CENTRAL_FILE_HEADER+v(O,2)+N+v(y.length,2)+"\0\0\0\0"+v(I,4)+v(r,4)+g+C+y,compressedObject:i}},k={load:function(t,e){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e,i,r,s,a=[];for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],s=new y(r.name,r._data,n.extend(r.options)),i=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(i,s)&&a.push(s));return a},file:function(t,e,i){if(1===arguments.length){if(n.isRegExp(t)){var r=t;return this.filter((function(t,e){return!e.dir&&r.test(t)}))}return this.filter((function(e,i){return!i.dir&&e===t}))[0]||null}return t=this.root+t,b.call(this,t,e,i),this},folder:function(t){if(!t)return this;if(n.isRegExp(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=x.call(this,e),r=this.clone();return r.root=i.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),r=0;r>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{s=s+(n=n+e[r++]|0)|0}while(--a);n%=65521,s%=65521}return n|s<<16|0}},function(t,e,i){"use strict";var r=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,e,i,n){var s=r,a=n+i;t^=-1;for(var o=n;o>>8^s[255&(t^e[o])];return-1^t}},function(t,e,i){"use strict";var r=i(3),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var a=new r.Buf8(256),o=0;o<256;o++)a[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&s||!t.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var i="",a=0;a>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new r.Buf8(t.length),i=0,n=e.length;i4)l[r++]=65533,i+=s-1;else{for(n&=2===s?31:3===s?15:7;s>1&&i1?l[r++]=65533:n<65536?l[r++]=n:(n-=65536,l[r++]=55296|n>>10&1023,l[r++]=56320|1023&n)}return h(l,r)},e.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},function(t,e,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,i){"use strict";e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},function(t,e,i){"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!1,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},function(t,e,i){"use strict";function r(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}r.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},t.exports=r},function(t,e,i){"use strict";for(var r=i(2),n=i(4),s=i(12),a=new Array(256),o=0;o<256;o++)a[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;a[254]=a[254]=1;var h=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e},l=function(t){var e,i,n,s,o=t.length,h=new Array(2*o);for(i=0,e=0;e4)h[i++]=65533,e+=s-1;else{for(n&=2===s?31:3===s?15:7;s>1&&e1?h[i++]=65533:n<65536?h[i++]=n:(n-=65536,h[i++]=55296|n>>10&1023,h[i++]=56320|1023&n)}return h.length!==i&&(h.subarray?h=h.subarray(0,i):h.length=i),r.applyFromCharCode(h)};e.utf8encode=function(t){return n.nodebuffer?s(t,"utf-8"):function(t){var e,i,r,s,a,o=t.length,h=0;for(s=0;s>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e}(t)},e.utf8decode=function(t){if(n.nodebuffer)return r.transformTo("nodebuffer",t).toString("utf-8");for(var e=[],i=0,s=(t=r.transformTo(n.uint8array?"uint8array":"array",t)).length;i=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return r.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1)}},t.exports=n},function(t,e,i){"use strict";var r=i(25);function n(t){t&&(this.data=t,this.length=this.data.length,this.index=0,this.zero=0)}n.prototype=new r,n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=n},function(t,e,i){"use strict";var r=i(23);function n(t){if(t){this.data=t,this.length=this.data.length,this.index=0,this.zero=0;for(var e=0;e=0;--s)if(this.data[s]===e&&this.data[s+1]===i&&this.data[s+2]===r&&this.data[s+3]===n)return s-this.zero;return-1},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=n},function(t,e,i){"use strict";var r=i(53);function n(){}var s={},a=["REJECTED"],o=["FULFILLED"],h=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==n&&d(this,t)}function u(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function f(t,e,i){r((function(){var r;try{r=e(i)}catch(e){return s.reject(t,e)}r===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,r)}))}function c(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var i=!1;function r(e){i||(i=!0,s.reject(t,e))}function n(e){i||(i=!0,s.resolve(t,e))}var a=p((function(){e(n,r)}));"error"===a.status&&r(a.value)}function p(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}t.exports=l,l.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){throw i}))}))},l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(n);this.state!==h?f(i,this.state===o?t:e,this.outcome):this.queue.push(new u(i,t,e));return i},u.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},u.prototype.otherCallFulfilled=function(t){f(this.promise,this.onFulfilled,t)},u.prototype.callRejected=function(t){s.reject(this.promise,t)},u.prototype.otherCallRejected=function(t){f(this.promise,this.onRejected,t)},s.resolve=function(t,e){var i=p(c,e);if("error"===i.status)return s.reject(t,i.value);var r=i.value;if(r)d(t,r);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n0?a-4:a;for(i=0;i>16&255,h[u++]=e>>8&255,h[u++]=255&e;2===o&&(e=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4,h[u++]=255&e);1===o&&(e=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e);return h},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],a=0,o=i-n;ao?o:a+16383));1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return s.join("")};for(var r=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function u(t,e,i){for(var n,s,a=[],o=e;o>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ e.read=function(t,e,i,r,n){var s,a,o=8*n-r-1,h=(1<>1,u=-7,f=i?n-1:0,c=i?-1:1,d=t[e+f];for(f+=c,s=d&(1<<-u)-1,d>>=-u,u+=o;u>0;s=256*s+t[e+f],f+=c,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=c,u-=8);if(0===s)s=1-l;else{if(s===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),s-=l}return(d?-1:1)*a*Math.pow(2,s-r)},e.write=function(t,e,i,r,n,s){var a,o,h,l=8*s-n-1,u=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+f>=1?c/h:c*Math.pow(2,1-f))*h>=2&&(a++,h/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*h-1)*Math.pow(2,n),a+=f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[i+d]=255&o,d+=p,o/=256,n-=8);for(a=a<0;t[i+d]=255&a,d+=p,a/=256,l-=8);t[i+d-p]|=128*g}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=i(34);e.uncompressInputType=r?"uint8array":"array",e.compressInputType=r?"uint8array":"array",e.magic="\b\0",e.compress=function(t,e){return n.deflateRaw(t,{level:e.level||-1})},e.uncompress=function(t){return n.inflateRaw(t)}},function(t,e,i){"use strict";var r={};(0,i(3).assign)(r,i(35),i(38),i(17)),t.exports=r},function(t,e,i){"use strict";var r=i(36),n=i(3),s=i(15),a=i(11),o=i(16),h=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var i=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(a[i]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var u;if(u="string"==typeof e.dictionary?s.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=r.deflateSetDictionary(this.strm,u)))throw new Error(a[i]);this._dict_set=!0}}function u(t,e){var i=new l(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}l.prototype.push=function(t,e){var i,a,o=this.strm,l=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(l),o.next_out=0,o.avail_out=l),1!==(i=r.deflate(o,a))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(s.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==i);return 4===a?(i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==a||(this.onEnd(0),o.avail_out=0,!0)},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=l,e.deflate=u,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,u(t,e)}},function(t,e,i){"use strict";var r,n=i(3),s=i(37),a=i(13),o=i(14),h=i(11);function l(t,e){return t.msg=h[e],e}function u(t){return(t<<1)-(t>4?9:0)}function f(t){for(var e=t.length;--e>=0;)t[e]=0}function c(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function d(t,e){s._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,c(t.strm)}function p(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function m(t,e){var i,r,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,l=t.window,u=t.w_mask,f=t.prev,c=t.strstart+258,d=l[s+a-1],p=l[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(i=e)+a]===p&&l[i+a-1]===d&&l[i]===l[s]&&l[++i]===l[s+1]){s+=2,i++;do{}while(l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&sa){if(t.match_start=e,a=r,r>=o)break;d=l[s+a-1],p=l[s+a]}}}while((e=f[e&u])>h&&0!=--n);return a<=t.lookahead?a:t.lookahead}function _(t){var e,i,r,s,h,l,u,f,c,d,p=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-262)){n.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=i=t.hash_size;do{r=t.head[--e],t.head[e]=r>=p?r-p:0}while(--i);e=i=p;do{r=t.prev[--e],t.prev[e]=r>=p?r-p:0}while(--i);s+=p}if(0===t.strm.avail_in)break;if(l=t.strm,u=t.window,f=t.strstart+t.lookahead,c=s,d=void 0,(d=l.avail_in)>c&&(d=c),i=0===d?0:(l.avail_in-=d,n.arraySet(u,l.input,l.next_in,d,f),1===l.state.wrap?l.adler=a(l.adler,u,d,f):2===l.state.wrap&&(l.adler=o(l.adler,u,d,f)),l.next_in+=d,l.total_in+=d,d),t.lookahead+=i,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(r=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,r=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<15&&(o=2,r-=16),s<1||s>9||8!==i||r<8||r>15||e<0||e>9||a<0||a>4)return l(t,-2);8===r&&(r=9);var h=new M;return t.state=h,h.strm=t,h.wrap=o,h.gzhead=null,h.w_bits=r,h.w_size=1<t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,d(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(d(t,!1),t.strm.avail_out),1)})),new b(4,4,8,4,y),new b(4,5,16,8,y),new b(4,6,32,32,y),new b(4,4,16,16,v),new b(8,16,32,32,v),new b(8,16,128,128,v),new b(8,32,128,256,v),new b(32,128,258,1024,v),new b(32,258,258,4096,v)],e.deflateInit=function(t,e){return C(t,e,8,15,8,0)},e.deflateInit2=C,e.deflateReset=x,e.deflateResetKeep=w,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},e.deflate=function(t,e){var i,n,a,h;if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(n.strm=t,i=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,p(n,31),p(n,139),p(n,8),n.gzhead?(p(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),p(n,255&n.gzhead.time),p(n,n.gzhead.time>>8&255),p(n,n.gzhead.time>>16&255),p(n,n.gzhead.time>>24&255),p(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),p(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(p(n,255&n.gzhead.extra.length),p(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=o(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(p(n,0),p(n,0),p(n,0),p(n,0),p(n,0),p(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),p(n,3),n.status=113);else{var m=8+(n.w_bits-8<<4)<<8;m|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(m|=32),m+=31-m%31,n.status=113,g(n,m),0!==n.strstart&&(g(n,t.adler>>>16),g(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending!==n.pending_buf_size));)p(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindexa&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===h&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindexa&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===h&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&c(t),n.pending+2<=n.pending_buf_size&&(p(n,255&t.adler),p(n,t.adler>>8&255),t.adler=0,n.status=113)):n.status=113),0!==n.pending){if(c(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&u(e)<=u(i)&&4!==e)return l(t,-5);if(666===n.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&666!==n.status){var y=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var i,r,n,a,o=t.window;;){if(t.lookahead<=258){if(_(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=o[n=t.strstart-1])===o[++n]&&r===o[++n]&&r===o[++n]){a=t.strstart+258;do{}while(r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==y&&4!==y||(n.status=666),1===y||3===y)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===y&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(f(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),c(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(p(n,255&t.adler),p(n,t.adler>>8&255),p(n,t.adler>>16&255),p(n,t.adler>>24&255),p(n,255&t.total_in),p(n,t.total_in>>8&255),p(n,t.total_in>>16&255),p(n,t.total_in>>24&255)):(g(n,t.adler>>>16),g(n,65535&t.adler)),c(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var i,r,s,o,h,l,u,c,d=e.length;if(!t||!t.state)return-2;if(2===(o=(i=t.state).wrap)||1===o&&42!==i.status||i.lookahead)return-2;for(1===o&&(t.adler=a(t.adler,e,d,0)),i.wrap=0,d>=i.w_size&&(0===o&&(f(i.head),i.strstart=0,i.block_start=0,i.insert=0),c=new n.Buf8(i.w_size),n.arraySet(c,e,d-i.w_size,i.w_size,0),e=c,d=i.w_size),h=t.avail_in,l=t.next_in,u=t.input,t.avail_in=d,t.next_in=0,t.input=e,_(i);i.lookahead>=3;){r=i.strstart,s=i.lookahead-2;do{i.ins_h=(i.ins_h<=0;)t[e]=0}var s=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);n(l);var u=new Array(60);n(u);var f=new Array(512);n(f);var c=new Array(256);n(c);var d=new Array(29);n(d);var p,g,m,_=new Array(30);function y(t,e,i,r,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function b(t){return t<256?f[t]:f[256+(t>>>7)]}function M(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function w(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<>>=1,i<<=1}while(--e>0);return i>>>1}function S(t,e,i){var r,n,s=new Array(16),a=0;for(r=1;r<=15;r++)s[r]=a=a+i[r-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=C(s[o]++,o))}}function k(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){t.bi_valid>8?M(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function A(t,e,i,r){var n=2*e,s=2*i;return t[n]>1;i>=1;i--)P(t,s,i);n=h;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,s,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,s[2*n]=s[2*i]+s[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,s[2*i+1]=s[2*r+1]=n,t.heap[1]=n++,P(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,s,a,o,h=e.dyn_tree,l=e.max_code,u=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=15;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(s=h[2*h[2*(r=t.heap[i])+1]+1]+1)>p&&(s=p,g++),h[2*r+1]=s,r>l||(t.bl_count[s]++,a=0,r>=d&&(a=c[r-d]),o=h[2*r],t.opt_len+=o*(s+a),f&&(t.static_len+=o*(u[2*r+1]+a)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(r=t.bl_count[s];0!==r;)(n=t.heap[--i])>l||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),r--)}}(t,e),S(s,l,t.bl_count)}function N(t,e,i){var r,n,s=-1,a=e[1],o=0,h=7,l=4;for(0===a&&(h=138,l=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=a,a=e[2*(r+1)+1],++o>=7;r<30;r++)for(_[r]=n<<7,t=0;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),O(t,t.l_desc),O(t,t.d_desc),a=function(t){var e;for(N(t,t.dyn_ltree,t.l_desc.max_code),N(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=i+5,i+4<=n&&-1!==e?R(t,e,i,r):4===t.strategy||s===n?(w(t,2+(r?1:0),3),I(t,l,u)):(w(t,4+(r?1:0),3),function(t,e,i,r){var n;for(w(t,e-257,5),w(t,i-1,5),w(t,r-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){w(t,2,3),x(t,256,l),function(t){16===t.bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,i){"use strict";var r=i(39),n=i(3),s=i(15),a=i(17),o=i(11),h=i(16),l=i(42),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(o[i]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=s.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=r.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(o[i])}function c(t,e){var i=new f(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}f.prototype.push=function(t,e){var i,o,h,l,f,c=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?c.input=s.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new n.Buf8(d),c.next_out=0,c.avail_out=d),(i=r.inflate(c,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(i=r.inflateSetDictionary(this.strm,p)),i===a.Z_BUF_ERROR&&!0===g&&(i=a.Z_OK,g=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&i!==a.Z_STREAM_END&&(0!==c.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(c.output,c.next_out),l=c.next_out-h,f=s.buf2string(c.output,h),c.next_out=l,c.avail_out=d-l,l&&n.arraySet(c.output,c.output,h,l,0),this.onData(f)):this.onData(n.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(g=!0)}while((c.avail_in>0||0===c.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),c.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=f,e.inflate=c,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},e.ungzip=c},function(t,e,i){"use strict";var r=i(3),n=i(13),s=i(14),a=i(40),o=i(41);function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):-2}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):-2}function c(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,f(t))):-2}function d(t,e){var i,r;return t?(r=new l,t.state=r,r.window=null,0!==(i=c(t,e))&&(t.state=null),i):-2}var p,g,m=!0;function _(t){if(m){var e;for(p=new r.Buf32(512),g=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,g,0,t.work,{bits:5}),m=!1}t.lencode=p,t.lenbits=9,t.distcode=g,t.distbits=5}function y(t,e,i,n){var s,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(r.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((s=a.wsize-a.wnext)>n&&(s=n),r.arraySet(a.window,e,i-n,s,a.wnext),(n-=s)?(r.arraySet(a.window,e,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,i.check=s(i.check,R,2,0),g=0,m=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",i.mode=30;break}if(m-=4,I=8+(15&(g>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(R[0]=255&g,R[1]=g>>>8&255,i.check=s(i.check,R,2,0)),g=0,m=0,i.mode=3;case 3:for(;m<32;){if(0===d)break t;d--,g+=l[f++]<>>8&255,R[2]=g>>>16&255,R[3]=g>>>24&255,i.check=s(i.check,R,4,0)),g=0,m=0,i.mode=4;case 4:for(;m<16;){if(0===d)break t;d--,g+=l[f++]<>8),512&i.flags&&(R[0]=255&g,R[1]=g>>>8&255,i.check=s(i.check,R,2,0)),g=0,m=0,i.mode=5;case 5:if(1024&i.flags){for(;m<16;){if(0===d)break t;d--,g+=l[f++]<>>8&255,i.check=s(i.check,R,2,0)),g=0,m=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((M=i.length)>d&&(M=d),M&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,l,f,M,I)),512&i.flags&&(i.check=s(i.check,l,M,f)),d-=M,f+=M,i.length-=M),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===d)break t;M=0;do{I=l[f+M++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I))}while(I&&M>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;m<32;){if(0===d)break t;d--,g+=l[f++]<>>=7&m,m-=7&m,i.mode=27;break}for(;m<3;){if(0===d)break t;d--,g+=l[f++]<>>=1)){case 0:i.mode=14;break;case 1:if(_(i),i.mode=20,6===e){g>>>=2,m-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===d)break t;d--,g+=l[f++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&g,g=0,m=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(M=i.length){if(M>d&&(M=d),M>p&&(M=p),0===M)break t;r.arraySet(u,l,f,M,c),d-=M,f+=M,p-=M,c+=M,i.length-=M;break}i.mode=12;break;case 17:for(;m<14;){if(0===d)break t;d--,g+=l[f++]<>>=5,m-=5,i.ndist=1+(31&g),g>>>=5,m-=5,i.ncode=4+(15&g),g>>>=4,m-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have>>=3,m-=3}for(;i.have<19;)i.lens[z[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},O=o(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,O){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,k=65535&T,!((C=T>>>24)<=m);){if(0===d)break t;d--,g+=l[f++]<>>=C,m-=C,i.lens[i.have++]=k;else{if(16===k){for(L=C+2;m>>=C,m-=C,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],M=3+(3&g),g>>>=2,m-=2}else if(17===k){for(L=C+3;m>>=C)),g>>>=3,m-=3}else{for(L=C+7;m>>=C)),g>>>=7,m-=7}if(i.have+M>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;M--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,N={bits:i.lenbits},O=o(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,O){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},O=o(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,O){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(d>=6&&p>=258){t.next_out=c,t.avail_out=p,t.next_in=f,t.avail_in=d,i.hold=g,i.bits=m,a(t,b),c=t.next_out,u=t.output,p=t.avail_out,f=t.next_in,l=t.input,d=t.avail_in,g=i.hold,m=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;S=(T=i.lencode[g&(1<>>16&255,k=65535&T,!((C=T>>>24)<=m);){if(0===d)break t;d--,g+=l[f++]<>E)])>>>16&255,k=65535&T,!(E+(C=T>>>24)<=m);){if(0===d)break t;d--,g+=l[f++]<>>=E,m-=E,i.back+=E}if(g>>>=C,m-=C,i.back+=C,i.length=k,0===S){i.mode=26;break}if(32&S){i.back=-1,i.mode=12;break}if(64&S){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&S,i.mode=22;case 22:if(i.extra){for(L=i.extra;m>>=i.extra,m-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;S=(T=i.distcode[g&(1<>>16&255,k=65535&T,!((C=T>>>24)<=m);){if(0===d)break t;d--,g+=l[f++]<>E)])>>>16&255,k=65535&T,!(E+(C=T>>>24)<=m);){if(0===d)break t;d--,g+=l[f++]<>>=E,m-=E,i.back+=E}if(g>>>=C,m-=C,i.back+=C,64&S){t.msg="invalid distance code",i.mode=30;break}i.offset=k,i.extra=15&S,i.mode=24;case 24:if(i.extra){for(L=i.extra;m>>=i.extra,m-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===p)break t;if(M=b-p,i.offset>M){if((M=i.offset-M)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}M>i.wnext?(M-=i.wnext,w=i.wsize-M):w=i.wnext-M,M>i.length&&(M=i.length),x=i.window}else x=u,w=c-i.offset,M=i.length;M>p&&(M=p),p-=M,i.length-=M;do{u[c++]=x[w++]}while(--M);0===i.length&&(i.mode=21);break;case 26:if(0===p)break t;u[c++]=i.length,p--,i.mode=21;break;case 27:if(i.wrap){for(;m<32;){if(0===d)break t;d--,g|=l[f++]<>>=b=v>>>24,p-=b,0===(b=v>>>16&255))k[s++]=65535&v;else{if(!(16&b)){if(0==(64&b)){v=g[(65535&v)+(d&(1<>>=b,p-=b),p<15&&(d+=S[r++]<>>=b=v>>>24,p-=b,!(16&(b=v>>>16&255))){if(0==(64&b)){v=m[(65535&v)+(d&(1<h){t.msg="invalid distance too far back",i.mode=30;break t}if(d>>>=b,p-=b,w>(b=s-a)){if((b=w-b)>u&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(x=0,C=c,0===f){if(x+=l-b,b2;)k[s++]=C[x++],k[s++]=C[x++],k[s++]=C[x++],M-=3;M&&(k[s++]=C[x++],M>1&&(k[s++]=C[x++]))}else{x=s-w;do{k[s++]=k[x++],k[s++]=k[x++],k[s++]=k[x++],M-=3}while(M>2);M&&(k[s++]=k[x++],M>1&&(k[s++]=k[x++]))}break}}break}}while(r>3,d&=(1<<(p-=M<<3))-1,t.next_in=r,t.next_out=s,t.avail_in=r=1&&0===R[k];k--);if(E>k&&(E=k),0===k)return l[u++]=20971520,l[u++]=20971520,c.bits=1,0;for(S=1;S0&&(0===t||1!==k))return-1;for(z[1]=0,x=1;x<15;x++)z[x+1]=z[x]+R[x];for(C=0;C852||2===t&&O>592)return 1;for(;;){v=x-P,f[C]y?(b=B[D+f[C]],M=L[T+f[C]]):(b=96,M=0),d=1<>P)+(p-=d)]=v<<24|b<<16|M|0}while(0!==p);for(d=1<>=1;if(0!==d?(N&=d-1,N+=d):N=0,C++,0==--R[x]){if(x===k)break;x=e[i+f[C]]}if(x>E&&(N&m)!==g){for(0===P&&(P=E),_+=S,I=1<<(A=x-P);A+P852||2===t&&O>592)return 1;l[g=N&m]=E<<24|A<<16|_-u|0}}return 0!==N&&(l[_+N]=x-P<<24|64<<16|0),c.bits=E,0}},function(t,e,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,i){"use strict";var r=i(2),n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];t.exports=function(t,e){if(void 0===t||!t.length)return 0;var i="string"!==r.getTypeOf(t);void 0===e&&(e=0);var s=0;e^=-1;for(var a=0,o=t.length;a>>8^n[255&(e^s)];return-1^e}},function(t,e,i){"use strict";var r=i(2),n=function(){this.data=[]};n.prototype={append:function(t){t=r.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}},t.exports=n},function(t,e,i){"use strict";var r=i(2),n=function(t){this.data=new Uint8Array(t),this.index=0};n.prototype={append:function(t){0!==t.length&&(t=r.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}},t.exports=n},function(t,e,i){"use strict";var r=i(8),n=i(21),s=i(2),a=i(47);t.exports=function(t,e){var i,o,h,l;for((e=s.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode})).base64&&(t=r.decode(t)),i=(o=new a(t,e)).files,h=0;h1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,h.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(t){var e=o.getTypeOf(t);if(o.checkSupport(e),"string"!==e||u.uint8array)if("nodebuffer"===e)this.reader=new n(t);else if(u.uint8array)this.reader=new s(o.transformTo("uint8array",t));else{if(!u.array)throw new Error("Unexpected error: unsupported type '"+e+"'");this.reader=new a(o.transformTo("array",t))}else this.reader=new r(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=f},function(t,e,i){"use strict";var r=i(24);function n(t){this.data=t,this.length=this.data.length,this.index=0,this.zero=0}n.prototype=new r,n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=n},function(t,e,i){"use strict";var r=i(22),n=i(2),s=i(20),a=i(9),o=i(4);function h(t,e){this.options=t,this.loadOptions=e}h.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},prepareCompressedContent:function(t,e,i){return function(){var r=t.index;t.setIndex(e);var n=t.readData(i);return t.setIndex(r),n}},prepareContent:function(t,e,i,r,s){return function(){var t=n.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==s)throw new Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1==this.compressedSize||-1==this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(null===(e=n.findCompression(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");if(this.decompressed=new s,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=n.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readInt(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=t.readData(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=new r(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,r,n=t.index;for(this.extraFields=this.extraFields||{};t.index399)throw new Error(a.statusText);if(s)return a.text();var a=await a.arrayBuffer();return n.from(a)}catch(t){if(s)return!1;throw t}}}).call(this,i(7))},function(t,e,i){"use strict";var r=i(26),n=i(5).Buffer;t.exports=function(t){return new r((function(e,i){var r=t.slice(-3),s=new XMLHttpRequest;s.open("GET",t,!0),"prj"!==r&&"cpg"!==r&&(s.responseType="arraybuffer"),s.addEventListener("load",(function(){return s.status>399?"prj"===r||"cpg"===r?e(!1):i(new Error(s.status)):e("prj"!==r&&"cpg"!==r?n.from(s.response):s.response)}),!1),s.send()}))}},function(t,e,i){"use strict";(function(e){var i,r,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var s=0,a=new n(u),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=s=++s%2}}else if(e.setImmediate||void 0===e.MessageChannel)i="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var h=new e.MessageChannel;h.port1.onmessage=u,i=function(){h.port2.postMessage(0)}}var l=[];function u(){var t,e;r=!0;for(var i=l.length;i;){for(e=l,l=[],t=-1;++t0}(e)&&t.length?t[t.length-1].push(e):t.push([e]),t}s.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},s.prototype.parseZPoint=function(t){var e=this.parsePoint(t);return e.coordinates.push(t.readDoubleLE(16)),e},s.prototype.parsePointArray=function(t,e,i){for(var r=[],n=0;n20&&(i-=20),!(i in n))throw new Error("I don't know that shp type");this.parseFunc=this[n[i]],this.parseCoord=(e=t)?function(t,i){return e.inverse([t.readDoubleLE(i),t.readDoubleLE(i+8)])}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]}},s.prototype.getShpCode=function(){return this.parseHeader().shpCode},s.prototype.parseHeader=function(){var t=this.buffer.slice(0,100);return{length:t.readInt32BE(24),version:t.readInt32LE(28),shpCode:t.readInt32LE(32),bbox:[t.readDoubleLE(36),t.readDoubleLE(44),t.readDoubleLE(52),t.readDoubleLE(52)]}},s.prototype.getRows=function(){for(var t,e=100,i=this.buffer.byteLength,r=[];e>6*i)+n];i>0;){var a=e>>6*(i-1);s.push(128|63&a),i-=1}return s}}function S(t,e){var i=e.fatal;this.handler=function(e,r){if(-1===r)return-1;if(a(r))return r;var n=t[r-128];return null===n?l(i):n}}function k(t,e){e.fatal;this.handler=function(e,i){if(-1===i)return-1;if(o(i))return i;var r=v(i,t);return null===r&&u(i),r+128}}function E(t){var e=t.fatal,i=0,n=0,s=0;this.handler=function(t,o){if(-1===o&&0===i&&0===n&&0===s)return-1;var h;if(-1!==o||0===i&&0===n&&0===s||(i=0,n=0,s=0,l(e)),0!==s){h=null,r(o,48,57)&&(h=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,i=0,r=0,n=b("gb18030-ranges");for(e=0;e>8,r=255&t;return e?[i,r]:[r,i]}function U(t,e){var i=e.fatal,n=null,s=null;this.handler=function(e,a){if(-1===a&&(null!==n||null!==s))return l(i);if(-1===a&&null===n&&null===s)return-1;if(null===n)return n=a,null;var o;if(o=t?(n<<8)+a:(a<<8)+n,n=null,null!==s){var h=s;return s=null,r(o,56320,57343)?65536+1024*(h-55296)+(o-56320):(e.prepend(j(o,t)),l(i))}return r(o,55296,56319)?(s=o,null):r(o,56320,57343)?l(i):o}}function F(t,e){e.fatal;this.handler=function(e,i){if(-1===i)return-1;if(r(i,0,65535))return j(i,t);var n=j(55296+(i-65536>>10),t),s=j(56320+(i-65536&1023),t);return n.concat(s)}}function q(t){t.fatal;this.handler=function(t,e){return-1===e?-1:a(e)?e:63360+e-128}}function G(t){t.fatal;this.handler=function(t,e){return-1===e?-1:o(e)?e:r(e,63360,63487)?e-63360+128:u(e)}}Object.defineProperty&&(Object.defineProperty(M.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(M.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(M.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),M.prototype.decode=function(t,e){var i;i="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=s(e),this._do_not_flush||(this._decoder=_[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var r,n=new h(i),a=[];;){var o=n.read();if(-1===o)break;if(-1===(r=this._decoder.handler(n,o)))break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}if(!this._do_not_flush){do{if(-1===(r=this._decoder.handler(n,n.read())))break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}while(!n.endOfStream());this._decoder=null}return function(t){var e,i;return e=["UTF-8","UTF-16LE","UTF-16BE"],i=this._encoding.name,-1===e.indexOf(i)||this._ignoreBOM||this._BOMseen||(t.length>0&&65279===t[0]?(this._BOMseen=!0,t.shift()):t.length>0&&(this._BOMseen=!0)),function(t){for(var e="",i=0;i>10),56320+(1023&r)))}return e}(t)}.call(this,a)},Object.defineProperty&&Object.defineProperty(w.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),w.prototype.encode=function(t,e){t=void 0===t?"":String(t),e=s(e),this._do_not_flush||(this._encoder=m[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var i,r=new h(function(t){for(var e=String(t),i=e.length,r=0,n=[];r57343)n.push(s);else if(56320<=s&&s<=57343)n.push(65533);else if(55296<=s&&s<=56319)if(r===i-1)n.push(65533);else{var a=e.charCodeAt(r+1);if(56320<=a&&a<=57343){var o=1023&s,h=1023&a;n.push(65536+(o<<10)+h),r+=1}else n.push(65533)}r+=1}return n}(t)),n=[];;){var a=r.read();if(-1===a)break;if(-1===(i=this._encoder.handler(r,a)))break;Array.isArray(i)?n.push.apply(n,i):n.push(i)}if(!this._do_not_flush){for(;-1!==(i=this._encoder.handler(r,r.read()));)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)},m["UTF-8"]=function(t){return new C(t)},_["UTF-8"]=function(t){return new x(t)},"encoding-indexes"in e&&c.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,i=b(e.toLowerCase());_[e]=function(t){return new S(i,t)},m[e]=function(t){return new k(i,t)}}))})),_.GBK=function(t){return new E(t)},m.GBK=function(t){return new A(t,!0)},m.gb18030=function(t){return new A(t)},_.gb18030=function(t){return new E(t)},m.Big5=function(t){return new I(t)},_.Big5=function(t){return new P(t)},m["EUC-JP"]=function(t){return new N(t)},_["EUC-JP"]=function(t){return new O(t)},m["ISO-2022-JP"]=function(t){return new T(t)},_["ISO-2022-JP"]=function(t){return new L(t)},m.Shift_JIS=function(t){return new z(t)},_.Shift_JIS=function(t){return new R(t)},m["EUC-KR"]=function(t){return new D(t)},_["EUC-KR"]=function(t){return new B(t)},m["UTF-16BE"]=function(t){return new F(!0,t)},_["UTF-16BE"]=function(t){return new U(!0,t)},m["UTF-16LE"]=function(t){return new F(!1,t)},_["UTF-16LE"]=function(t){return new U(!1,t)},m["x-user-defined"]=function(t){return new G(t)},_["x-user-defined"]=function(t){return new q(t)},e.TextEncoder||(e.TextEncoder=w),e.TextDecoder||(e.TextDecoder=M),t.exports&&(t.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},function(t,e){},function(t,e,i){"use strict";var r=i(61).Buffer,n=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=l,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function u(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return n>0&&(t.lastNeed=n-1),n;if(--r=0)return n>0&&(t.lastNeed=n-2),n;if(--r=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,i){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var r=i(5),n=r.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return n(t,e,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(s(r,e),e.Buffer=a),a.prototype=Object.create(n.prototype),s(n,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=n(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,i){!function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(){return 1}t.exports?t.exports=s:this.LRUCache=s;var r=!1;function n(t){r||"string"==typeof t||"number"==typeof t||(r=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||i,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=i),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,this.reset()}function a(t,e,i){n(e);var r=t._cache[e];return r&&(o(t,r)?(u(t,r),t._allowStale||(r=void 0)):i&&function(t,e){l(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}(t,r),r&&(r=r.value)),r}function o(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t._maxAge&&i>t._maxAge}function h(t){for(;t._lrut._max;)u(t,t._lruList[t._lru])}function l(t,e){for(delete t._lruList[e.lu];t._lruthis._max&&h(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t)for(var e in this._lengthCalculator=i,this._length=this._itemCount,this._cache)this._cache[e].length=1;else for(var e in this._lengthCalculator=t,this._length=0,this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length;this._length>this._max&&h(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),s.prototype.forEach=function(t,e){e=e||this;for(var i=0,r=this._itemCount,n=this._mru-1;n>=0&&i=0&&e=0&&e=0&&ethis._max?(u(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=s,this._cache[t].maxAge=r,this._cache[t].value=i,this._length+=a-this._cache[t].length,this._cache[t].length=a,this.get(t),this._length>this._max&&h(this),!0);var o=new f(t,i,this._mru++,a,s,r);return o.length>this._max?(this._dispose&&this._dispose(t,i),!1):(this._length+=o.length,this._lruList[o.lu]=this._cache[t]=o,this._itemCount++,this._length>this._max&&h(this),!0)},s.prototype.has=function(t){return n(t),!!e(this._cache,t)&&!o(this,this._cache[t])},s.prototype.get=function(t){return n(t),a(this,t,!0)},s.prototype.peek=function(t){return n(t),a(this,t,!1)},s.prototype.pop=function(){var t=this._lruList[this._lru];return u(this,t),t||null},s.prototype.del=function(t){n(t),u(this,this._cache[t])},s.prototype.load=function(t){this.reset();for(var e=Date.now(),i=t.length-1;i>=0;i--){var r=t[i];n(r.k);var s=r.e||0;if(0===s)this.set(r.k,r.v);else{var a=s-e;a>0&&this.set(r.k,r.v,a)}}}}()},function(t,e,i){"use strict";i.r(e);var r=484813681109536e-20,n=Math.PI/2,s=.017453292519943295,a=57.29577951308232,o=Math.PI/4,h=2*Math.PI,l=3.14159265359,u={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},f={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},c=/[\s_\-\/\(\)]/g;function d(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),n=e.toLowerCase().replace(c,""),s=-1;++s=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},M.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(v.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},M.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},M.prototype.number=function(t){if(!b.test(t)){if(v.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},M.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},M.prototype.keyword=function(t){if(y.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!v.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},M.prototype.neutral=function(t){if(_.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(b.test(t))return this.word=t,void(this.state=3);if(!v.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},M.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(n),n};function k(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?k[t]=p(arguments[1]):k[t]=S(arguments[1]):k[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?k.apply(e,t):k(t)}));if("string"==typeof t){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(k);var E=k;var A=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var P=["3857","900913","3785","102113"];var I=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in E}(t))return E[t];if(function(t){return A.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=S(t);if(function(t){var e=d(t,"authority");if(e){var i=d(e,"epsg");return i&&P.indexOf(i)>-1}}(e))return E["EPSG:3857"];var i=function(t){var e=d(t,"extension");if(e)return d(e,"proj4")}(e);return i?p(i):e}return function(t){return"+"===t[0]}(t)?p(t):void 0},O=function(t,e){var i,r;if(t=t||{},!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t},N=function(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)},L=function(t){return t<0?-1:1},T=function(t){return Math.abs(t)<=l?t:t-L(t)*h},R=function(t,e,i){var r=t*i,s=.5*t;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(n-e))/r},z=function(t,e){for(var i,r,s=.5*t,a=n-2*Math.atan(e),o=0;o<=15;o++)if(i=t*Math.sin(a),a+=r=n-2*Math.atan(e*Math.pow((1-i)/(1+i),s))-a,Math.abs(r)<=1e-10)return a;return-9999};function B(t){return t}var D=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=N(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,i,r=t.x,s=t.y;if(s*a>90&&s*a<-90&&r*a>180&&r*a<-180)return null;if(Math.abs(Math.abs(s)-n)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*T(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(o+.5*s));else{var h=Math.sin(s),l=R(this.e,s,h);e=this.x0+this.a*this.k0*T(r-this.long0),i=this.y0-this.a*this.k0*Math.log(l)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,r=t.x-this.x0,s=t.y-this.y0;if(this.sphere)i=n-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var a=Math.exp(-s/(this.a*this.k0));if(-9999===(i=z(this.e,a)))return null}return e=T(this.long0+r/(this.a*this.k0)),t.x=e,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:B,inverse:B,names:["longlat","identity"]}],j={},U=[];function F(t,e){var i=U.length;return t.names?(U[i]=t,t.names.forEach((function(t){j[t.toLowerCase()]=i})),this):(console.log(e),!0)}var q={start:function(){D.forEach(F)},add:F,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==j[e]&&U[j[e]]?U[j[e]]:void 0}},G={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Z=G.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};G.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Y={};Y.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Y.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Y.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Y.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Y.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Y.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Y.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Y.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Y.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Y.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Y.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Y.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Y.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Y.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Y.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Y.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Y.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var V=function(t,e,i,n,s,a,o){var h={};return h.datum_type=void 0===t||"none"===t?5:4,e&&(h.datum_params=e.map(parseFloat),0===h.datum_params[0]&&0===h.datum_params[1]&&0===h.datum_params[2]||(h.datum_type=1),h.datum_params.length>3&&(0===h.datum_params[3]&&0===h.datum_params[4]&&0===h.datum_params[5]&&0===h.datum_params[6]||(h.datum_type=2,h.datum_params[3]*=r,h.datum_params[4]*=r,h.datum_params[5]*=r,h.datum_params[6]=h.datum_params[6]/1e6+1))),o&&(h.datum_type=3,h.grids=o),h.a=i,h.b=n,h.es=s,h.ep2=a,h},W={};function X(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:W[t]||null,isNull:!1}}function H(t){return t/3600*Math.PI/180}function J(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function K(t){return t.map((function(t){return[H(t.longitudeShift),H(t.latitudeShift)]}))}function Q(t,e,i){return{name:J(t,e+8,e+16).trim(),parent:J(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function $(t,e,i,r){for(var n=e+176,s=[],a=0;a-1.001*n)l=-n;else if(l>n&&l<1.001*n)l=n;else{if(l<-n)return{x:-1/0,y:-1/0,z:t.z};if(l>n)return{x:1/0,y:1/0,z:t.z}}return h>Math.PI&&(h-=2*Math.PI),s=Math.sin(l),o=Math.cos(l),a=s*s,{x:((r=i/Math.sqrt(1-e*a))+u)*o*Math.cos(h),y:(r+u)*o*Math.sin(h),z:(r*(1-e)+u)*s}}function rt(t,e,i,r){var s,a,o,h,l,u,f,c,d,p,g,m,_,y,v,b=t.x,M=t.y,w=t.z?t.z:0;if(s=Math.sqrt(b*b+M*M),a=Math.sqrt(b*b+M*M+w*w),s/i<1e-12){if(y=0,a/i<1e-12)return n,v=-r,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(M,b);o=w/a,c=(h=s/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*h*h)),d=o*l,_=0;do{_++,u=e*(f=i/Math.sqrt(1-e*d*d))/(f+(v=s*c+w*d-f*(1-e*d*d))),m=(g=o*(l=1/Math.sqrt(1-u*(2-u)*h*h)))*c-(p=h*(1-u)*l)*d,c=p,d=g}while(m*m>1e-24&&_<30);return{x:y,y:Math.atan(g/Math.abs(p)),z:v}}function nt(t){return 1===t||2===t}var st=function(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return i;if(5===t.datum_type||5===e.datum_type)return i;var r=t.a,n=t.es;if(3===t.datum_type){if(0!==at(t,!1,i))return;r=6378137,n=.0066943799901413165}var s=e.a,a=e.b,o=e.es;if(3===e.datum_type&&(s=6378137,a=6356752.314,o=.0066943799901413165),n===o&&r===s&&!nt(t.datum_type)&&!nt(e.datum_type))return i;if((i=it(i,n,r),nt(t.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],h=i[5],l=i[6];return{x:l*(t.x-h*t.y+o*t.z)+r,y:l*(h*t.x+t.y-a*t.z)+n,z:l*(-o*t.x+a*t.y+t.z)+s}}}(i,t.datum_type,t.datum_params)),nt(e.datum_type)&&(i=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],h=i[5],l=i[6],u=(t.x-r)/l,f=(t.y-n)/l,c=(t.z-s)/l;return{x:u+h*f-o*c,y:-h*u+f+a*c,z:o*u-a*f+c}}}(i,e.datum_type,e.datum_params)),i=rt(i,o,s,a),3===e.datum_type)&&0!==at(e,!0,i))return;return i};function at(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},s=[],o=0;or.y||f>r.x||p1e-12&&Math.abs(a.y)>1e-12);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=T(s.x+i.ll[0]),r.y=s.y+i.ll[1]}else isNaN(s.x)||(r.x=t.x+s.x,r.y=t.y+s.y);return r}function ht(t,e){var i,r={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(r.x),s=Math.floor(r.y),a=r.x-1*n,o=r.y-1*s,h={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return h;if(s<0||s>=e.lim[1])return h;i=s*e.lim[0]+n;var l=e.cvs[i][0],u=e.cvs[i][1];i++;var f=e.cvs[i][0],c=e.cvs[i][1];i+=e.lim[0];var d=e.cvs[i][0],p=e.cvs[i][1];i--;var g=e.cvs[i][0],m=e.cvs[i][1],_=a*o,y=a*(1-o),v=(1-a)*(1-o),b=(1-a)*o;return h.x=v*l+y*f+b*g+_*d,h.y=v*u+y*c+b*m+_*p,h}var lt=function(t,e,i){var r,n,s,a=i.x,o=i.y,h=i.z||0,l={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==i.z)switch(0===s?(r=a,n=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(r=o,n=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(r=h,n="z"),t.axis[s]){case"e":l[n]=r;break;case"w":l[n]=-r;break;case"n":l[n]=r;break;case"s":l[n]=-r;break;case"u":void 0!==i[n]&&(l.z=r);break;case"d":void 0!==i[n]&&(l.z=-r);break;default:return null}return l},ut=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function ft(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function ct(t,e,i,r){var n;if(Array.isArray(i)&&(i=ut(i)),function(t){ft(t.x),ft(t.y)}(i),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(i=ct(t,n=new et("WGS84"),i,r),t=n),r&&"enu"!==t.axis&&(i=lt(t,!1,i)),"longlat"===t.projName)i={x:i.x*s,y:i.y*s,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=st(t.datum,e.datum,i))return e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),"longlat"===e.projName?i={x:i.x*a,y:i.y*a,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),r&&"enu"!==e.axis?lt(e,!0,i):i}var dt=et("WGS84");function pt(t,e,i,r){var n,s,a;return Array.isArray(i)?(n=ct(t,e,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(s=ct(t,e,i,r),2===(a=Object.keys(i)).length||a.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;s[r]=i[r]})),s)}function gt(t){return t instanceof et?t:t.oProj?t.oProj:et(t)}var mt=function(t,e,i){t=gt(t);var r,n=!1;return void 0===e?(e=t,t=dt,n=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=dt,n=!0),e=gt(e),i?pt(t,e,i):(r={forward:function(i,r){return pt(t,e,i,r)},inverse:function(i,r){return pt(e,t,i,r)}},n&&(r.oProj=e),r)},_t=73,yt=79,vt={forward:bt,inverse:function(t){var e=Ct(Et(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Mt};function bt(t,e){return e=e||5,function(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(d=t.easting,p=t.northing,g=t.zoneNumber,m=kt(g),_=Math.floor(d/1e5),y=Math.floor(p/1e5)%20,n=_,s=y,a=m,o=a-1,h="AJSAJS".charCodeAt(o),l="AFAFAF".charCodeAt(o),u=h+n-1,f=l+s,c=!1,u>90&&(u=u-90+65-1,c=!0),(u===_t||h<_t&&u>_t||(u>_t||h<_t)&&c)&&u++,(u===yt||hyt||(u>yt||h90&&(u=u-90+65-1),f>86?(f=f-86+65-1,c=!0):c=!1,(f===_t||l<_t&&f>_t||(f>_t||l<_t)&&c)&&f++,(f===yt||lyt||(f>yt||l86&&(f=f-86+65-1),String.fromCharCode(u)+String.fromCharCode(f))+i.substr(i.length-5,e)+r.substr(r.length-5,e);var n,s,a,o,h,l,u,f,c;var d,p,g,m,_,y}(function(t){var e,i,r,n,s,a,o,h=t.lat,l=t.lon,u=6378137,f=wt(h),c=wt(l);o=Math.floor((l+180)/6)+1,180===l&&(o=60);h>=56&&h<64&&l>=3&&l<12&&(o=32);h>=72&&h<84&&(l>=0&&l<9?o=31:l>=9&&l<21?o=33:l>=21&&l<33?o=35:l>=33&&l<42&&(o=37));a=wt(6*(o-1)-180+3),.006739496752268451,e=u/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),i=Math.tan(f)*Math.tan(f),r=.006739496752268451*Math.cos(f)*Math.cos(f),n=Math.cos(f)*(c-a),s=u*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var d=.9996*e*(n+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,p=.9996*(s+e*Math.tan(f)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));h<0&&(p+=1e7);return{northing:Math.round(p),easting:Math.round(d),zoneNumber:o,zoneLetter:St(h)}}({lat:t[1],lon:t[0]}),e)}function Mt(t){var e=Ct(Et(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function wt(t){return t*(Math.PI/180)}function xt(t){return t/Math.PI*180}function Ct(t){var e=t.northing,i=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s,a,o,h,l,u,f,c,d=6378137,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=i-5e5,m=e;r<"N"&&(m-=1e7),u=6*(n-1)-180+3,c=(f=m/.9996/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*f)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*f)+151*p*p*p/96*Math.sin(6*f),s=d/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),a=Math.tan(c)*Math.tan(c),o=.006739496752268451*Math.cos(c)*Math.cos(c),h=.99330562*d/Math.pow(1-.00669438*Math.sin(c)*Math.sin(c),1.5),l=g/(.9996*s);var _=c-s*Math.tan(c)/h*(l*l/2-(5+3*a+10*o-4*o*o-.06065547077041606)*l*l*l*l/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*l*l*l*l*l*l/720);_=xt(_);var y,v=(l-(1+2*a+o)*l*l*l/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(c);if(v=u+xt(v),t.accuracy){var b=Ct({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:b.lat,right:b.lon,bottom:_,left:v}}else y={lat:_,lon:v};return y}function St(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function kt(t){var e=t%6;return 0===e&&(e=6),e}function Et(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,r=null,n="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,s++}var a=parseInt(n,10);if(0===s||s+3>i)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(s++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;r=t.substring(s,s+=2);for(var h=kt(a),l=function(t,e){var i="AJSAJS".charCodeAt(e-1),r=1e5,n=!1;for(;i!==t.charCodeAt(0);){if(++i===_t&&i++,i===yt&&i++,i>90){if(n)throw"Bad character: "+t;i=65,n=!0}r+=1e5}return r}(r.charAt(0),h),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var i="AFAFAF".charCodeAt(e-1),r=0,n=!1;for(;i!==t.charCodeAt(0);){if(++i===_t&&i++,i===yt&&i++,i>86){if(n)throw"Bad character: "+t;i=65,n=!0}r+=1e5}return r}(r.charAt(1),h);u0&&(c=1e5/Math.pow(10,g),d=t.substring(s,s+g),m=parseFloat(d)*c,p=t.substring(s+g),_=parseFloat(p)*c),{easting:m+l,northing:_+u,zoneLetter:o,zoneNumber:a,accuracy:c}}function At(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Pt(t,e,i){if(!(this instanceof Pt))return new Pt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Pt.fromMGRS=function(t){return new Pt(Mt(t))},Pt.prototype.toMGRS=function(t){return bt([this.x,this.y],t)};var It=Pt,Ot=.01068115234375,Nt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Ot))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Ot)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e},Lt=function(t,e,i,r){return i*=e,e*=e,r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Tt=function(t,e,i){for(var r=1/(1-e),n=t,s=20;s;--s){var a=Math.sin(n),o=1-e*a*a;if(n-=o=(Lt(n,a,Math.cos(n),i)-t)*(o*Math.sqrt(o))*r,Math.abs(o)<1e-10)return n}return n};var Rt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Nt(this.es),this.ml0=Lt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,r,n=t.x,s=t.y,a=T(n-this.long0),o=Math.sin(s),h=Math.cos(s);if(this.es){var l=h*a,u=Math.pow(l,2),f=this.ep2*Math.pow(h,2),c=Math.pow(f,2),d=Math.abs(h)>1e-10?Math.tan(s):0,p=Math.pow(d,2),g=Math.pow(p,2);e=1-this.es*Math.pow(o,2),l/=Math.sqrt(e);var m=Lt(s,o,h,this.en);i=this.a*(this.k0*l*(1+u/6*(1-p+f+u/20*(5-18*p+g+14*f-58*p*f+u/42*(61+179*g-g*p-479*p)))))+this.x0,r=this.a*(this.k0*(m-this.ml0+o*a*l/2*(1+u/12*(5-p+9*f+4*c+u/30*(61+g-58*p+270*f-330*p*f+u/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var _=h*Math.sin(a);if(Math.abs(Math.abs(_)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+_)/(1-_))+this.x0,r=h*Math.cos(a)/Math.sqrt(1-Math.pow(_,2)),(_=Math.abs(r))>=1){if(_-1>1e-10)return 93;r=0}else r=Math.acos(r);s<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=i,t.y=r,t},inverse:function(t){var e,i,r,s,a=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=Tt(e,this.es,this.en),Math.abs(i)1e-10?Math.tan(i):0,f=this.ep2*Math.pow(l,2),c=Math.pow(f,2),d=Math.pow(u,2),p=Math.pow(d,2);e=1-this.es*Math.pow(h,2);var g=a*Math.sqrt(e)/this.k0,m=Math.pow(g,2);r=i-(e*=u)*m/(1-this.es)*.5*(1-m/12*(5+3*d-9*f*d+f-4*c-m/30*(61+90*d-252*f*d+45*p+46*f-m/56*(1385+3633*d+4095*p+1574*p*d)))),s=T(this.long0+g*(1-m/6*(1+2*d+f-m/20*(5+28*d+24*p+8*f*d+6*f-m/42*(61+662*d+1320*p+720*p*d))))/l)}else r=n*L(o),s=0;else{var _=Math.exp(a/this.k0),y=.5*(_-1/_),v=this.lat0+o/this.k0,b=Math.cos(v);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(y,2))),r=Math.asin(e),o<0&&(r=-r),s=0===y&&0===b?0:T(Math.atan2(y,b)+this.long0)}return t.x=s,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},zt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Bt=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},Dt=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Bt(1,e)+1))),t<0?-e:e},jt=function(t,e){for(var i,r=2*Math.cos(2*e),n=t.length-1,s=t[n],a=0;--n>=0;)i=r*s-a+t[n],a=s,s=i;return e+i*Math.sin(2*e)},Ut=function(t,e,i){for(var r,n,s=Math.sin(e),a=Math.cos(e),o=zt(i),h=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(i),l=2*a*h,u=-2*s*o,f=t.length-1,c=t[f],d=0,p=0,g=0;--f>=0;)r=p,n=d,c=l*(p=c)-r-u*(d=g)+t[f],g=u*p-n+l*d;return[(l=s*h)*c-(u=a*o)*g,l*g+u*c]};var Ft={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Rt.init.apply(this),this.forward=Rt.forward,this.inverse=Rt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var r=jt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var i,r=2*Math.cos(e),n=t.length-1,s=t[n],a=0;--n>=0;)i=r*s-a+t[n],a=s,s=i;return Math.sin(e)*i}(this.gtu,2*r))},forward:function(t){var e=T(t.x-this.long0),i=t.y;i=jt(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),s=Math.sin(e),a=Math.cos(e);i=Math.atan2(r,a*n),e=Math.atan2(s*n,Bt(r,n*a)),e=Dt(Math.tan(e));var o,h,l=Ut(this.gtu,2*i,2*e);return i+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(o=this.a*(this.Qn*e)+this.x0,h=this.a*(this.Qn*i+this.Zb)+this.y0):(o=1/0,h=1/0),t.x=o,t.y=h,t},inverse:function(t){var e,i,r=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var s=Ut(this.utg,2*n,2*r);n+=s[0],r+=s[1],r=Math.atan(zt(r));var a=Math.sin(n),o=Math.cos(n),h=Math.sin(r),l=Math.cos(r);n=Math.atan2(a*l,Bt(h,l*o)),r=Math.atan2(h,l*o),e=T(r+this.long0),i=jt(this.cgb,n)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var qt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(T(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*s,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ft.init.apply(this),this.forward=Ft.forward,this.inverse=Ft.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Gt=function(t,e){return Math.pow((1-t)/(1+t),e)};var Zt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+o)/(Math.pow(Math.tan(.5*this.lat0+o),this.C)*Gt(this.e*t,this.ratexp))},forward:function(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+o),this.C)*Gt(this.e*Math.sin(i),this.ratexp))-n,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,i=t.y,r=Math.pow(Math.tan(.5*i+o)/this.K,1/this.C),s=20;s>0&&(i=2*Math.atan(r*Gt(this.e*Math.sin(t.y),-.5*this.e))-n,!(Math.abs(i-t.y)<1e-14));--s)t.y=i;return s?(t.x=e,t.y=i,t):null},names:["gauss"]};var Yt={init:function(){Zt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,r,n;return t.x=T(t.x-this.long0),Zt.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),r=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*r),t.x=n*i*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*i*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,r,n,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(s,this.R2);e=Math.sin(a),i=Math.cos(a),n=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),r=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else n=this.phic0,r=0;return t.x=r,t.y=n,Zt.inverse.apply(this,[t]),t.x=T(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Vt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+L(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*N(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/R(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=N(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,i,r,s,a,o,h=t.x,l=t.y,u=Math.sin(l),f=Math.cos(l),c=T(h-this.long0);return Math.abs(Math.abs(h-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*u+this.coslat0*f*Math.cos(c)),t.x=this.a*e*f*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*u-this.sinlat0*f*Math.cos(c))+this.y0,t):(i=2*Math.atan(this.ssfn_(l,u,this.e))-n,s=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=1e-10?(a=R(this.e,l*this.con,this.con*u),o=2*this.a*this.k0*a/this.cons,t.x=this.x0+o*Math.sin(h-this.long0),t.y=this.y0-this.con*o*Math.cos(h-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+s*Math.cos(c)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*s*Math.cos(c))),t.y=e*(this.cosX0*r-this.sinX0*s*Math.cos(c))+this.y0),t.x=e*s*Math.sin(c)+this.x0,t))},inverse:function(t){var e,i,r,s,a;t.x-=this.x0,t.y-=this.y0;var o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var h=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,i=this.lat0,o<=1e-10?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(h)*this.sinlat0+t.y*Math.sin(h)*this.coslat0/o),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?T(this.long0+Math.atan2(t.x,-1*t.y)):T(this.long0+Math.atan2(t.x,t.y)):T(this.long0+Math.atan2(t.x*Math.sin(h),o*this.coslat0*Math.cos(h)-t.y*this.sinlat0*Math.sin(h))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=1e-10){if(o<=1e-10)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*z(this.e,r),e=this.con*T(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else s=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=1e-10?a=this.X0:(a=Math.asin(Math.cos(s)*this.sinX0+t.y*Math.sin(s)*this.cosX0/o),e=T(this.long0+Math.atan2(t.x*Math.sin(s),o*this.cosX0*Math.cos(s)-t.y*this.sinX0*Math.sin(s)))),i=-1*z(this.e,Math.tan(.5*(n+a)));return t.x=e,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,i){return e*=i,Math.tan(.5*(n+t))*Math.pow((1-e)/(1+e),.5*i)}};var Wt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),s=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+s*e)/(1-s*e));this.K=a-this.alpha*o+this.alpha*s/2*h},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,i=t.y-this.y0,r=e/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),o=this.lambda0+a/this.alpha,h=0,l=s,u=-1e3,f=0;Math.abs(l-u)>1e-7;){if(++f>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=l,t},names:["somerc"]};var Xt={init:function(){var t,e,i,r,a,l,u,f,c,d,p,g,m,_=0,y=0,v=0,b=0,M=0,w=0,x=0;this.no_off=(m="object"==typeof(g=this).PROJECTION?Object.keys(g.PROJECTION)[0]:g.PROJECTION,"no_uoff"in g||"no_off"in g||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(m)),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),C&&(x=this.alpha),S&&(_=this.rectified_grid_angle*s),C||S)y=this.longc;else if(v=this.long1,M=this.lat1,b=this.long2,w=this.lat2,Math.abs(M-w)<=1e-7||(t=Math.abs(M))<=1e-7||Math.abs(t-n)<=1e-7||Math.abs(Math.abs(this.lat0)-n)<=1e-7||Math.abs(Math.abs(w)-n)<=1e-7)throw new Error;var k=1-this.es;e=Math.sqrt(k),Math.abs(this.lat0)>1e-10?(f=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*f*f,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/k),this.A=this.B*this.k0*e/t,(a=(r=this.B*e/(i*Math.sqrt(t)))*r-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=r,this.E*=Math.pow(R(this.e,this.lat0,f),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=a=1),C||S?(C?(p=Math.asin(Math.sin(x)/r),S||(_=x)):(p=_,x=Math.asin(r*Math.sin(p))),this.lam0=y-Math.asin(.5*(a-1/a)*Math.tan(p))/this.B):(l=Math.pow(R(this.e,M,Math.sin(M)),this.B),u=Math.pow(R(this.e,w,Math.sin(w)),this.B),a=this.E/l,c=(u-l)/(u+l),d=((d=this.E*this.E)-u*l)/(d+u*l),(t=v-b)<-Math.pi?b-=h:t>Math.pi&&(b+=h),this.lam0=T(.5*(v+b)-Math.atan(d*Math.tan(.5*this.B*(v-b))/c)/this.B),p=Math.atan(2*Math.sin(this.B*T(v-this.lam0))/(a-1/a)),_=x=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(_),this.cosrot=Math.cos(_),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(o-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(o+a))},forward:function(t){var e,i,r,s,a,o,h,l,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-n)>1e-10){if(e=.5*((a=this.E/Math.pow(R(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/a)),i=.5*(a+o),s=Math.sin(this.B*t.x),r=(e*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*t.x),h=Math.abs(o)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+s*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(u.x=h,u.y=l):(h-=this.u_0,u.x=l*this.cosrot+h*this.sinrot,u.y=h*this.cosrot-l*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var e,i,r,s,a,o,h,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),h=((o=Math.sin(this.BrA*e))*this.cosgam+s*this.singam)/a,Math.abs(Math.abs(h)-1)<1e-10)l.x=0,l.y=h<0?-n:n;else{if(l.y=this.E/Math.sqrt((1+h)/(1-h)),l.y=z(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(s*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var Ht={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),r=N(this.e,e,i),n=R(this.e,this.lat1,e),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=N(this.e,s,a),h=R(this.e,this.lat2,s),l=R(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/o)/Math.log(n/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=1e-10&&(i=L(i)*(n-2e-10));var r,s,a=Math.abs(Math.abs(i)-n);if(a>1e-10)r=R(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;s=0}var o=this.ns*T(e-this.long0);return t.x=this.k0*(s*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,t},inverse:function(t){var e,i,r,s,a,o=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+h*h),i=1):(e=-Math.sqrt(o*o+h*h),i=-1);var l=0;if(0!==e&&(l=Math.atan2(i*o,i*h)),0!==e||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),-9999===(s=z(this.e,r)))return null}else s=-n;return a=T(l/this.ns+this.long0),t.x=a,t.y=s,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Jt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,r,n,s,a,o,h=t.x,l=t.y,u=T(h-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),s=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=o*Math.cos(a)/1,t.x=o*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,r,n,s,a,o,h=t.x;t.x=t.y,t.y=h,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),t.x=this.long0-i/this.alfa,a=e,o=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(o=1),a=t.y,l+=1}while(0===o&&l<15);return l>=15?null:t},names:["Krovak","krovak"]},Kt=function(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},Qt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},$t=function(t){return.375*t*(1+.25*t*(1+.46875*t))},te=function(t){return.05859375*t*t*(1+.75*t)},ee=function(t){return t*t*t*(35/3072)},ie=function(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)},re=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e};var oe={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-n)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=ae(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=.3333333333333333*t,e=t*t,i[0]+=.17222222222222222*e,i[1]=.06388888888888888*e,e*=t,i[0]+=.10257936507936508*e,i[1]+=.0664021164021164*e,i[2]=.016415012942191543*e,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=ae(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,i,r,s,a,h,l,u,f,c,d=t.x,p=t.y;if(d=T(d-this.long0),this.sphere){if(a=Math.sin(p),c=Math.cos(p),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r)<=1e-10)return null;e=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(p+this.lat0)<1e-10)return null;i=o-.5*p,e=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(d),i*=r}}else{switch(l=0,u=0,f=0,r=Math.cos(d),s=Math.sin(d),a=Math.sin(p),h=ae(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=h/this.qp,u=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:f=1+this.sinb1*l+this.cosb1*u*r;break;case this.EQUIT:f=1+u*r;break;case this.N_POLE:f=n+p,h=this.qp-h;break;case this.S_POLE:f=p-n,h=this.qp+h}if(Math.abs(f)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),i=this.mode===this.OBLIQ?this.ymf*f*(this.cosb1*l-this.sinb1*u*r):(f=Math.sqrt(2/(1+u*r)))*l*this.ymf,e=this.xmf*f*u*s;break;case this.N_POLE:case this.S_POLE:h>=0?(e=(f=Math.sqrt(h))*s,i=r*(this.mode===this.S_POLE?f:-f)):e=i=0}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,s,a,o,h,l,u,f,c=t.x/this.a,d=t.y/this.a;if(this.sphere){var p,g=0,m=0;if((i=.5*(p=Math.sqrt(c*c+d*d)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(i),g=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=1e-10?0:Math.asin(d*m/p),c*=m,d=g*p;break;case this.OBLIQ:i=Math.abs(p)<=1e-10?this.lat0:Math.asin(g*this.sinph0+d*m*this.cosph0/p),c*=m*this.cosph0,d=(g-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:d=-d,i=n-i;break;case this.S_POLE:i-=n}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,d):0}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,d*=this.dd,(o=Math.sqrt(c*c+d*d))<1e-10)return t.x=this.long0,t.y=this.lat0,t;s=2*Math.asin(.5*o/this.rq),r=Math.cos(s),c*=s=Math.sin(s),this.mode===this.OBLIQ?(h=r*this.sinb1+d*s*this.cosb1/o,a=this.qp*h,d=o*this.cosb1*r-d*this.sinb1*s):(h=d*s/o,a=this.qp*h,d=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(a=c*c+d*d))return t.x=this.long0,t.y=this.lat0,t;h=1-a/this.qp,this.mode===this.S_POLE&&(h=-h)}e=Math.atan2(c,d),l=Math.asin(h),u=this.apa,f=l+l,i=l+u[0]*Math.sin(f)+u[1]*Math.sin(f+f)+u[2]*Math.sin(f+f+f)}return t.x=T(this.long0+e),t.y=i,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},he=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var le={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=N(this.e3,this.sin_po,this.cos_po),this.qs1=ae(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=N(this.e3,this.sin_po,this.cos_po),this.qs2=ae(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ae(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=ae(this.e3,this.sin_phi,this.cos_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*T(e-this.long0),a=n*Math.sin(s)+this.x0,o=this.rh-n*Math.cos(s)+this.y0;return t.x=a,t.y=o,t},inverse:function(t){var e,i,r,n,s,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,0!==e&&(n=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),s=T(n/this.ns0+this.long0),t.x=s,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,r,n,s,a=he(.5*e);if(t<1e-10)return a;for(var o=t*t,h=1;h<=25;h++)if(a+=s=.5*(n=1-(r=t*(i=Math.sin(a)))*r)*n/Math.cos(a)*(e/(1-o)-i/n+.5/t*Math.log((1-r)/(1+r))),Math.abs(s)<=1e-7)return a;return null}};var ue={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,r,n,s,a,o,h=t.x,l=t.y;return r=T(h-this.long0),e=Math.sin(l),i=Math.cos(l),n=Math.cos(r),1,(s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=1e-10?(a=this.x0+1*this.a*i*Math.sin(r)/s,o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*n)/s):(a=this.x0+this.infinity_dist*i*Math.sin(r),o=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=o,t},inverse:function(t){var e,i,r,n,s,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),i=Math.sin(n),r=Math.cos(n),a=he(r*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i),s=T(this.long0+s)):(a=this.phic0,s=0),t.x=s,t.y=a,t},names:["gnom"]};var fe={init:function(){this.sphere||(this.k0=N(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,r=t.x,n=t.y,s=T(r-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var a=ae(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s,i=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var e,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=T(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=function(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*n:n;for(var r,s,a,o,h=Math.asin(.5*e),l=0;l<30;l++)if(s=Math.sin(h),a=Math.cos(h),o=t*s,h+=r=Math.pow(1-o*o,2)/(2*a)*(e/(1-t*t)-s/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return h;return NaN}(this.e,2*t.y*this.k0/this.a),e=T(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t},names:["cea"]};var ce={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,r=T(e-this.long0),n=re(i-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t},inverse:function(t){var e=t.x,i=t.y;return t.x=T(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=re(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var de={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Qt(this.es),this.e1=$t(this.es),this.e2=te(this.es),this.e3=ee(this.es),this.ml0=this.a*Kt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,r,n=t.x,s=t.y,a=T(n-this.long0);if(r=a*Math.sin(s),this.sphere)Math.abs(s)<=1e-10?(e=this.a*a,i=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(s),i=this.a*(re(s-this.lat0)+(1-Math.cos(r))/Math.tan(s)));else if(Math.abs(s)<=1e-10)e=this.a*a,i=-1*this.ml0;else{var o=ie(this.a,this.e,Math.sin(s))/Math.tan(s);e=o*Math.sin(r),i=this.a*Kt(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*(1-Math.cos(r))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,r,n,s,a,o,h,l;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=1e-10)e=T(r/this.a+this.long0),i=0;else{var u;for(a=this.lat0+n/this.a,o=r*r/this.a/this.a+a*a,h=a,s=20;s;--s)if(h+=l=-1*(a*(h*(u=Math.tan(h))+1)-h-.5*(h*h+o)*u)/((h-a)/u-1),Math.abs(l)<=1e-10){i=h;break}e=T(this.long0+Math.asin(r*Math.tan(h)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=1e-10)i=0,e=T(this.long0+r/this.a);else{var f,c,d,p,g;for(a=(this.ml0+n)/this.a,o=r*r/this.a/this.a+a*a,h=a,s=20;s;--s)if(g=this.e*Math.sin(h),f=Math.sqrt(1-g*g)*Math.tan(h),c=this.a*Kt(this.e0,this.e1,this.e2,this.e3,h),d=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),h-=l=(a*(f*(p=c/this.a)+1)-p-.5*f*(p*p+o))/(this.es*Math.sin(2*h)*(p*p+o-2*a*p)/(4*f)+(a-p)*(f*d-2/Math.sin(2*h))-d),Math.abs(l)<=1e-10){i=h;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=T(this.long0+Math.asin(r*f/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]};var pe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,i=t.x,n=t.y-this.lat0,s=i-this.long0,a=n/r*1e-5,o=s,h=1,l=0;for(e=1;e<=10;e++)h*=a,l+=this.A[e]*h;var u,f=l,c=o,d=1,p=0,g=0,m=0;for(e=1;e<=6;e++)u=p*f+d*c,d=d*f-p*c,p=u,g=g+this.B_re[e]*d-this.B_im[e]*p,m=m+this.B_im[e]*d+this.B_re[e]*p;return t.x=m*this.a+this.x0,t.y=g*this.a+this.y0,t},inverse:function(t){var e,i,n=t.x,s=t.y,a=n-this.x0,o=(s-this.y0)/this.a,h=a/this.a,l=1,u=0,f=0,c=0;for(e=1;e<=6;e++)i=u*o+l*h,l=l*o-u*h,u=i,f=f+this.C_re[e]*l-this.C_im[e]*u,c=c+this.C_im[e]*l+this.C_re[e]*u;for(var d=0;d.999999999999&&(i=.999999999999),e=Math.asin(i);var r=T(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return t.x=r,t.y=n,t},names:["Mollweide","moll"]};var ye={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Qt(this.es),this.e1=$t(this.es),this.e2=te(this.es),this.e3=ee(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=N(this.e,this.sinphi,this.cosphi),this.ml1=Kt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=N(this.e,this.sinphi,this.cosphi),this.ml2=Kt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Kt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var n=Kt(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-n)}var s=this.ns*T(i-this.long0),a=this.x0+e*Math.sin(s),o=this.y0+this.rh-e*Math.cos(s);return t.x=a,t.y=o,t},inverse:function(t){var e,i,r,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==i&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return n=T(this.long0+s/this.ns),r=re(this.g-i/this.a),t.x=n,t.y=r,t;var a=this.g-i/this.a;return r=ne(a,this.e0,this.e1,this.e2,this.e3),n=T(this.long0+s/this.ns),t.x=n,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var ve={init:function(){this.R=this.a},forward:function(t){var e,i,r=t.x,s=t.y,a=T(r-this.long0);Math.abs(s)<=1e-10&&(e=this.x0+this.R*a,i=this.y0);var o=he(2*Math.abs(s/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(s)-n)<=1e-10)&&(e=this.x0,i=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var h=.5*Math.abs(Math.PI/a-a/Math.PI),l=h*h,u=Math.sin(o),f=Math.cos(o),c=f/(u+f-1),d=c*c,p=c*(2/u-1),g=p*p,m=Math.PI*this.R*(h*(c-g)+Math.sqrt(l*(c-g)*(c-g)-(g+l)*(d-g)))/(g+l);a<0&&(m=-m),e=this.x0+m;var _=l+c;return m=Math.PI*this.R*(p*_-h*Math.sqrt((g+l)*(l+1)-_*_))/(g+l),i=s>=0?this.y0+m:this.y0-m,t.x=e,t.y=i,t},inverse:function(t){var e,i,r,n,s,a,o,h,l,u,f,c;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,s=(r=t.x/f)*r+(n=t.y/f)*n,f=3*(n*n/(h=-2*(a=-Math.abs(n)*(1+s))+1+2*n*n+s*s)+(2*(o=a-2*n*n+r*r)*o*o/h/h/h-9*a*o/h/h)/27)/(l=(a-o*o/3/h)/h)/(u=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),c=Math.acos(f)/3,i=t.y>=0?(-u*Math.cos(c+Math.PI/3)-o/3/h)*Math.PI:-(-u*Math.cos(c+Math.PI/3)-o/3/h)*Math.PI,e=Math.abs(r)<1e-10?this.long0:T(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(r*r-n*n)+s*s))/2/r),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var be={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,i,r,s,a,o,h,l,u,f,c,d,p,g,m,_,y,v,b,M,w,x,C=t.x,S=t.y,k=Math.sin(t.y),E=Math.cos(t.y),A=T(C-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(n-S)*Math.sin(A),t.y=this.y0-this.a*(n-S)*Math.cos(A),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(n+S)*Math.sin(A),t.y=this.y0+this.a*(n+S)*Math.cos(A),t):(v=this.sin_p12*k+this.cos_p12*E*Math.cos(A),y=(_=Math.acos(v))?_/Math.sin(_):1,t.x=this.x0+this.a*y*E*Math.sin(A),t.y=this.y0+this.a*y*(this.cos_p12*k-this.sin_p12*E*Math.cos(A)),t):(e=Qt(this.es),i=$t(this.es),r=te(this.es),s=ee(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*Kt(e,i,r,s,n),o=this.a*Kt(e,i,r,s,S),t.x=this.x0+(a-o)*Math.sin(A),t.y=this.y0-(a-o)*Math.cos(A),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*Kt(e,i,r,s,n),o=this.a*Kt(e,i,r,s,S),t.x=this.x0+(a+o)*Math.sin(A),t.y=this.y0+(a+o)*Math.cos(A),t):(h=k/E,l=ie(this.a,this.e,this.sin_p12),u=ie(this.a,this.e,k),f=Math.atan((1-this.es)*h+this.es*l*this.sin_p12/(u*E)),b=0===(c=Math.atan2(Math.sin(A),this.cos_p12*Math.tan(f)-this.sin_p12*Math.cos(A)))?Math.asin(this.cos_p12*Math.sin(f)-this.sin_p12*Math.cos(f)):Math.abs(Math.abs(c)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(f)-this.sin_p12*Math.cos(f)):Math.asin(Math.sin(A)*Math.cos(f)/Math.sin(c)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),_=l*b*(1-(M=b*b)*(m=(p=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*p)*(1-m)/6+(w=M*b)/8*(g=d*p)*(1-2*m)+(x=w*b)/120*(m*(4-7*m)-3*d*d*(1-7*m))-x*b/48*g),t.x=this.x0+_*Math.sin(c),t.y=this.y0+_*Math.cos(c),t))},inverse:function(t){var e,i,r,s,a,o,h,l,u,f,c,d,p,g,m,_,y,v,b,M,w,x,C;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*n*this.a)return;return i=e/this.a,r=Math.sin(i),s=Math.cos(i),a=this.long0,Math.abs(e)<=1e-10?o=this.lat0:(o=he(s*this.sin_p12+t.y*r*this.cos_p12/e),h=Math.abs(this.lat0)-n,a=Math.abs(h)<=1e-10?this.lat0>=0?T(this.long0+Math.atan2(t.x,-t.y)):T(this.long0-Math.atan2(-t.x,t.y)):T(this.long0+Math.atan2(t.x*r,e*this.cos_p12*s-t.y*this.sin_p12*r))),t.x=a,t.y=o,t}return l=Qt(this.es),u=$t(this.es),f=te(this.es),c=ee(this.es),Math.abs(this.sin_p12-1)<=1e-10?(d=this.a*Kt(l,u,f,c,n),e=Math.sqrt(t.x*t.x+t.y*t.y),o=ne((d-e)/this.a,l,u,f,c),a=T(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=o,t):Math.abs(this.sin_p12+1)<=1e-10?(d=this.a*Kt(l,u,f,c,n),e=Math.sqrt(t.x*t.x+t.y*t.y),o=ne((e-d)/this.a,l,u,f,c),a=T(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),p=ie(this.a,this.e,this.sin_p12),_=Math.cos(m),v=-(y=this.e*this.cos_p12*_)*y/(1-this.es),b=3*this.es*(1-v)*this.sin_p12*this.cos_p12*_/(1-this.es),x=1-v*(w=(M=e/p)-v*(1+v)*Math.pow(M,3)/6-b*(1+3*v)*Math.pow(M,4)/24)*w/2-M*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*_),a=T(this.long0+Math.asin(Math.sin(m)*Math.sin(w)/Math.cos(g))),C=Math.sin(g),o=Math.atan2((C-this.es*x*this.sin_p12)*Math.tan(g),C*(1-this.es)),t.x=a,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]};var Me={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,r,n,s,a,o,h=t.x,l=t.y;return r=T(h-this.long0),e=Math.sin(l),i=Math.cos(l),n=Math.cos(r),1,((s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=1e-10)&&(a=1*this.a*i*Math.sin(r),o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=o,t},inverse:function(t){var e,i,r,s,a,o,h;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=he(e/this.a),r=Math.sin(i),s=Math.cos(i),o=this.long0,Math.abs(e)<=1e-10?(h=this.lat0,t.x=o,t.y=h,t):(h=he(s*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-n,Math.abs(a)<=1e-10?(o=this.lat0>=0?T(this.long0+Math.atan2(t.x,-t.y)):T(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=h,t):(o=T(this.long0+Math.atan2(t.x*r,e*this.cos_p14*s-t.y*this.sin_p14*r)),t.x=o,t.y=h,t))},names:["ortho"]},we=1,xe=2,Ce=3,Se=4,ke=5,Ee=6,Ae=1,Pe=2,Ie=3,Oe=4;function Ne(t,e,i,r){var s;return t<1e-10?(r.value=Ae,s=0):(s=Math.atan2(e,i),Math.abs(s)<=o?r.value=Ae:s>o&&s<=n+o?(r.value=Pe,s-=n):s>n+o||s<=-(n+o)?(r.value=Ie,s=s>=0?s-l:s+l):(r.value=Oe,s+=n)),s}function Le(t,e){var i=t+e;return i<-l?i+=h:i>+l&&(i-=h),i}var Te={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=n-o/2?this.face=ke:this.lat0<=-(n-o/2)?this.face=Ee:Math.abs(this.long0)<=o?this.face=we:Math.abs(this.long0)<=n+o?this.face=this.long0>0?xe:Se:this.face=Ce,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,i,r,s,a,h,u={x:0,y:0},f={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,this.face===ke)s=n-e,i>=o&&i<=n+o?(f.value=Ae,r=i-n):i>n+o||i<=-(n+o)?(f.value=Pe,r=i>0?i-l:i+l):i>-(n+o)&&i<=-o?(f.value=Ie,r=i+n):(f.value=Oe,r=i);else if(this.face===Ee)s=n+e,i>=o&&i<=n+o?(f.value=Ae,r=-i+n):i=-o?(f.value=Pe,r=-i):i<-o&&i>=-(n+o)?(f.value=Ie,r=-i-n):(f.value=Oe,r=i>0?-i+l:-i-l);else{var c,d,p,g,m,_;this.face===xe?i=Le(i,+n):this.face===Ce?i=Le(i,+l):this.face===Se&&(i=Le(i,-n)),g=Math.sin(e),m=Math.cos(e),_=Math.sin(i),c=m*Math.cos(i),d=m*_,p=g,this.face===we?r=Ne(s=Math.acos(c),p,d,f):this.face===xe?r=Ne(s=Math.acos(d),p,-c,f):this.face===Ce?r=Ne(s=Math.acos(-c),p,-d,f):this.face===Se?r=Ne(s=Math.acos(-d),p,c,f):(s=r=0,f.value=Ae)}return h=Math.atan(12/l*(r+Math.acos(Math.sin(r)*Math.cos(o))-n)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(r))))),f.value===Pe?h+=n:f.value===Ie?h+=l:f.value===Oe&&(h+=1.5*l),u.x=a*Math.cos(h),u.y=a*Math.sin(h),u.x=u.x*this.a+this.x0,u.y=u.y*this.a+this.y0,t.x=u.x,t.y=u.y,t},inverse:function(t){var e,i,r,s,a,o,h,u,f,c,d,p,g={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=Ae:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Pe,e-=n):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Ie,e=e<0?e+l:e-l):(m.value=Oe,e+=n),f=l/12*Math.tan(e),a=Math.sin(f)/(Math.cos(f)-1/Math.sqrt(2)),o=Math.atan(a),(h=1-(r=Math.cos(e))*r*(s=Math.tan(i))*s*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?h=-1:h>1&&(h=1),this.face===ke)u=Math.acos(h),g.phi=n-u,m.value===Ae?g.lam=o+n:m.value===Pe?g.lam=o<0?o+l:o-l:m.value===Ie?g.lam=o-n:g.lam=o;else if(this.face===Ee)u=Math.acos(h),g.phi=u-n,m.value===Ae?g.lam=-o+n:m.value===Pe?g.lam=-o:m.value===Ie?g.lam=-o-n:g.lam=o<0?-o-l:-o+l;else{var _,y,v;f=(_=h)*_,y=(f+=(v=f>=1?0:Math.sqrt(1-f)*Math.sin(o))*v)>=1?0:Math.sqrt(1-f),m.value===Pe?(f=y,y=-v,v=f):m.value===Ie?(y=-y,v=-v):m.value===Oe&&(f=y,y=v,v=-f),this.face===xe?(f=_,_=-y,y=f):this.face===Ce?(_=-_,y=-y):this.face===Se&&(f=_,_=y,y=-f),g.phi=Math.acos(-v)-n,g.lam=Math.atan2(y,_),this.face===xe?g.lam=Le(g.lam,-n):this.face===Ce?g.lam=Le(g.lam,-l):this.face===Se&&(g.lam=Le(g.lam,+n))}return 0!==this.es&&(c=g.phi<0?1:0,d=Math.tan(g.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),g.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(g.phi=-g.phi)),g.lam+=this.long0,t.x=g.lam,t.y=g.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Re=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ze=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Be=a/5,De=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var je={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=T(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*Be);r<0?r=0:r>=18&&(r=17);var n={x:De(Re[r],i=a*(i-.08726646259971647*r))*e,y:De(ze[r],i)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*.8487+this.x0,n.y=n.y*this.a*1.3523+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Re[18][0],e.y=t.y<0?-n:n;else{var i=Math.floor(18*e.y);for(i<0?i=0:i>=18&&(i=17);;)if(ze[i][0]>e.y)--i;else{if(!(ze[i+1][0]<=e.y))break;++i}var r=ze[i],a=5*(e.y-r[0])/(ze[i+1][0]-r[0]);a=function(t,e,i,r){for(var n=e;r;--r){var s=t(n);if(n-=s,Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,i,r,n,s=t.x,a=t.y;if(s-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var o=this.radius_p/Bt(this.radius_p*Math.cos(a),Math.sin(a));if(i=o*Math.cos(s)*Math.cos(a),r=o*Math.sin(s)*Math.cos(a),n=o*Math.sin(a),(this.radius_g-i)*i-r*r-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Bt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(n/Bt(r,e)))}else"sphere"===this.shape&&(e=Math.cos(a),i=Math.cos(s)*e,r=Math.sin(s)*e,n=Math.sin(a),e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Bt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(n/Bt(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,i,r,n,s=-1,a=0,o=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Bt(1,o)):(a=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Bt(1,a));var h=o/this.radius_p;if(e=a*a+h*h+s*s,(r=(i=2*this.radius_g*s)*i-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-i-Math.sqrt(r))/(2*e),s=this.radius_g+n*s,a*=n,o*=n,t.x=Math.atan2(a,s),t.y=Math.atan(o*Math.cos(t.x)/s),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+o*o)):(a=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+o*o+s*s,(r=(i=2*this.radius_g*s)*i-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-i-Math.sqrt(r))/(2*e),s=this.radius_g+n*s,a*=n,o*=n,t.x=Math.atan2(a,s),t.y=Math.atan(o*Math.cos(t.x)/s)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};mt.defaultDatum="WGS84",mt.Proj=et,mt.WGS84=new mt.Proj("WGS84"),mt.Point=It,mt.toPoint=ut,mt.defs=E,mt.nadgrid=function(t,e){var i=new DataView(e),r=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(i),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:J(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(i,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s={header:n,subgrids:function(t,e,i){for(var r=[],n=0;n=0?t.substring(e,t.length):""}function u(t,e){var i=t,r=e;this.project=function(t,e){var n=e.xMax-e.xMin,s=e.yMin-e.yMax,a=Math.abs(t[0]-e.xMin),o=t[1]-e.yMax;return{x:a/n*i,y:o/s*r}},this.unproject=function(t,e){var n=e.xMax-e.xMin,s=e.yMin-e.yMax;return[t.x/i*n,t.y/r*s]},this.getBoundingRect=function(t){for(var e,i,r=Number.MAX_VALUE,n={xMin:r,yMin:r,xMax:-r,yMax:-r},s=0,a=t.length;si.x?n.xMax:i.x,n.yMax=n.yMax>i.y?n.yMax:i.y}return n}}var f=function(t,e){return{x:t,y:e}};function c(t,e){var i=(e=e||{font:"20px sans-serif"}).backgroundColor,n=e.padding?e.padding:0;delete e.backgroundColor,delete e.padding;for(var s=t.split(/[\r]?\n+/),a=[],o=0,h=0,l=0;l0){for(var i,n,s,a=r.defer(),o=a.promise,h=0;h0&&(i=t[h]),t[h].name.toLocaleLowerCase().indexOf(".prj")>0&&(s=t[h]),t[h].name.toLocaleLowerCase().indexOf(".dbf")>0&&(n=t[h]);return i&&s&&n?(v(i).then((function(t){(function(t,e){return new Promise((function(i,r){var n=new FileReader;n.onload=function(t){i(t.target.result)},n.onerror=function(t){r(t.error)},n.readAsText(t,e)}))})(s,e).then((function(r){v(n).then((function(n){var s=y.a.combine([y.a.parseShp(t,r),y.a.parseDbf(n,e)]);s.fileName=i.name.toLocaleLowerCase(),a.resolve(s)})).catch((function(t){a.reject(t)}))})).catch((function(t){a.reject(t)}))})).catch((function(t){a.reject(t)})),o):(a.reject(new Error("打开文件失败,请通过ctrl+同时选择shp、prj、dbf三个文件")),o)}throw new Error("文件列表不能为空")}function w(t){var e,i,r;if(!(t.length>=3))return!1;for(var n=0;n0&&(e=t[n]),t[n].name.toLocaleLowerCase().indexOf(".prj")>0&&(r=t[n]),t[n].name.toLocaleLowerCase().indexOf(".dbf")>0&&(i=t[n])}return!!(e&&r&&i)}function x(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.defined(e.source)){this.options=e;var i=null,n=!1;if("string"==typeof e.source){var a=e.source.toLowerCase();if(".shp"!==(i=l(a))&&".json"!==i&&".geojson"!==i&&".topojson"!==i)throw new Error("The data options.source provider is not supported.")}else if(e.source.type&&"FeatureCollection"==e.source.type);else{if(!w(e.source))throw new Error("The data options.source provider is not supported.");n=!0}this._rectangle=e.rectangle,this._tilingScheme=new r.GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=r.defaultValue(e.tileWidth,256),this._tileHeight=r.defaultValue(e.tileHeight,256),this._url=e.source,this._fileExtension=i,this._removeDuplicate=r.defaultValue(e.removeDuplicate,!0),this._allowPick=r.defaultValue(e.allowPick,!1),this._simplifyTolerance=r.defaultValue(e.simplifyTolerance,.01),this._simplify=r.defaultValue(e.simplify,!1),this._maximumLevel=r.defaultValue(e.maximumLevel,22),this._minimumLevel=r.defaultValue(e.minimumLevel,3),this._showMaximumLevel=r.defaultValue(e.showMaximumLevel,!0),this._makerImage=e.markerImage,this._tileCacheSize=r.defaultValue(e.tileCacheSize,200),"object"!=o()(e.defaultStyle)||e.defaultStyle instanceof s||(e.defaultStyle=new s(e.defaultStyle)),this._defaultStyle=r.defaultValue(e.defaultStyle,s.Default.clone()),this._styleFilter="function"==typeof e.styleFilter?e.styleFilter:void 0,this.clustering=e.clustering,this._errorEvent=new r.Event,this._featuresPicked=new r.Event,this._readyPromise=r.defer(),this._ready=!1,this._state=x.State.READY,this._cache={},this._count=0,this.zIndex=e.zIndex,this._bbox=null,this._geoJSON=null;var u=this,f=[];"string"==typeof this._makerImage&&f.push(new Promise((function(e,i){var r=new Image;r.onload=function(){e(this),u._makerImageEl=this},r.onerror=function(t){e(t)},r.src=t._makerImage})));var c=r.defer();if(f.push(c.promise),this._state=x.State.SHPLOADING,i)switch(i){case".shp":var d=this._url,p=l(d);b(d=d.replace(p,"")).then(m,(function(t){console.log("load shp file error:"+t),u.readyPromise.reject(t)}));break;case".json":case".geojson":case".topojson":r.Resource.fetchJson(this._url).then((function(t){m(t)})).catch((function(t){console.log(t)}));break;default:throw new Error("The file options.source provider is not supported.")}else if(n){var g=M(u._url,u.options.encoding||"gbk");g?g.then(m).catch((function(t){this._readyPromise.reject(t)})):this._readyPromise.reject(new Error("The file options.source provider is not supported."))}else setTimeout((function(){Array.isArray(u._url)?this._readyPromise.reject(new Error("The data options.source provide is not supported.")):m(u._url)}),10);this._lineGeoJSON=null,this._outlineGeoJSON=null,this._pointGeoJSON=null,this._polygonJSON=null,this._onlyPoint=!1,this._lineOnly=!1,this._polygonOnly=!1,Promise.all(f).then((function(){u._ready=u._state==x.State.LOADED,u._createCanvas(),x.instanceCount++,u._readyPromise.resolve(!0),u._state=x.State.COMPELTED})).catch((function(t){u._readyPromise.reject(t)}))}function m(t){u._allowPick&&(u._geoJSON=t);var e,i=u._simplifyTolerance,n=[],s=[],a=[],o=[],l=!0,f=!0,d=!0;u._defaultStyle.showCenterLabel&&u._defaultStyle.centerLabelPropertyName&&(u._defaultStyle.showLabel=!0,u._defaultStyle.labelPropertyName=u._defaultStyle.centerLabelPropertyName,function(t,e){var i={};h.featureEach(t,(function(t){var r=t.geometry;r||("Polygon"==r.type||"MultiPolygon"==r.type)&&u._defaultStyle.showCenterLabel&&u._defaultStyle.centerLabelPropertyName&&t.properties.hasOwnProperty(e)&&(i[t.properties[e]]||(i[t.properties[e]]=[]),i[t.properties[e]].push(t))}));for(var r=Object.keys(i),n=0;n0&&(u._lineGeoJSON=h.featureCollection(n),n=null),s.length>0&&(s.forEach((function(t){t.properties._outline=!0})),u._outlineGeoJSON=h.featureCollection(s),s=null),a.length>0&&(u._pointGeoJSON=h.featureCollection(a),a=null),o.length>0&&(u._polygonJSON=h.featureCollection(o),o=null),u._lineOnly=f,u._polygonOnly=d,u._onlyPoint=l,u._state=x.State.LOADED;var _=h.bbox(t);_[0]==_[2]&&(_[0]=_[0]-.1,_[2]=_[2]+.1),_[1]==_[3]&&(_[1]=_[1]-.1,_[3]=_[3]+.1),u._bbox=r.Rectangle.fromDegrees(_[0],_[1],_[2],_[3]),u._rectangle||(u._rectangle=u._bbox),t=null,c.resolve(u)}}function C(t,e,i,r,n,s,a,o,h){var l=0,u=[];if(s.map((function(s){if(!a||l<=0){var h=0;t.beginPath(),s.map((function(s){var a=e.project(s,i);0==h?t.moveTo(r+a.x,n+a.y):t.lineTo(r+a.x,n+a.y),h++})),a&&(t.closePath(),t.fill()),o&&t.stroke()}else u.push(s);l++})),a)return u;u=null}function S(t){if(m||((m=document.createElement("canvas")).width=256,m.height=256),t){var e=m.getContext("2d");t instanceof r.Color?e.fillStyle=t.toCssColorString():e.fillStyle=t,e.fillRect(0,0,m.width,m.height)}else{m.getContext("2d").clearRect(0,0,m.width,m.height)}return m}x.instanceCount=0,x._currentTaskCount=0,x._maxTaskCount=3,x.State={READY:0,SHPLOADING:1,CLIPPING:3,GEOJSONDRAWING:4,COMPELTED:5},Object.defineProperties(x.prototype,{styleFilter:{get:function(){return this._styleFilter},set:function(t){this._styleFilter=t}},defaultStyle:{get:function(){return this._defaultStyle}},proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._showMaximumLevel?this._maximumLevel:22}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},featuresPicked:{get:function(){return this._featuresPicked}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),x.prototype._createCanvas=function(){this._canvas=document.createElement("canvas"),this._canvas.width=this._tileWidth,this._canvas.height=this._tileHeight,this._context=this._canvas.getContext("2d"),this._defaultStyle.backgroundColor&&(this._defaultStyle.backgroundColor instanceof r.Color?this._context.fillStyle=this._defaultStyle.backgroundColor.toCssColorString():this._context.fillStyle=this._defaultStyle.backgroundColor,this._context.fillRect(0,0,this._canvas.width,this._canvas.height)),this._context.lineWidth=this._defaultStyle.lineWidth,this._defaultStyle.outlineColor instanceof r.Color?this._context.strokeStyle=this._defaultStyle.outlineColor.toCssColorString():this._context.strokeStyle=this._defaultStyle.outlineColor,this._defaultStyle.fillColor instanceof r.Color?this._context.fillStyle=this._defaultStyle.fillColor.toCssColorString():this._context.fillStyle=this._defaultStyle.fillColor},x.prototype._clipGeojson=function(t){for(var e=[r.Math.toDegrees(t.west),r.Math.toDegrees(t.south),r.Math.toDegrees(t.east),r.Math.toDegrees(t.north)],i=[[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]],[e[0],e[1]]],n=0;n0){for(var r=!0,n=0;n0){r=!1;break}r||a.push(d)}}catch(i){var s=[];t.geometry.coordinates.forEach((function(t){t.length>3&&s.push(t)})),t.geometry.coordinates=s;try{(d=h.bboxClip(t,e))&&d.geometry.coordinates.length>0&&a.push(d)}catch(t){console.error(t)}}}}))})),d=null,a.length>0?a=h.featureCollection(a):null},x.prototype._drawGeojson=function(t,e,i,n,s,a,o,l,f,d,p,g){var m=this;if(void 0===l&&(l=!0),void 0===f&&(f=!0),l||f){void 0===a&&(a=t.canvas.width-e),void 0===o&&(o=t.canvas.height-i);var _=new u(a,o),y=this._defaultStyle,v={labelStroke:y.labelStroke,labelStrokeWidth:y.labelStrokeWidth,labelStrokeColor:y.labelStrokeColor,pointSize:y.pointSize,fontSize:y.fontSize,fontFamily:y.fontFamily,color:y.fontColor instanceof r.Color?y.fontColor.toCssColorString():y.fontColor,backgroundColor:y.pointColor instanceof r.Color?y.pointColor.toCssColorString():y.pointColor,pointStyle:y.pointStyle,ringRadius:y.ringRadius,circleLineWidth:y.circleLineWidth,showMarker:y.showMarker,showLabel:y.showLabel,labelOffsetX:y.labelOffsetX,labelOffsetY:y.labelOffsetY,markerSymbol:y.markerImage instanceof Image||y.markerImage instanceof HTMLCanvasElement?y.markerImage:y.markerImageEl},b=[];m._styleFilter&&(h.featureEach(n,(function(t,e){m._styleFilter&&(y=m._defaultStyle.clone(),m._styleFilter(t,y,d,p,g),t.style=y)})),n.features.sort((function(t,e){return t.style&&t.style.lineDash?1:e.style&&e.style.lineDash?-1:0}))),h.featureEach(n,(function(t,e){var i=t.geometry;i&&("Polygon"!=i.type&&"MultiPolygon"!=i.type||x(t))})),b&&b.length&&function(t,e,i,r,n,s){var a=t.canvas,o=t.getImageData(0,0,a.width,a.height),h=document.createElement("canvas");h.width=a.width,h.height=a.height;var l=h.getContext("2d"),u=[];s.map((function(t){l.clearRect(0,0,h.width,h.height),l.beginPath();var s=0;t.map((function(t){var a=e.project(t,i);0==s?l.moveTo(r+a.x,n+a.y):l.lineTo(r+a.x,n+a.y),s++})),l.closePath(),l.fillStyle="rgba(255,255,255,1)",l.fill(),u=l.getImageData(0,0,h.width,h.height).data;for(var a=3;a0&&(o.data[a]=0)})),t.putImageData(o,0,0)}(t,_,s,e,i,b),h.featureEach(n,(function(t,e){var i=t.geometry;i&&("LineString"!=i.type&&"MultiLineString"!=i.type||x(t))}));var M=[];h.featureEach(n,(function(t,e){var i=t.geometry;i&&("Point"!=i.type&&"MultiPoint"!=i.type||("function"!=typeof m.clustering?x(t):M.push(t)))}));var w=[s.xMin,s.yMin,s.xMax,s.yMax];"function"==typeof m.clustering&&(M=m.clustering(M,t,w,d,p,g)),M&&M.length&&M.forEach((function(t,e){x(t)}))}function x(n,a){if(m._styleFilter){if(0==(y=n.style).show)return;v={labelStroke:y.labelStroke,labelStrokeWidth:y.labelStrokeWidth,labelStrokeColor:y.labelStrokeColor,pointSize:y.pointSize,fontSize:y.fontSize,fontFamily:y.fontFamily,color:y.fontColor instanceof r.Color?y.fontColor.toCssColorString():y.fontColor,backgroundColor:y.pointColor instanceof r.Color?y.pointColor.toCssColorString():y.pointColor,pointStyle:y.pointStyle,ringRadius:y.ringRadius,circleLineWidth:y.circleLineWidth,showMarker:y.showMarker,showLabel:y.showLabel,labelOffsetX:y.labelOffsetX,labelOffsetY:y.labelOffsetY,markerSymbol:y.markerImage instanceof Image||y.markerImage instanceof HTMLCanvasElement?y.markerImage:y.markerImageEl}}else y=m._defaultStyle;t.lineWidth=y.lineWidth,y.outlineColor instanceof r.Color?t.strokeStyle=y.outlineColor.toCssColorString():t.strokeStyle=y.outlineColor,y.fillColor instanceof r.Color?t.fillStyle=y.fillColor.toCssColorString():t.fillStyle=y.fillColor,y.lineDash&&t.setLineDash(y.lineDash),t.lineCap=y.lineCap,y.shadowColor&&y.shadowColor instanceof r.Color?t.shadowColor=y.shadowColor.toCssColorString():t.shadowColor=y.shadowColor,t.shadowBlur=y.shadowBlur,t.shadowOffsetX=y.shadowOffsetX,t.shadowOffsetY=y.shadowOffsetY,t.miterLimit=y.miterLimit,t.lineJoin=y.lineJoin;var o=n.geometry;if("Point"==o.type)!function(t,e,i,n,s,a,o,h,l,u){void 0===l&&(l="NAME");var f=Object.assign({pointSize:3,fontSize:9,fontFamily:"courier",color:"rgb(0,0,0)",backgroundColor:"rgb(255,0,0)",pointStyle:"Solid",ringRadius:2,circleLineWidth:1,showMarker:!0,showLabel:!0,labelOffsetX:0,labelOffsetY:0,markerSymbol:void 0},u);t.font=f.fontSize+"px "+f.fontFamily+" bold";var d=a.geometry.coordinates,p=(d[0]-i.xMin)/(i.xMax-i.xMin),g=(d[1]-i.yMax)/(i.yMin-i.yMax),m=p*t.canvas.width,_=g*t.canvas.height;if(f.showMarker||f.showMarker){var y=m+n,v=_+s;if(f.markerSymbol&&(f.markerSymbol instanceof Image||f.markerSymbol instanceof HTMLCanvasElement)){var b=f.markerSymbol.height;y-=f.markerSymbol.width/2,v-=b/2,f.markerSymbol.width&&f.markerSymbol.height&&t.drawImage(f.markerSymbol,y,v)}else y-=f.pointSize,v-=f.pointSize,t.fillStyle=f.backgroundColor,t.beginPath(),t.arc(y,v,f.pointSize,0,2*Math.PI),"Solid"==f.pointStyle?t.fill():"Circle"==f.pointStyle?(t.lineWidth=f.circleLineWidth,t.strokeStyle=f.backgroundColor,t.stroke()):"Ring"==f.pointStyle&&(t.strokeStyle=f.backgroundColor,t.stroke(),t.beginPath(),t.arc(y,v,f.ringRadius,0,2*Math.PI),t.closePath(),t.fill())}if(f.showLabel){var M=a.properties[l];if(M){"string"!=typeof M&&(M=M.toString()),t.fillStyle=f.color;var w=m+n+f.labelOffsetX,x=_+s+f.labelOffsetY,C=c(M=M.trim(),{fill:!0,font:f.fontSize+"px "+f.fontFamily,stroke:f.labelStroke,strokeWidth:f.labelStrokeWidth,strokeColor:"string"==typeof f.labelStrokeColor?r.Color.fromCssColorString(f.labelStrokeColor):f.labelStrokeColor,fillColor:r.Color.fromCssColorString(f.color)}),S=C.height;w-=C.width/2+f.pointSize,x-=S/2+f.pointSize,C.width&&C.height&&t.drawImage(C,w,x)}}t.restore()}(t,0,s,e,i,n,0,0,y.labelPropertyName,v);else if("Polygon"==o.type&&y.fill){var l=h.getCoords(n),u=C(t,_,s,e,i,l,!0,!1);u&&u.map((function(t){t.style=y,b.push(t)}))}else if("MultiPolygon"==o.type&&y.fill){try{h.getCoords(n).map((function(r){var n=C(t,_,s,e,i,r,!0,!1);n&&n.map((function(t){t.style=y,b.push(t)}))}))}catch(t){}}else if("MultiLineString"==o.type)if(n.properties._outline&&!y.outline);else{var f=h.getCoords(n);C(t,_,s,e,i,f,!1,!0),f=null}else if("LineString"==o.type)if(n.properties._outline&&!y.outline);else{var d=h.getCoords(n),p=[d];C(t,_,s,e,i,p,!1,!0),d=null,p=null}}},x.pointIsCrossTile=function(t,e,i,r){if(r&&r.splice(0,r.length),!i.properties)return!0;if(!i.properties.symbol)return!0;var n=i.properties.symbol,s=i.geometry.coordinates,a=(s[0]-e[0])/(e[2]-e[0]),o=(s[1]-e[3])/(e[1]-e[3]),h=a*t.canvas.width,l=o*t.canvas.height,u=h-n.width/2,f=h+n.width/2,c=l-n.height/2,d=l+n.height/2;return u<0||f>t.canvas.width||(c<0||d>t.canvas.height||(r[0]=u,r[1]=c,r[2]=f,r[3]=d,!1))},x.prototype.requestImageSync=function(t,e,i){var n=t+","+e+","+i;if(this.cache&&this.cache[n])return this.cache[n];var s=this._tilingScheme.tileXYToRectangle(t,e,i),a={xMin:r.Math.toDegrees(s.west),yMin:r.Math.toDegrees(s.south),xMax:r.Math.toDegrees(s.east),yMax:r.Math.toDegrees(s.north)},o=this._clipGeojson(s);return o?(this._createCanvas(),this._defaultStyle.backgroundColor||this._context.clearRect(0,0,this._canvas.width,this._canvas.height),this._drawGeojson(this._context,0,0,o,a,this._tileWidth,this._tileHeight,this._fill,this._outline,t,e,i),this._canvas):this._onlyPoint||this._polygonOnly&&this._defaultStyle.fill?S(this._defaultStyle.backgroundColor):void 0},x.prototype._createTileImage=function(t,e,i,n,s){var a=this,o=t+","+e+","+i,h={xMin:r.Math.toDegrees(n.west),yMin:r.Math.toDegrees(n.south),xMax:r.Math.toDegrees(n.east),yMax:r.Math.toDegrees(n.north)};this._state=x.State.CLIPPING,requestAnimationFrame((function(){var l=a._clipGeojson(n);l?r.requestAnimationFrame((function(){a._state=x.State.GEOJSONDRAWING,a._createCanvas(),a._defaultStyle.backgroundColor||a._context.clearRect(0,0,a._canvas.width,a._canvas.height),a._drawGeojson(a._context,0,0,l,h,a._tileWidth,a._tileHeight,a._fill,a._outline,t,e,i),a.cache[o]=a._canvas,a.cache[o].srcJson=l,a.cacheCount++,x._currentTaskCount--,s.resolve(a._canvas),r.requestAnimationFrame((function(){a._state=x.State.COMPELTED}))})):(a._onlyPoint?s.resolve(S(a._defaultStyle.backgroundColor)):s.resolve(void 0),a._state=x.State.COMPELTED,x._currentTaskCount--)}))},x.prototype.clearCache=function(){for(var t in this.cache)this.cache.hasOwnProperty(t)&&(this.cache[t].srcJson=null,delete this.cache[t]);this.cache={},this.cacheCount=0},x.prototype._getTileImage=function(t,e,i,n){var s=r.defer(),a=this,o=t+","+e+","+i;if(a.cacheCount||(a.cacheCount=0),!a.cache||a.cacheCount>a._tileCacheSize){for(var h in a.cache)a.cache.hasOwnProperty(h)&&(a.cache[h].srcJson=null,delete a.cache[h]);a.cache={},a.cacheCount=0}return a.cache[o]?a.cache[o]:x._maxTaskCountthis._maximumLevel)return S(this._defaultStyle.backgroundColor);var n=this.tilingScheme.tileXYToRectangle(t,e,i);return this._getTileImage(t,e,i,n)}},x.compose=function(t,e,i,n,s){n=n||256,s=s||256,t.sort((function(t,e){return r.defined(t.zIndex)?r.defined(e.zIndex)?t.zIndex-e.zIndex:1:-1}));var a=new r.GeographicTilingScheme,o=r.Rectangle.northwest(e),h=r.Rectangle.southeast(e),l=a.positionToTileXY(o,i),u=a.positionToTileXY(h,i),f=(u.x-l.x+1)*n,c=(u.y-l.y+1)*s,d=document.createElement("canvas");d.width=f,d.height=c;for(var p=d.getContext("2d"),g=0;g