Files
torebki-fabiola.pl/wp-content/plugins/mapster-wp-maps/admin/js/dist/mwp-settings.js
2026-03-05 13:07:40 +01:00

1 line
548 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=t()}}((function(){return function t(e,i,r){function n(a,o){if(!i[a]){if(!e[a]){var h="function"==typeof require&&require;if(!o&&h)return h(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return n(e[a][1][t]||t)}),l,l.exports,t,e,i,r)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(t,e,i){e.exports={along:t("@turf/along").default,bbox:t("@turf/bbox").default,center:t("@turf/center").default,distance:t("@turf/distance").default,destination:t("@turf/destination").default,length:t("@turf/length").default,nearestPointOnLine:t("@turf/nearest-point-on-line").default,booleanPointInPolygon:t("@turf/boolean-point-in-polygon").default,pointOnFeature:t("@turf/point-on-feature").default}},{"@turf/along":2,"@turf/bbox":3,"@turf/boolean-point-in-polygon":5,"@turf/center":6,"@turf/destination":8,"@turf/distance":9,"@turf/length":13,"@turf/nearest-point-on-line":17,"@turf/point-on-feature":19}],2:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=r(t("@turf/bearing")),s=r(t("@turf/destination")),a=r(t("@turf/distance")),o=t("@turf/helpers"),h=t("@turf/invariant");i.default=function(t,e,i){void 0===i&&(i={});for(var r=h.getGeom(t).coordinates,u=0,l=0;l<r.length&&!(e>=u&&l===r.length-1);l++){if(u>=e){var c=e-u;if(c){var f=n.default(r[l],r[l-1])-180;return s.default(r[l],c,f,i)}return o.point(r[l])}u+=a.default(r[l],r[l+1],i)}return o.point(r[r.length-1])}},{"@turf/bearing":4,"@turf/destination":8,"@turf/distance":9,"@turf/helpers":11,"@turf/invariant":12}],3:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/meta");function n(t){var e=[1/0,1/0,-1/0,-1/0];r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]);e[1]>t[1]&&(e[1]=t[1]);e[2]<t[0]&&(e[2]=t[0]);e[3]<t[1]&&(e[3]=t[1])}));return e}n.default=n;i.default=n},{"@turf/meta":16}],4:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/helpers"),n=t("@turf/invariant");function s(t,e,i){void 0===i&&(i={});if(!0===i.final)return function(t,e){var i=s(e,t);return(i+180)%360}(t,e);var a=n.getCoord(t),o=n.getCoord(e),h=r.degreesToRadians(a[0]),u=r.degreesToRadians(o[0]),l=r.degreesToRadians(a[1]),c=r.degreesToRadians(o[1]),f=Math.sin(u-h)*Math.cos(c),p=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(u-h);return r.radiansToDegrees(Math.atan2(f,p))}i.default=s},{"@turf/helpers":11,"@turf/invariant":12}],5:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/invariant");i.default=function(t,e,i){void 0===i&&(i={});if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var s=r.getCoord(t),a=r.getGeom(e),o=a.type,h=e.bbox,u=a.coordinates;if(h&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(s,h))return!1;"Polygon"===o&&(u=[u]);for(var l=!1,c=0;c<u.length&&!l;c++)if(n(s,u[c][0],i.ignoreBoundary)){for(var f=!1,p=1;p<u[c].length&&!f;){n(s,u[c][p],!i.ignoreBoundary)&&(f=!0);p++}f||(l=!0)}return l};function n(t,e,i){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var n=0,s=e.length-1;n<e.length;s=n++){var a=e[n][0],o=e[n][1],h=e[s][0],u=e[s][1];if(t[1]*(a-h)+o*(h-t[0])+u*(t[0]-a)==0&&(a-t[0])*(h-t[0])<=0&&(o-t[1])*(u-t[1])<=0)return!i;o>t[1]!=u>t[1]&&t[0]<(h-a)*(t[1]-o)/(u-o)+a&&(r=!r)}return r}},{"@turf/invariant":12}],6:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=r(t("@turf/bbox")),s=t("@turf/helpers");i.default=function(t,e){void 0===e&&(e={});var i=n.default(t),r=(i[0]+i[2])/2,a=(i[1]+i[3])/2;return s.point([r,a],e.properties,e)}},{"@turf/bbox":3,"@turf/helpers":11}],7:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});function r(t){var e={type:"Feature"};Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}}));e.properties=n(t.properties);e.geometry=s(t.geometry);return e}function n(t){var e={};if(!t)return e;Object.keys(t).forEach((function(i){var r=t[i];"object"==typeof r?null===r?e[i]=null:Array.isArray(r)?e[i]=r.map((function(t){return t})):e[i]=n(r):e[i]=r}));return e}function s(t){var e={type:t.type};t.bbox&&(e.bbox=t.bbox);if("GeometryCollection"===t.type){e.geometries=t.geometries.map((function(t){return s(t)}));return e}e.coordinates=a(t.coordinates);return e}function a(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return a(t)}))}i.default=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}}));e.features=t.features.map((function(t){return r(t)}));return e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return s(t);default:throw new Error("unknown GeoJSON type")}}},{}],8:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/helpers"),n=t("@turf/invariant");i.default=function(t,e,i,s){void 0===s&&(s={});var a=n.getCoord(t),o=r.degreesToRadians(a[0]),h=r.degreesToRadians(a[1]),u=r.degreesToRadians(i),l=r.lengthToRadians(e,s.units),c=Math.asin(Math.sin(h)*Math.cos(l)+Math.cos(h)*Math.sin(l)*Math.cos(u)),f=o+Math.atan2(Math.sin(u)*Math.sin(l)*Math.cos(h),Math.cos(l)-Math.sin(h)*Math.sin(c)),p=r.radiansToDegrees(f),d=r.radiansToDegrees(c);return r.point([p,d],s.properties)}},{"@turf/helpers":11,"@turf/invariant":12}],9:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/invariant"),n=t("@turf/helpers");i.default=function(t,e,i){void 0===i&&(i={});var s=r.getCoord(t),a=r.getCoord(e),o=n.degreesToRadians(a[1]-s[1]),h=n.degreesToRadians(a[0]-s[0]),u=n.degreesToRadians(s[1]),l=n.degreesToRadians(a[1]),c=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(h/2),2)*Math.cos(u)*Math.cos(l);return n.radiansToLength(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),i.units)}},{"@turf/helpers":11,"@turf/invariant":12}],10:[function(t,e,i){"use strict";var r=t("@turf/meta"),n=t("@turf/helpers");function s(t){var e=[];"FeatureCollection"===t.type?r.featureEach(t,(function(t){r.coordEach(t,(function(i){e.push(n.point(i,t.properties))}))})):r.coordEach(t,(function(i){e.push(n.point(i,t.properties))}));return n.featureCollection(e)}e.exports=s;e.exports.default=s},{"@turf/helpers":11,"@turf/meta":16}],11:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.earthRadius=6371008.8;i.factors={centimeters:100*i.earthRadius,centimetres:100*i.earthRadius,degrees:i.earthRadius/111325,feet:3.28084*i.earthRadius,inches:39.37*i.earthRadius,kilometers:i.earthRadius/1e3,kilometres:i.earthRadius/1e3,meters:i.earthRadius,metres:i.earthRadius,miles:i.earthRadius/1609.344,millimeters:1e3*i.earthRadius,millimetres:1e3*i.earthRadius,nauticalmiles:i.earthRadius/1852,radians:1,yards:1.0936*i.earthRadius};i.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/i.earthRadius,yards:1.0936133};i.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function r(t,e,i){void 0===i&&(i={});var r={type:"Feature"};(0===i.id||i.id)&&(r.id=i.id);i.bbox&&(r.bbox=i.bbox);r.properties=e||{};r.geometry=t;return r}i.feature=r;i.geometry=function(t,e,i){void 0===i&&(i={});switch(t){case"Point":return n(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return s(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return h(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}};function n(t,e,i){void 0===i&&(i={});if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(t[0])||!d(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,i)}i.point=n;i.points=function(t,e,i){void 0===i&&(i={});return o(t.map((function(t){return n(t,e)})),i)};function s(t,e,i){void 0===i&&(i={});for(var n=0,s=t;n<s.length;n++){var a=s[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<a[a.length-1].length;o++)if(a[a.length-1][o]!==a[0][o])throw new Error("First and last Position are not equivalent.")}return r({type:"Polygon",coordinates:t},e,i)}i.polygon=s;i.polygons=function(t,e,i){void 0===i&&(i={});return o(t.map((function(t){return s(t,e)})),i)};function a(t,e,i){void 0===i&&(i={});if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:t},e,i)}i.lineString=a;i.lineStrings=function(t,e,i){void 0===i&&(i={});return o(t.map((function(t){return a(t,e)})),i)};function o(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};e.id&&(i.id=e.id);e.bbox&&(i.bbox=e.bbox);i.features=t;return i}i.featureCollection=o;function h(t,e,i){void 0===i&&(i={});return r({type:"MultiLineString",coordinates:t},e,i)}i.multiLineString=h;function u(t,e,i){void 0===i&&(i={});return r({type:"MultiPoint",coordinates:t},e,i)}i.multiPoint=u;function l(t,e,i){void 0===i&&(i={});return r({type:"MultiPolygon",coordinates:t},e,i)}i.multiPolygon=l;i.geometryCollection=function(t,e,i){void 0===i&&(i={});return r({type:"GeometryCollection",geometries:t},e,i)};i.round=function(t,e){void 0===e&&(e=0);if(e&&!(e>=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i};function c(t,e){void 0===e&&(e="kilometers");var r=i.factors[e];if(!r)throw new Error(e+" units is invalid");return t*r}i.radiansToLength=c;function f(t,e){void 0===e&&(e="kilometers");var r=i.factors[e];if(!r)throw new Error(e+" units is invalid");return t/r}i.lengthToRadians=f;i.lengthToDegrees=function(t,e){return p(f(t,e))};i.bearingToAzimuth=function(t){var e=t%360;e<0&&(e+=360);return e};function p(t){return 180*(t%(2*Math.PI))/Math.PI}i.radiansToDegrees=p;i.degreesToRadians=function(t){return t%360*Math.PI/180};i.convertLength=function(t,e,i){void 0===e&&(e="kilometers");void 0===i&&(i="kilometers");if(!(t>=0))throw new Error("length must be a positive number");return c(f(t,e),i)};i.convertArea=function(t,e,r){void 0===e&&(e="meters");void 0===r&&(r="kilometers");if(!(t>=0))throw new Error("area must be a positive number");var n=i.areaFactors[e];if(!n)throw new Error("invalid original units");var s=i.areaFactors[r];if(!s)throw new Error("invalid final units");return t/n*s};function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}i.isNumber=d;i.isObject=function(t){return!!t&&t.constructor===Object};i.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))};i.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],12:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/helpers");i.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")};i.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")};i.containsNumber=function t(e){if(e.length>1&&r.isNumber(e[0])&&r.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")};i.geojsonType=function(t,e,i){if(!e||!i)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.type)};i.featureOf=function(t,e,i){if(!t)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.geometry.type)};i.collectionOf=function(t,e,i){if(!t)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var r=0,n=t.features;r<n.length;r++){var s=n[r];if(!s||"Feature"!==s.type||!s.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!s.geometry||s.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+s.geometry.type)}};i.getGeom=function(t){return"Feature"===t.type?t.geometry:t};i.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},{"@turf/helpers":11}],13:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=r(t("@turf/distance")),s=t("@turf/meta");i.default=function(t,e){void 0===e&&(e={});return s.segmentReduce(t,(function(t,i){var r=i.geometry.coordinates;return t+n.default(r[0],r[1],e)}),0)}},{"@turf/distance":9,"@turf/meta":16}],14:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=t("@turf/helpers"),s=t("@turf/invariant"),a=r(t("@turf/line-segment")),o=t("@turf/meta"),h=r(t("geojson-rbush"));function u(t,e){var i=s.getCoords(t),r=s.getCoords(e);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var a=i[0][0],o=i[0][1],h=i[1][0],u=i[1][1],l=r[0][0],c=r[0][1],f=r[1][0],p=r[1][1],d=(p-c)*(h-a)-(f-l)*(u-o),m=(f-l)*(o-c)-(p-c)*(a-l),y=(h-a)*(o-c)-(u-o)*(a-l);if(0===d)return null;var g=m/d,_=y/d;if(g>=0&&g<=1&&_>=0&&_<=1){var v=a+g*(h-a),b=o+g*(u-o);return n.point([v,b])}return null}i.default=function(t,e){var i={},r=[];"LineString"===t.type&&(t=n.feature(t));"LineString"===e.type&&(e=n.feature(e));if("Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var l=u(t,e);l&&r.push(l);return n.featureCollection(r)}var c=h.default();c.load(a.default(e));o.featureEach(a.default(t),(function(t){o.featureEach(c.search(t),(function(e){var n=u(t,e);if(n){var a=s.getCoords(n).join(",");if(!i[a]){i[a]=!0;r.push(n)}}}))}));return n.featureCollection(r)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/line-segment":15,"@turf/meta":16,"geojson-rbush":20}],15:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/helpers"),n=t("@turf/invariant"),s=t("@turf/meta");i.default=function(t){if(!t)throw new Error("geojson is required");var e=[];s.flattenEach(t,(function(t){!function(t,e){var i=[],s=t.geometry;if(null!==s){switch(s.type){case"Polygon":i=n.getCoords(s);break;case"LineString":i=[n.getCoords(s)]}i.forEach((function(i){var n=function(t,e){var i=[];t.reduce((function(t,n){var s,a,o,h,u,l,c=r.lineString([t,n],e);c.bbox=(a=n,o=(s=t)[0],h=s[1],u=a[0],l=a[1],[o<u?o:u,h<l?h:l,o>u?o:u,h>l?h:l]);i.push(c);return n}));return i}(i,t.properties);n.forEach((function(t){t.id=e.length;e.push(t)}))}))}}(t,e)}));return r.featureCollection(e)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/meta":16}],16:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t("@turf/helpers");function n(t,e,i){if(null!==t)for(var r,s,a,o,h,u,l,c,f=0,p=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,_=0;_<g;_++){h=(c=!!(l=m?t.features[_].geometry:y?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var v=0;v<h;v++){var b=0,w=0;if(null!==(o=c?l.geometries[v]:l)){u=o.coordinates;var M=o.type;f=!i||"Polygon"!==M&&"MultiPolygon"!==M?0:1;switch(M){case null:break;case"Point":if(!1===e(u,p,_,b,w))return!1;p++;b++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],p,_,b,w))return!1;p++;"MultiPoint"===M&&b++}"LineString"===M&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(s=0;s<u[r].length-f;s++){if(!1===e(u[r][s],p,_,b,w))return!1;p++}"MultiLineString"===M&&b++;"Polygon"===M&&w++}"Polygon"===M&&b++;break;case"MultiPolygon":for(r=0;r<u.length;r++){w=0;for(s=0;s<u[r].length;s++){for(a=0;a<u[r][s].length-f;a++){if(!1===e(u[r][s][a],p,_,b,w))return!1;p++}w++}b++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===n(o.geometries[r],e,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function s(t,e){var i;switch(t.type){case"FeatureCollection":for(i=0;i<t.features.length&&!1!==e(t.features[i].properties,i);i++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function o(t,e){var i,r,n,s,a,o,h,u,l,c,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,m=p?t.features.length:1;for(i=0;i<m;i++){o=p?t.features[i].geometry:d?t.geometry:t;u=p?t.features[i].properties:d?t.properties:{};l=p?t.features[i].bbox:d?t.bbox:void 0;c=p?t.features[i].id:d?t.id:void 0;a=(h=!!o&&"GeometryCollection"===o.type)?o.geometries.length:1;for(n=0;n<a;n++)if(null!==(s=h?o.geometries[n]:o))switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(s,f,u,l,c))return!1;break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===e(s.geometries[r],f,u,l,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,l,c))return!1;f++}}function h(t,e){o(t,(function(t,i,n,s,a){var o,h=null===t?null:t.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,n,{bbox:s,id:a}),i,0)&&void 0}switch(h){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l={type:o,coordinates:t.coordinates[u]};if(!1===e(r.feature(l,n),i,u))return!1}}))}function u(t,e){h(t,(function(t,i,s){var a=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var h,u=0,l=0,c=0;return!1!==n(t,(function(n,o,f,p,d){if(void 0===h||i>u||p>l||d>c){h=n;u=i;l=p;c=d;a=0}else{var m=r.lineString([h,n],t.properties);if(!1===e(m,i,s,d,a))return!1;a++;h=n}}))&&void 0}}}))}function l(t,e){if(!t)throw new Error("geojson is required");h(t,(function(t,i,n){if(null!==t.geometry){var s=t.geometry.type,a=t.geometry.coordinates;switch(s){case"LineString":if(!1===e(t,i,n,0,0))return!1;break;case"Polygon":for(var o=0;o<a.length;o++)if(!1===e(r.lineString(a[o],t.properties),i,n,o))return!1}}}))}i.coordAll=function(t){var e=[];n(t,(function(t){e.push(t)}));return e};i.coordEach=n;i.coordReduce=function(t,e,i,r){var s=i;n(t,(function(t,r,n,a,o){s=0===r&&void 0===i?t:e(s,t,r,n,a,o)}),r);return s};i.featureEach=a;i.featureReduce=function(t,e,i){var r=i;a(t,(function(t,n){r=0===n&&void 0===i?t:e(r,t,n)}));return r};i.findPoint=function(t,e){e=e||{};if(!r.isObject(e))throw new Error("options is invalid");var i,n=e.featureIndex||0,s=e.multiFeatureIndex||0,a=e.geometryIndex||0,o=e.coordIndex||0,h=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n);h=h||t.features[n].properties;i=t.features[n].geometry;break;case"Feature":h=h||t.properties;i=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=t;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var u=i.coordinates;switch(i.type){case"Point":return r.point(u,h,e);case"MultiPoint":s<0&&(s=u.length+s);return r.point(u[s],h,e);case"LineString":o<0&&(o=u.length+o);return r.point(u[o],h,e);case"Polygon":a<0&&(a=u.length+a);o<0&&(o=u[a].length+o);return r.point(u[a][o],h,e);case"MultiLineString":s<0&&(s=u.length+s);o<0&&(o=u[s].length+o);return r.point(u[s][o],h,e);case"MultiPolygon":s<0&&(s=u.length+s);a<0&&(a=u[s].length+a);o<0&&(o=u[s][a].length-o);return r.point(u[s][a][o],h,e)}throw new Error("geojson is invalid")};i.findSegment=function(t,e){e=e||{};if(!r.isObject(e))throw new Error("options is invalid");var i,n=e.featureIndex||0,s=e.multiFeatureIndex||0,a=e.geometryIndex||0,o=e.segmentIndex||0,h=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n);h=h||t.features[n].properties;i=t.features[n].geometry;break;case"Feature":h=h||t.properties;i=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=t;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var u=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":o<0&&(o=u.length+o-1);return r.lineString([u[o],u[o+1]],h,e);case"Polygon":a<0&&(a=u.length+a);o<0&&(o=u[a].length+o-1);return r.lineString([u[a][o],u[a][o+1]],h,e);case"MultiLineString":s<0&&(s=u.length+s);o<0&&(o=u[s].length+o-1);return r.lineString([u[s][o],u[s][o+1]],h,e);case"MultiPolygon":s<0&&(s=u.length+s);a<0&&(a=u[s].length+a);o<0&&(o=u[s][a].length-o-1);return r.lineString([u[s][a][o],u[s][a][o+1]],h,e)}throw new Error("geojson is invalid")};i.flattenEach=h;i.flattenReduce=function(t,e,i){var r=i;h(t,(function(t,n,s){r=0===n&&0===s&&void 0===i?t:e(r,t,n,s)}));return r};i.geomEach=o;i.geomReduce=function(t,e,i){var r=i;o(t,(function(t,n,s,a,o){r=0===n&&void 0===i?t:e(r,t,n,s,a,o)}));return r};i.lineEach=l;i.lineReduce=function(t,e,i){var r=i;l(t,(function(t,n,s,a){r=0===n&&void 0===i?t:e(r,t,n,s,a)}));return r};i.propEach=s;i.propReduce=function(t,e,i){var r=i;s(t,(function(t,n){r=0===n&&void 0===i?t:e(r,t,n)}));return r};i.segmentEach=u;i.segmentReduce=function(t,e,i){var r=i,n=!1;u(t,(function(t,s,a,o,h){r=!1===n&&void 0===i?t:e(r,t,s,a,o,h);n=!0}));return r}},{"@turf/helpers":11}],17:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=r(t("@turf/bearing")),s=r(t("@turf/distance")),a=r(t("@turf/destination")),o=r(t("@turf/line-intersect")),h=t("@turf/meta"),u=t("@turf/helpers"),l=t("@turf/invariant");i.default=function(t,e,i){void 0===i&&(i={});var r=u.point([1/0,1/0],{dist:1/0}),c=0;h.flattenEach(t,(function(t){for(var h=l.getCoords(t),f=0;f<h.length-1;f++){var p=u.point(h[f]);p.properties.dist=s.default(e,p,i);var d=u.point(h[f+1]);d.properties.dist=s.default(e,d,i);var m=s.default(p,d,i),y=Math.max(p.properties.dist,d.properties.dist),g=n.default(p,d),_=a.default(e,y,g+90,i),v=a.default(e,y,g-90,i),b=o.default(u.lineString([_.geometry.coordinates,v.geometry.coordinates]),u.lineString([p.geometry.coordinates,d.geometry.coordinates])),w=null;if(b.features.length>0){(w=b.features[0]).properties.dist=s.default(e,w,i);w.properties.location=c+s.default(p,w,i)}if(p.properties.dist<r.properties.dist){(r=p).properties.index=f;r.properties.location=c}if(d.properties.dist<r.properties.dist){(r=d).properties.index=f+1;r.properties.location=c+m}w&&w.properties.dist<r.properties.dist&&((r=w).properties.index=f);c+=m}}));return r}},{"@turf/bearing":4,"@turf/destination":8,"@turf/distance":9,"@turf/helpers":11,"@turf/invariant":12,"@turf/line-intersect":14,"@turf/meta":16}],18:[function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i,"__esModule",{value:!0});var n=r(t("@turf/clone")),s=r(t("@turf/distance")),a=t("@turf/meta");i.default=function(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var i,r=1/0,o=0;a.featureEach(e,(function(e,i){var n=s.default(t,e);if(n<r){o=i;r=n}}));(i=n.default(e.features[o])).properties.featureIndex=o;i.properties.distanceToPoint=r;return i}},{"@turf/clone":7,"@turf/distance":9,"@turf/meta":16}],19:[function(t,e,i){"use strict";var r=t("@turf/explode"),n=t("@turf/center"),s=t("@turf/nearest-point"),a=t("@turf/boolean-point-in-polygon"),o=t("@turf/helpers");function h(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=h(r),l=h(n),c=h(s),f=h(a);function p(t){for(var e=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?o.featureCollection([o.feature(t)]):o.featureCollection([t]);return t}(t),i=l.default(e),r=!1,n=0;!r&&n<e.features.length;){var s,a=e.features[n].geometry,h=!1;if("Point"===a.type)i.geometry.coordinates[0]===a.coordinates[0]&&i.geometry.coordinates[1]===a.coordinates[1]&&(r=!0);else if("MultiPoint"===a.type){var p=!1;s=0;for(;!p&&s<a.coordinates.length;){if(i.geometry.coordinates[0]===a.coordinates[s][0]&&i.geometry.coordinates[1]===a.coordinates[s][1]){r=!0;p=!0}s++}}else if("LineString"===a.type){s=0;for(;!h&&s<a.coordinates.length-1;){if(d(i.geometry.coordinates[0],i.geometry.coordinates[1],a.coordinates[s][0],a.coordinates[s][1],a.coordinates[s+1][0],a.coordinates[s+1][1])){h=!0;r=!0}s++}}else if("MultiLineString"===a.type)for(var m=0;m<a.coordinates.length;){h=!1;s=0;for(var y=a.coordinates[m];!h&&s<y.length-1;){if(d(i.geometry.coordinates[0],i.geometry.coordinates[1],y[s][0],y[s][1],y[s+1][0],y[s+1][1])){h=!0;r=!0}s++}m++}else"Polygon"!==a.type&&"MultiPolygon"!==a.type||f.default(i,a)&&(r=!0);n++}if(r)return i;var g=o.featureCollection([]);for(n=0;n<e.features.length;n++)g.features=g.features.concat(u.default(e.features[n]).features);return o.point(c.default(i,g).geometry.coordinates)}function d(t,e,i,r,n,s){return Math.sqrt((n-i)*(n-i)+(s-r)*(s-r))===Math.sqrt((t-i)*(t-i)+(e-r)*(e-r))+Math.sqrt((n-t)*(n-t)+(s-e)*(s-e))}e.exports=p;e.exports.default=p},{"@turf/boolean-point-in-polygon":5,"@turf/center":6,"@turf/explode":10,"@turf/helpers":11,"@turf/nearest-point":18}],20:[function(t,e,i){var r=t("rbush"),n=t("@turf/helpers"),s=t("@turf/meta"),a=t("@turf/bbox").default,o=s.featureEach,h=(s.coordEach,n.polygon,n.featureCollection);function u(t){var e=new r(t);e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");t.bbox=t.bbox?t.bbox:a(t);return r.prototype.insert.call(this,t)};e.load=function(t){var e=[];Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t);e.push(t)})):o(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t);e.push(t)}));return r.prototype.load.call(this,e)};e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");t.bbox=t.bbox?t.bbox:a(t);return r.prototype.remove.call(this,t,e)};e.clear=function(){return r.prototype.clear.call(this)};e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return h(e)};e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))};e.all=function(){var t=r.prototype.all.call(this);return h(t)};e.toJSON=function(){return r.prototype.toJSON.call(this)};e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)};e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}};return e}e.exports=u;e.exports.default=u},{"@turf/bbox":3,"@turf/helpers":11,"@turf/meta":16,rbush:21}],21:[function(t,e,i){r=this,n=function(){"use strict";function t(t,r,n,s,a){!function t(i,r,n,s,a){for(;s>n;){if(s-n>600){var o=s-n+1,h=r-n+1,u=Math.log(o),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(o-l)/o)*(h-o/2<0?-1:1);t(i,r,Math.max(n,Math.floor(r-h*l/o+c)),Math.min(s,Math.floor(r+(o-h)*l/o+c)),a)}var f=i[r],p=n,d=s;for(e(i,n,r),a(i[s],f)>0&&e(i,n,s);p<d;){for(e(i,p,d),p++,d--;a(i[p],f)<0;)p++;for(;a(i[d],f)>0;)d--}0===a(i[n],f)?e(i,n,d):e(i,++d,s),d<=r&&(n=d+1),r<=d&&(s=d-1)}}(t,r,n||0,s||t.length-1,a||i)}function e(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,r,n){n||(n=d(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var s=e;s<i;s++){var a=t.children[s];o(n,t.leaf?r(a):a)}return n}function o(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function h(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function l(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,i,r,n,s){for(var a=[i,r];a.length;)if(!((r=a.pop())-(i=a.pop())<=n)){var o=i+Math.ceil((r-i)/n/2)*n;t(e,o,i,r,s),a.push(i,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,i=[];if(!p(t,e))return i;for(var r=this.toBBox,n=[];e;){for(var s=0;s<e.children.length;s++){var a=e.children[s],o=e.leaf?r(a):a;p(t,o)&&(e.leaf?i.push(a):f(t,o)?this._all(a,i):n.push(a))}e=n.pop()}return i},r.prototype.collides=function(t){var e=this.data;if(!p(t,e))return!1;for(var i=[];e;){for(var r=0;r<e.children.length;r++){var n=e.children[r],s=e.leaf?this.toBBox(n):n;if(p(t,s)){if(e.leaf||f(t,s))return!0;i.push(n)}}e=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var i,r,s,a=this.data,o=this.toBBox(t),h=[],u=[];a||h.length;){if(a||(a=h.pop(),r=h[h.length-1],i=u.pop(),s=!0),a.leaf){var l=n(t,a.children,e);if(-1!==l)return a.children.splice(l,1),h.push(a),this._condense(h),this}s||a.leaf||!f(a,o)?r?(i++,a=r.children[i],s=!1):a=null:(h.push(a),u.push(i),i=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},r.prototype._build=function(t,e,i,r){var n,a=i-e+1,o=this._maxEntries;if(a<=o)return s(n=d(t.slice(e,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=d([])).leaf=!1,n.height=r;var h=Math.ceil(a/o),u=h*Math.ceil(Math.sqrt(o));m(t,e,i,u,this.compareMinX);for(var l=e;l<=i;l+=u){var c=Math.min(l+u-1,i);m(t,l,c,h,this.compareMinY);for(var f=l;f<=c;f+=h){var p=Math.min(f+h-1,c);n.children.push(this._build(t,f,p,r-1))}}return s(n,this.toBBox),n},r.prototype._chooseSubtree=function(t,e,i,r){for(;r.push(e),!e.leaf&&r.length-1!==i;){for(var n=1/0,s=1/0,a=void 0,o=0;o<e.children.length;o++){var h=e.children[o],u=l(h),c=(f=t,p=h,(Math.max(p.maxX,f.maxX)-Math.min(p.minX,f.minX))*(Math.max(p.maxY,f.maxY)-Math.min(p.minY,f.minY))-u);c<s?(s=c,n=u<n?u:n,a=h):c===s&&u<n&&(n=u,a=h)}e=a||e.children[0]}var f,p;return e},r.prototype._insert=function(t,e,i){var r=i?t:this.toBBox(t),n=[],s=this._chooseSubtree(r,this.data,e,n);for(s.children.push(t),o(s,r);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},r.prototype._split=function(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=d(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,s(i,this.toBBox),s(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},r.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,i){for(var r,n,s,o,h,u,c,f=1/0,p=1/0,d=e;d<=i-e;d++){var m=a(t,0,d,this.toBBox),y=a(t,d,i,this.toBBox),g=(n=m,s=y,o=Math.max(n.minX,s.minX),h=Math.max(n.minY,s.minY),u=Math.min(n.maxX,s.maxX),c=Math.min(n.maxY,s.maxY),Math.max(0,u-o)*Math.max(0,c-h)),_=l(m)+l(y);g<f?(f=g,r=d,p=_<p?_:p):g===f&&_<p&&(p=_,r=d)}return r||i-e},r.prototype._chooseSplitAxis=function(t,e,i){var r=t.leaf?this.compareMinX:h,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,i,r){t.children.sort(r);for(var n=this.toBBox,s=a(t,0,e,n),h=a(t,i-e,i,n),u=c(s)+c(h),l=e;l<i-e;l++){var f=t.children[l];o(s,t.leaf?n(f):f),u+=c(s)}for(var p=i-e-1;p>=e;p--){var d=t.children[p];o(h,t.leaf?n(d):d),u+=c(h)}return u},r.prototype._adjustParentBBoxes=function(t,e,i){for(var r=i;r>=0;r--)o(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():s(t[e],this.toBBox)},r},"object"==typeof i&&void 0!==e?e.exports=n():(r=r||self).RBush=n();var r,n},{}]},{},[1])(1)}));window.csv=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=32)}([function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var r=i(6),n=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=c;var s=i(5);s.inherits=i(2);var a=i(22),o=i(13);s.inherits(c,a);for(var h=n(o.prototype),u=0;u<h.length;u++){var l=h[u];c.prototype[l]||(c.prototype[l]=o.prototype[l])}function c(t){if(!(this instanceof c))return new c(t);a.call(this,t),o.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),c.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}},function(t,e,i){"use strict";(function(t){var r=i(37),n=i(38),s=i(39);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,i){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,i)}function u(t,e,i,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,r){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===i&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,i):new Uint8Array(e,i,r),h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=f(t,e),t}(t,e,i,r):"string"==typeof e?function(t,e,i){if("string"==typeof i&&""!==i||(i="utf8"),!h.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,i),n=(t=o(t,r)).write(e,i);return n!==r&&(t=t.slice(0,n)),t}(t,e,i):function(t,e){if(h.isBuffer(e)){var i=0|p(e.length);return 0===(t=o(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?o(t,0):f(t,e);if("Buffer"===e.type&&s(e.data))return f(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(l(e),t=o(t,e<0?0:0|p(e)),!h.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function f(t,e){var i=e.length<0?0:0|p(e.length);t=o(t,i);for(var r=0;r<i;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(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 z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return U(t).length;default:if(r)return z(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function y(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:g(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):g(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function g(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 u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var l=-1;for(s=i;s<o;s++)if(u(t,s)===u(e,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===h)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(i+h>o&&(i=o-h),s=i;s>=0;s--){for(var c=!0,f=0;f<h;f++)if(u(t,s+f)!==u(e,f)){c=!1;break}if(c)return s}return-1}function _(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(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<r;++a){var o=parseInt(e.substr(2*a,2),16);if(isNaN(o))return a;t[i+a]=o}return a}function v(t,e,i,r){return q(z(e,t.length-i),t,i,r)}function b(t,e,i,r){return q(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function w(t,e,i,r){return b(t,e,i,r)}function M(t,e,i,r){return q(U(e),t,i,r)}function x(t,e,i,r){return q(function(t,e){for(var i,r,n,s=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(i=t.charCodeAt(a))>>8,n=i%256,s.push(n),s.push(r);return s}(e,t.length-i),t,i,r)}function E(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;n<i;){var s,a,o,h,u=t[n],l=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c<=i)switch(c){case 1:u<128&&(l=u);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&u)<<6|63&s)>127&&(l=h);break;case 3:s=t[n+1],a=t[n+2],128==(192&s)&&128==(192&a)&&(h=(15&u)<<12|(63&s)<<6|63&a)>2047&&(h<55296||h>57343)&&(l=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&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(l=h)}null===l?(l=65533,c=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=c}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var i="",r=0;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=C));return i}(r)}e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,i){return u(null,t,e,i)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,i){return function(t,e,i,r){return l(e),e<=0?o(t,e):void 0!==i?"string"==typeof r?o(t,e).fill(i,r):o(t,e).fill(i):o(t,e)}(null,t,e,i)},h.allocUnsafe=function(t){return c(null,t)},h.allocUnsafeSlow=function(t){return c(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,r=e.length,n=0,s=Math.min(i,r);n<s;++n)if(t[n]!==e[n]){i=t[n],r=e[n];break}return i<r?-1:r<i?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var r=h.allocUnsafe(e),n=0;for(i=0;i<t.length;++i){var a=t[i];if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},h.byteLength=d,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},h.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):function(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 S(this,e,i);case"latin1":case"binary":return A(this,e,i);case"base64":return E(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+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),u=this.slice(r,n),l=t.slice(e,i),c=0;c<o;++c)if(u[c]!==l[c]){s=u[c],a=l[c];break}return s<a?-1:a<s?1:0},h.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},h.prototype.indexOf=function(t,e,i){return y(this,t,e,i,!0)},h.prototype.lastIndexOf=function(t,e,i){return y(this,t,e,i,!1)},h.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-e;if((void 0===i||i>n)&&(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 _(this,t,e,i);case"utf8":case"utf-8":return v(this,t,e,i);case"ascii":return b(this,t,e,i);case"latin1":case"binary":return w(this,t,e,i);case"base64":return M(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(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)}};var C=4096;function S(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function A(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function P(t,e,i){var r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);for(var n="",s=e;s<i;++s)n+=D(t[s]);return n}function j(t,e,i){for(var r=t.slice(e,i),n="",s=0;s<r.length;s+=2)n+=String.fromCharCode(r[s]+256*r[s+1]);return n}function O(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,i,r,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}function T(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-i,2);n<s;++n)t[i+n]=(e&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function I(t,e,i,r){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-i,4);n<s;++n)t[i+n]=e>>>8*(r?n:3-n)&255}function N(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 L(t,e,i,r,s){return s||N(t,0,i,4),n.write(t,e,i,r,23,4),i+4}function B(t,e,i,r,s){return s||N(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),e<t&&(e=t),h.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=h.prototype;else{var n=e-t;i=new h(n,void 0);for(var s=0;s<n;++s)i[s]=this[s+t]}return i},h.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||O(t,e,this.length);for(var r=this[t],n=1,s=0;++s<e&&(n*=256);)r+=this[t+s]*n;return r},h.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||O(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(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<e&&(n*=256);)r+=this[t+s]*n;return r>=(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||R(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,s=0;for(this[e]=255&t;++s<i&&(n*=256);)this[e+s]=t/n&255;return e+i},h.prototype.writeUIntBE=function(t,e,i,r){t=+t,e|=0,i|=0,r||R(this,t,e,i,Math.pow(2,8*i)-1,0);var n=i-1,s=1;for(this[e+n]=255&t;--n>=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||R(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||R(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||R(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):I(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||R(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):I(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);R(this,t,e,i,n-1,-n)}var s=0,a=1,o=0;for(this[e]=255&t;++s<i&&(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.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);R(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||R(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||R(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||R(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):I(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||R(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):I(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,i){return L(this,t,e,!0,i)},h.prototype.writeFloatBE=function(t,e,i){return L(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<i&&(r=i),r===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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<r-i&&(r=t.length-e+i);var n,s=r-i;if(this===t&&i<e&&e<r)for(n=s-1;n>=0;--n)t[n+e]=this[n+i];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n<s;++n)t[n+e]=this[n+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+s),e);return s},h.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var s;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{var a=h.isBuffer(t)?t:z(new h(t,r).toString()),o=a.length;for(s=0;s<i-e;++s)this[s+e]=a[s%o]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var i;e=e||1/0;for(var r=t.length,n=null,s=[],a=0;a<r;++a){if((i=t.charCodeAt(a))>55295&&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 U(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,i,r){for(var n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}}).call(this,i(0))},function(t,e){var i,r,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var h,u=[],l=!1,c=-1;function f(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=o(f);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new d(t,e)),1!==u.length||l||o(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,i){(function(t){function i(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===i(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===i(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===i(t)},e.isError=function(t){return"[object Error]"===i(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,i(3).Buffer)},function(t,e,i){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,i,r,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var s,a,o=arguments.length;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,i)}));case 3:return e.nextTick((function(){t.call(null,i,r)}));case 4:return e.nextTick((function(){t.call(null,i,r,n)}));default:for(s=new Array(o-1),a=0;a<s.length;)s[a++]=arguments[a];return e.nextTick((function(){t.apply(null,s)}))}}}:t.exports=e}).call(this,i(4))},function(t,e,i){var r=i(3),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),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){var r=i(16)(Object,"create");t.exports=r},function(t,e,i){var r=i(31);t.exports=function(t,e){for(var i=t.length;i--;)if(r(t[i][0],e))return i;return-1}},function(t,e,i){var r=i(96);t.exports=function(t,e){var i=t.__data__;return r(e)?i["string"==typeof e?"string":"hash"]:i.map}},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function n(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!function(t){return"number"==typeof t}(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,a,o,h,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(s(i=this._events[t]))return!1;if(r(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),i.apply(this,o)}else if(n(i))for(o=Array.prototype.slice.call(arguments,1),a=(u=i.slice()).length,h=0;h<a;h++)u[h].apply(this,o);return!0},i.prototype.addListener=function(t,e){var a;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,n(this._events[t])&&!this._events[t].warned&&(a=s(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){if(!r(e))throw TypeError("listener must be a function");var i=!1;function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},i.prototype.removeListener=function(t,e){var i,s,a,o;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(i=this._events[t]).length,s=-1,i===e||r(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(n(i)){for(o=a;o-- >0;)if(i[o]===e||i[o].listener&&i[o].listener===e){s=o;break}if(s<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r(i=this._events[t]))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){(e=t.exports=i(22)).Stream=e,e.Readable=e,e.Writable=i(13),e.Duplex=i(1),e.Transform=i(27),e.PassThrough=i(45)},function(t,e,i){"use strict";(function(e,r,n){var s=i(6);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=_;var o,h=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:s.nextTick;_.WritableState=g;var u=i(5);u.inherits=i(2);var l,c={deprecate:i(44)},f=i(23),p=i(7).Buffer,d=n.Uint8Array||function(){},m=i(24);function y(){}function g(t,e){o=o||i(1),t=t||{};var r=e instanceof o;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,u=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,n=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,n){--e.pendingcb,i?(s.nextTick(n,r),s.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(n(r),t._writableState.errorEmitted=!0,t.emit("error",r),E(t,e))}(t,i,r,e,n);else{var a=M(i);a||i.corked||i.bufferProcessing||!i.bufferedRequest||w(t,i),r?h(b,t,i,a,n):b(t,i,a,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(t){if(o=o||i(1),!(l.call(_,this)||this instanceof o))return new _(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),f.call(this)}function v(t,e,i,r,n,s,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,i?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function b(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),E(t,e)}function w(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),s=e.corkedRequestsFree;s.entry=i;for(var o=0,h=!0;i;)n[o]=i,i.isBuf||(h=!1),i=i.next,o+=1;n.allBuffers=h,v(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;i;){var u=i.chunk,l=i.encoding,c=i.callback;if(v(t,e,!1,e.objectMode?1:u.length,u,l,c),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final((function(i){e.pendingcb--,i&&t.emit("error",i),e.prefinished=!0,t.emit("prefinish"),E(t,e)}))}function E(t,e){var i=M(e);return i&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,s.nextTick(x,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}u.inherits(_,f),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===_&&t&&t._writableState instanceof g}})):l=function(t){return t instanceof this},_.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},_.prototype.write=function(t,e,i){var r=this._writableState,n=!1,a=!r.objectMode&&function(t){return p.isBuffer(t)||t instanceof d}(t);return a&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(i=e,e=null),a?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof i&&(i=y),r.ended?function(t,e){var i=new Error("write after end");t.emit("error",i),s.nextTick(e,i)}(this,i):(a||function(t,e,i,r){var n=!0,a=!1;return null===i?a=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),s.nextTick(r,a),n=!1),n}(this,r,t,i))&&(r.pendingcb++,n=function(t,e,i,r,n,s){if(!i){var a=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,i)),e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var o=e.objectMode?1:r.length;e.length+=o;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v(t,e,!1,o,r,n,s);return h}(this,r,a,t,e,i)),n},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,i){i(new Error("_write() is not implemented"))},_.prototype._writev=null,_.prototype.end=function(t,e,i){var r=this._writableState;"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,i){e.ending=!0,E(t,e),i&&(e.finished?s.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i)},Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,i(4),i(25).setImmediate,i(0))},function(t,e,i){(function(e,i,r){t.exports=function t(e,i,r){function n(a,o){if(!i[a]){if(!e[a]){var h="function"==typeof _dereq_&&_dereq_;if(!o&&h)return h(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return n(e[a][1][t]||t)}),l,l.exports,t,e,i,r)}return i[a].exports}for(var s="function"==typeof _dereq_&&_dereq_,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(t,e,i){"use strict";e.exports=function(t){var e=t._SomePromiseArray;function i(t){var i=new e(t),r=i.promise();return i.setHowMany(1),i.setUnwrap(),i.init(),r}t.any=function(t){return i(t)},t.prototype.any=function(){return i(this)}}},{}],2:[function(t,i,r){"use strict";var n;try{throw new Error}catch(t){n=t}var s=t("./schedule"),a=t("./queue"),o=t("./util");function h(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new a(16),this._normalQueue=new a(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=s}function u(t,e,i){this._lateQueue.push(t,e,i),this._queueTick()}function l(t,e,i){this._normalQueue.push(t,e,i),this._queueTick()}function c(t){this._normalQueue._pushOne(t),this._queueTick()}h.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},h.prototype.hasCustomScheduler=function(){return this._customScheduler},h.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},h.prototype.disableTrampolineIfNecessary=function(){o.hasDevTools&&(this._trampolineEnabled=!1)},h.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},h.prototype.fatalError=function(t,i){i?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},h.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout((function(){t(e)}),0);else try{this._schedule((function(){t(e)}))}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},o.hasDevTools?(h.prototype.invokeLater=function(t,e,i){this._trampolineEnabled?u.call(this,t,e,i):this._schedule((function(){setTimeout((function(){t.call(e,i)}),100)}))},h.prototype.invoke=function(t,e,i){this._trampolineEnabled?l.call(this,t,e,i):this._schedule((function(){t.call(e,i)}))},h.prototype.settlePromises=function(t){this._trampolineEnabled?c.call(this,t):this._schedule((function(){t._settlePromises()}))}):(h.prototype.invokeLater=u,h.prototype.invoke=l,h.prototype.settlePromises=c),h.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var i=t.shift(),r=t.shift();e.call(i,r)}else e._settlePromises()}},h.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},h.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},h.prototype._reset=function(){this._isTickUsed=!1},i.exports=h,i.exports.firstLineError=n},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,i){"use strict";e.exports=function(t,e,i,r){var n=!1,s=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(s,s,null,this,t)},o=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},h=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(s){n||(n=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var u=i(s),l=new t(e);l._propagateFrom(this,1);var c=this._target();if(l._setBoundTo(u),u instanceof t){var f={promiseRejectionQueued:!1,promise:l,target:c,bindingPromise:u};c._then(e,a,void 0,l,f),u._then(o,h,void 0,l,f),l._setOnCancel(u)}else l._resolveCallback(c);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,i){return t.resolve(i).bind(e)}}},{}],4:[function(t,e,i){"use strict";var r;"undefined"!=typeof Promise&&(r=Promise);var n=t("./promise")();n.noConflict=function(){try{Promise===n&&(Promise=r)}catch(t){}return n},e.exports=n},{"./promise":22}],5:[function(t,e,i){"use strict";var r=Object.create;if(r){var n=r(null),s=r(null);n[" size"]=s[" size"]=0}e.exports=function(e){var i=t("./util"),r=i.canEvaluate;function n(t){return function(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var s="Object "+i.classString(t)+" has no method '"+i.toString(r)+"'";throw new e.TypeError(s)}return n}(t,this.pop()).apply(t,this)}function s(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}i.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=a;else if(r){var i=(void 0)(t);e=null!==i?i:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,i){"use strict";e.exports=function(e,i,r,n){var s=t("./util"),a=s.tryCatch,o=s.errorObj,h=e._async;e.prototype.break=e.prototype.cancel=function(){if(!n.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var i=t._cancellationParent;if(null==i||!i._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=i}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),h.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(s.isArray(t))for(var i=0;i<t.length;++i)this._doInvokeOnCancel(t[i],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=a(t).call(this._boundValue());r===o&&(this._attachExtraTrace(r.e),h.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),h.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,i){"use strict";e.exports=function(e){var i=t("./util"),r=t("./es5").keys,n=i.tryCatch,s=i.errorObj;return function(t,a,o){return function(h){var u=o._boundValue();t:for(var l=0;l<t.length;++l){var c=t[l];if(c===Error||null!=c&&c.prototype instanceof Error){if(h instanceof c)return n(a).call(u,h)}else if("function"==typeof c){var f=n(c).call(u,h);if(f===s)return f;if(f)return n(a).call(u,h)}else if(i.isObject(h)){for(var p=r(c),d=0;d<p.length;++d){var m=p[d];if(c[m]!=h[m])continue t}return n(a).call(u,h)}}return e}}}},{"./es5":13,"./util":36}],8:[function(t,e,i){"use strict";e.exports=function(t){var e=!1,i=[];function r(){this._trace=new r.CapturedTrace(n())}function n(){var t=i.length-1;if(t>=0)return i[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},r.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},r.prototype._popContext=function(){if(void 0!==this._trace){var t=i.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},r.CapturedTrace=null,r.create=function(){if(e)return new r},r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var i=t.prototype._pushContext,s=t.prototype._popContext,a=t._peekContext,o=t.prototype._peekContext,h=t.prototype._promiseCreated;r.deactivateLongStackTraces=function(){t.prototype._pushContext=i,t.prototype._popContext=s,t._peekContext=a,t.prototype._peekContext=o,t.prototype._promiseCreated=h,e=!1},e=!0,t.prototype._pushContext=r.prototype._pushContext,t.prototype._popContext=r.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},r}},{}],9:[function(t,i,r){"use strict";i.exports=function(i,r){var n,s,a,o=i._getDomain,h=i._async,u=t("./errors").Warning,l=t("./util"),c=l.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,p=/\((?:timers\.js):\d+:\d+\)/,d=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,m=null,y=null,g=!1,_=!(0==l.env("BLUEBIRD_DEBUG")),v=!(0==l.env("BLUEBIRD_WARNINGS")||!_&&!l.env("BLUEBIRD_WARNINGS")),b=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!_&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),w=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(v||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));i.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},i.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout((function(){t._notifyUnhandledRejection()}),1)}},i.prototype._notifyUnhandledRejectionIsHandled=function(){G("rejectionHandled",n,void 0,this)},i.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},i.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},i.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),G("unhandledRejection",s,t,this)}},i.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},i.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},i.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},i.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},i.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},i.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},i.prototype._warn=function(t,e,i){return D(t,e,i||this)},i.onPossiblyUnhandledRejection=function(t){var e=o();s="function"==typeof t?null===e?t:l.domainBind(e,t):void 0},i.onUnhandledRejectionHandled=function(t){var e=o();n="function"==typeof t?null===e?t:l.domainBind(e,t):void 0};var M=function(){};i.longStackTraces=function(){if(h.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Y.longStackTraces&&H()){var t=i.prototype._captureStackTrace,e=i.prototype._attachExtraTrace;Y.longStackTraces=!0,M=function(){if(h.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");i.prototype._captureStackTrace=t,i.prototype._attachExtraTrace=e,r.deactivateLongStackTraces(),h.enableTrampoline(),Y.longStackTraces=!1},i.prototype._captureStackTrace=B,i.prototype._attachExtraTrace=F,r.activateLongStackTraces(),h.disableTrampolineIfNecessary()}},i.hasLongStackTraces=function(){return Y.longStackTraces&&H()};var x=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return l.global.dispatchEvent(t),function(t,e){var i=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!l.global.dispatchEvent(i)}}return"function"==typeof Event?(t=new Event("CustomEvent"),l.global.dispatchEvent(t),function(t,e){var i=new Event(t.toLowerCase(),{cancelable:!0});return i.detail=e,!l.global.dispatchEvent(i)}):((t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(t),function(t,e){var i=document.createEvent("CustomEvent");return i.initCustomEvent(t.toLowerCase(),!1,!0,e),!l.global.dispatchEvent(i)})}catch(t){}return function(){return!1}}(),E=l.isNode?function(){return e.emit.apply(e,arguments)}:l.global?function(t){var e="on"+t.toLowerCase(),i=l.global[e];return!!i&&(i.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function k(t,e){return{promise:e}}var C={promiseCreated:k,promiseFulfilled:k,promiseRejected:k,promiseResolved:k,promiseCancelled:k,promiseChained:function(t,e,i){return{promise:e,child:i}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,i){return{reason:e,promise:i}},rejectionHandled:k},S=function(t){var e=!1;try{e=E.apply(null,arguments)}catch(t){h.throwLater(t),e=!0}var i=!1;try{i=x(t,C[t].apply(null,arguments))}catch(t){h.throwLater(t),i=!0}return i||e};function A(){return!1}function P(t,e,i){var r=this;try{t(e,i,(function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+l.toString(t));r._attachCancellationCallback(t)}))}catch(t){return t}}function j(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?l.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function O(){return this._onCancelField}function R(t){this._onCancelField=t}function T(){this._cancellationParent=void 0,this._onCancelField=void 0}function I(t,e){if(0!=(1&e)){this._cancellationParent=t;var i=t._branchesRemainingToCancel;void 0===i&&(i=0),t._branchesRemainingToCancel=i+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}i.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?i.longStackTraces():!t.longStackTraces&&i.hasLongStackTraces()&&M()),"warnings"in t){var e=t.warnings;Y.warnings=!!e,w=Y.warnings,l.isObject(e)&&"wForgottenReturn"in e&&(w=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Y.cancellation){if(h.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");i.prototype._clearCancellationData=T,i.prototype._propagateFrom=I,i.prototype._onCancel=O,i.prototype._setOnCancel=R,i.prototype._attachCancellationCallback=j,i.prototype._execute=P,N=I,Y.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Y.monitoring?(Y.monitoring=!0,i.prototype._fireEvent=S):!t.monitoring&&Y.monitoring&&(Y.monitoring=!1,i.prototype._fireEvent=A)),i},i.prototype._fireEvent=A,i.prototype._execute=function(t,e,i){try{t(e,i)}catch(t){return t}},i.prototype._onCancel=function(){},i.prototype._setOnCancel=function(t){},i.prototype._attachCancellationCallback=function(t){},i.prototype._captureStackTrace=function(){},i.prototype._attachExtraTrace=function(){},i.prototype._clearCancellationData=function(){},i.prototype._propagateFrom=function(t,e){};var N=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function L(){var t=this._boundTo;return void 0!==t&&t instanceof i?t.isFulfilled()?t.value():void 0:t}function B(){this._trace=new Z(this._peekContext())}function F(t,e){if(c(t)){var i=this._trace;if(void 0!==i&&e&&(i=i._parent),void 0!==i)i.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=U(t);l.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),l.notEnumerableProp(t,"__stackCleaned__",!0)}}}function D(t,e,r){if(Y.warnings){var n,s=new u(t);if(e)r._attachExtraTrace(s);else if(Y.longStackTraces&&(n=i._peekContext()))n.attachExtraTrace(s);else{var a=U(s);s.stack=a.message+"\n"+a.stack.join("\n")}S("warning",s)||q(s,"",!0)}}function z(t){for(var e=[],i=0;i<t.length;++i){var r=t[i],n=" (No stack trace)"===r||m.test(r),s=n&&Q(r);n&&!s&&(g&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function U(t){var e=t.stack,i=t.toString();return e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),i=0;i<e.length;++i){var r=e[i];if(" (No stack trace)"===r||m.test(r))break}return i>0&&"SyntaxError"!=t.name&&(e=e.slice(i)),e}(t):[" (No stack trace)"],{message:i,stack:"SyntaxError"==t.name?e:z(e)}}function q(t,e,i){if("undefined"!=typeof console){var r;if(l.isObject(t)){var n=t.stack;r=e+y(n,t)}else r=e+String(t);"function"==typeof a?a(r,i):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function G(t,e,i,r){var n=!1;try{"function"==typeof e&&(n=!0,"rejectionHandled"===t?e(r):e(i,r))}catch(t){h.throwLater(t)}"unhandledRejection"===t?S(t,i,r)||n||q(i,"Unhandled rejection "):S(t,r)}function W(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{if(e=t&&"function"==typeof t.toString?t.toString():l.toString(t),/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){return t.length<41?t:t.substr(0,38)+"..."}(e)+">, no stack trace)"}function H(){return"function"==typeof J}var Q=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function V(t){var e=t.match(X);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function Z(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);J(this,Z),e>32&&this.uncycle()}l.inherits(Z,Error),r.CapturedTrace=Z,Z.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],i={},r=0,n=this;void 0!==n;++r)e.push(n),n=n._parent;for(r=(t=this._length=r)-1;r>=0;--r){var s=e[r].stack;void 0===i[s]&&(i[s]=r)}for(r=0;r<t;++r){var a=i[e[r].stack];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var o=r>0?e[r-1]:this;a<t-1?(o._parent=e[a+1],o._parent.uncycle(),o._length=o._parent._length+1):(o._parent=void 0,o._length=1);for(var h=o._length+1,u=r-2;u>=0;--u)e[u]._length=h,h++;return}}}},Z.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=U(t),i=e.message,r=[e.stack],n=this;void 0!==n;)r.push(z(n.stack.split("\n"))),n=n._parent;!function(t){for(var e=t[0],i=1;i<t.length;++i){for(var r=t[i],n=e.length-1,s=e[n],a=-1,o=r.length-1;o>=0;--o)if(r[o]===s){a=o;break}for(o=a;o>=0;--o){var h=r[o];if(e[n]!==h)break;e.pop(),n--}e=r}}(r),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(r),l.notEnumerableProp(t,"stack",function(t,e){for(var i=0;i<e.length-1;++i)e[i].push("From previous event:"),e[i]=e[i].join("\n");return i<e.length&&(e[i]=e[i].join("\n")),t+"\n"+e.join("\n")}(i,r)),l.notEnumerableProp(t,"__stackCleaned__",!0)}};var J=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():W(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,m=t,y=e;var i=Error.captureStackTrace;return Q=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit+=6,i(t,e),Error.stackTraceLimit-=6}}var r,n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return m=/@/,y=e,g=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){r="stack"in t}return"stack"in n||!r||"number"!=typeof Error.stackTraceLimit?(y=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?W(e):e.toString()},null):(m=t,y=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},l.isNode&&e.stderr.isTTY?a=function(t,e){var i=e?"":"";console.warn(i+t+"\n")}:l.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var Y={warnings:v,longStackTraces:!1,cancellation:!1,monitoring:!1};return b&&i.longStackTraces(),{longStackTraces:function(){return Y.longStackTraces},warnings:function(){return Y.warnings},cancellation:function(){return Y.cancellation},monitoring:function(){return Y.monitoring},propagateFromFunction:function(){return N},boundValueFunction:function(){return L},checkForgottenReturns:function(t,e,i,r,n){if(void 0===t&&null!==e&&w){if(void 0!==n&&n._returnedNonUndefined())return;if(0==(65535&r._bitField))return;i&&(i+=" ");var s="",a="";if(e._trace){for(var o=e._trace.stack.split("\n"),h=z(o),u=h.length-1;u>=0;--u){var l=h[u];if(!p.test(l)){var c=l.match(d);c&&(s="at "+c[1]+":"+c[2]+":"+c[3]+" ");break}}if(h.length>0){var f=h[0];for(u=0;u<o.length;++u)if(o[u]===f){u>0&&(a="\n"+o[u-1]);break}}}var m="a promise was created in a "+i+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(m,!0,e)}},setBounds:function(t,e){if(H()){for(var i,r,n=t.stack.split("\n"),s=e.stack.split("\n"),a=-1,o=-1,h=0;h<n.length;++h)if(u=V(n[h])){i=u.fileName,a=u.line;break}for(h=0;h<s.length;++h){var u;if(u=V(s[h])){r=u.fileName,o=u.line;break}}a<0||o<0||!i||!r||i!==r||a>=o||(Q=function(t){if(f.test(t))return!0;var e=V(t);return!!(e&&e.fileName===i&&a<=e.line&&e.line<=o)})}},warn:D,deprecated:function(t,e){var i=t+" is deprecated and will be removed in a future version.";return e&&(i+=" Use "+e+" instead."),D(i)},CapturedTrace:Z,fireDomEvent:x,fireGlobalEvent:E}}},{"./errors":12,"./util":36}],10:[function(t,e,i){"use strict";e.exports=function(t){function e(){return this.value}function i(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(i){return i instanceof t&&i.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:i},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(i,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,i,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,(function(){throw e}))},t.prototype.catchReturn=function(i){if(arguments.length<=1)return i instanceof t&&i.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:i},void 0);var r=arguments[1];return r instanceof t&&r.suppressUnhandledRejections(),this.caught(i,(function(){return r}))}}},{}],11:[function(t,e,i){"use strict";e.exports=function(t,e){var i=t.reduce,r=t.all;function n(){return r(this)}t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=function(t,r){return i(t,r,e,e)}}},{}],12:[function(t,e,i){"use strict";var r,n,s=t("./es5"),a=s.freeze,o=t("./util"),h=o.inherits,u=o.notEnumerableProp;function l(t,e){function i(r){if(!(this instanceof i))return new i(r);u(this,"message","string"==typeof r?r:e),u(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return h(i,Error),i}var c=l("Warning","warning"),f=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{r=TypeError,n=RangeError}catch(t){r=l("TypeError","type error"),n=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<m.length;++y)"function"==typeof Array.prototype[m[y]]&&(d.prototype[m[y]]=Array.prototype[m[y]]);s.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;function _(t){if(!(this instanceof _))return new _(t);u(this,"name","OperationalError"),u(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(u(this,"message",t.message),u(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var i=0;i<this.length;++i){for(var r=this[i]===this?"[Circular AggregateError]":this[i]+"",n=r.split("\n"),s=0;s<n.length;++s)n[s]=t+n[s];e+=(r=n.join("\n"))+"\n"}return g--,e},h(_,Error);var v=Error.__BluebirdErrorTypes__;v||(v=a({CancellationError:f,TimeoutError:p,OperationalError:_,RejectionError:_,AggregateError:d}),s.defineProperty(Error,"__BluebirdErrorTypes__",{value:v,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:r,RangeError:n,CancellationError:v.CancellationError,OperationalError:v.OperationalError,TimeoutError:v.TimeoutError,AggregateError:v.AggregateError,Warning:c}},{"./es5":13,"./util":36}],13:[function(t,e,i){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!(i&&!i.writable&&!i.set)}};else{var n={}.hasOwnProperty,s={}.toString,a={}.constructor.prototype,o=function(t){var e=[];for(var i in t)n.call(t,i)&&e.push(i);return e};e.exports={isArray:function(t){try{return"[object Array]"===s.call(t)}catch(t){return!1}},keys:o,names:o,defineProperty:function(t,e,i){return t[e]=i.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return a}},isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,i){"use strict";e.exports=function(t,e){var i=t.map;t.prototype.filter=function(t,r){return i(this,t,r,e)},t.filter=function(t,r,n){return i(t,r,n,e)}}},{}],15:[function(t,e,i){"use strict";e.exports=function(e,i,r){var n=t("./util"),s=e.CancellationError,a=n.errorObj,o=t("./catch_filter")(r);function h(t,e,i){this.promise=t,this.type=e,this.handler=i,this.called=!1,this.cancelPromise=null}function u(t){this.finallyHandler=t}function l(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function c(){return p.call(this,this.promise._target()._settledValue())}function f(t){if(!l(this,t))return a.e=t,a}function p(t){var n=this.promise,o=this.handler;if(!this.called){this.called=!0;var h=this.isFinallyHandler()?o.call(n._boundValue()):o.call(n._boundValue(),t);if(h===r)return h;if(void 0!==h){n._setReturnedNonUndefined();var p=i(h,n);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new s("late cancellation observer");return n._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(c,f,void 0,this,void 0)}}}return n.isRejected()?(l(this),a.e=t,a):(l(this),t)}return h.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},e.prototype._passThrough=function(t,e,i,r){return"function"!=typeof t?this.then():this._then(i,r,void 0,new h(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,p,p)},e.prototype.tap=function(t){return this._passThrough(t,1,p)},e.prototype.tapCatch=function(t){var i=arguments.length;if(1===i)return this._passThrough(t,1,void 0,p);var r,s=new Array(i-1),a=0;for(r=0;r<i-1;++r){var h=arguments[r];if(!n.isObject(h))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+n.classString(h)));s[a++]=h}s.length=a;var u=arguments[r];return this._passThrough(o(s,u,this),1,void 0,p)},h}},{"./catch_filter":7,"./util":36}],16:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s,a){var o=t("./errors").TypeError,h=t("./util"),u=h.errorObj,l=h.tryCatch,c=[];function f(t,i,n,s){if(a.cancellation()){var o=new e(r),h=this._finallyPromise=new e(r);this._promise=o.lastly((function(){return h})),o._captureStackTrace(),o._setOnCancel(this)}else(this._promise=new e(r))._captureStackTrace();this._stack=s,this._generatorFunction=t,this._receiver=i,this._generator=void 0,this._yieldHandlers="function"==typeof n?[n].concat(c):c,this._yieldedPromise=null,this._cancellationPhase=!1}h.inherits(f,s),f.prototype._isResolved=function(){return null===this._promise},f.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},f.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var i=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=i,this._promise._attachExtraTrace(i),this._promise._pushContext(),t=l(this._generator.throw).call(this._generator,i),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},f.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=l(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},f.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=l(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},f.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},f.prototype.promise=function(){return this._promise},f.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},f.prototype._continue=function(t){var i=this._promise;if(t===u)return this._cleanup(),this._cancellationPhase?i.cancel():i._rejectCallback(t.e,!1);var r=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?i.cancel():i._resolveCallback(r);var s=n(r,this._promise);if(s instanceof e||null!==(s=function(t,i,r){for(var s=0;s<i.length;++s){r._pushContext();var a=l(i[s])(t);if(r._popContext(),a===u){r._pushContext();var o=e.reject(u.e);return r._popContext(),o}var h=n(a,r);if(h instanceof e)return h}return null}(s,this._yieldHandlers,this._promise))){var a=(s=s._target())._bitField;0==(50397184&a)?(this._yieldedPromise=s,s._proxy(this,null)):0!=(33554432&a)?e._async.invoke(this._promiseFulfilled,this,s._value()):0!=(16777216&a)?e._async.invoke(this._promiseRejected,this,s._reason()):this._promiseCancelled()}else this._promiseRejected(new o("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(t,e){if("function"!=typeof t)throw new o("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var i=Object(e).yieldHandler,r=f,n=(new Error).stack;return function(){var e=t.apply(this,arguments),s=new r(void 0,void 0,i,n),a=s.promise();return s._generator=e,s._promiseFulfilled(void 0),a}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new o("expecting a function but got "+h.classString(t));c.push(t)},e.spawn=function(t){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return i("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new f(t,this),n=r.promise();return r._run(e.spawn),n}}},{"./errors":12,"./util":36}],17:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s,a){var o=t("./util");o.canEvaluate,o.tryCatch,o.errorObj,e.join=function(){var t,e=arguments.length-1;e>0&&"function"==typeof arguments[e]&&(t=arguments[e]);var r=[].slice.call(arguments);t&&r.pop();var n=new i(r).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s,a){var o=e._getDomain,h=t("./util"),u=h.tryCatch,l=h.errorObj,c=e._async;function f(t,e,i,r){this.constructor$(t),this._promise._captureStackTrace();var n=o();this._callback=null===n?e:h.domainBind(n,e),this._preservedValues=r===s?new Array(this.length()):null,this._limit=i,this._inFlight=0,this._queue=[],c.invoke(this._asyncInit,this,void 0)}function p(t,i,n,s){if("function"!=typeof i)return r("expecting a function but got "+h.classString(i));var a=0;if(void 0!==n){if("object"!=typeof n||null===n)return e.reject(new TypeError("options argument must be an object but it is "+h.classString(n)));if("number"!=typeof n.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+h.classString(n.concurrency)));a=n.concurrency}return new f(t,i,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,s).promise()}h.inherits(f,i),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(t,i){var r=this._values,s=this.length(),o=this._preservedValues,h=this._limit;if(i<0){if(r[i=-1*i-1]=t,h>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(h>=1&&this._inFlight>=h)return r[i]=t,this._queue.push(i),!1;null!==o&&(o[i]=t);var c=this._promise,f=this._callback,p=c._boundValue();c._pushContext();var d=u(f).call(p,t,i,s),m=c._popContext();if(a.checkForgottenReturns(d,m,null!==o?"Promise.filter":"Promise.map",c),d===l)return this._reject(d.e),!0;var y=n(d,this._promise);if(y instanceof e){var g=(y=y._target())._bitField;if(0==(50397184&g))return h>=1&&this._inFlight++,r[i]=y,y._proxy(this,-1*(i+1)),!1;if(0==(33554432&g))return 0!=(16777216&g)?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}r[i]=d}return++this._totalResolved>=s&&(null!==o?this._filter(r,o):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,i=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(i[r],r)}},f.prototype._filter=function(t,e){for(var i=e.length,r=new Array(i),n=0,s=0;s<i;++s)t[s]&&(r[n++]=e[s]);r.length=n,this._resolve(r)},f.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return p(this,t,e,null)},e.map=function(t,e,i,r){return p(t,e,i,r)}}},{"./util":36}],19:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s){var a=t("./util"),o=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(i);r._captureStackTrace(),r._pushContext();var n=o(t).apply(this,arguments),a=r._popContext();return s.checkForgottenReturns(n,a,"Promise.method",r),r._resolveFromSyncValue(n),r}},e.attempt=e.try=function(t){if("function"!=typeof t)return n("expecting a function but got "+a.classString(t));var r,h=new e(i);if(h._captureStackTrace(),h._pushContext(),arguments.length>1){s.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];r=a.isArray(u)?o(t).apply(l,u):o(t).call(l,u)}else r=o(t)();var c=h._popContext();return s.checkForgottenReturns(r,c,"Promise.try",h),h._resolveFromSyncValue(r),h},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,i){"use strict";var r=t("./util"),n=r.maybeWrapAsError,s=t("./errors").OperationalError,a=t("./es5"),o=/^(?:name|message|stack|cause)$/;function h(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new s(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var i=a.keys(t),n=0;n<i.length;++n){var h=i[n];o.test(h)||(e[h]=t[h])}return e}return r.markAsOriginatingFromRejection(t),t}e.exports=function(t,e){return function(i,r){if(null!==t){if(i){var s=h(n(i));t._attachExtraTrace(s),t._reject(s)}else if(e){var a=[].slice.call(arguments,1);t._fulfill(a)}else t._fulfill(r);t=null}}}},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,i){"use strict";e.exports=function(e){var i=t("./util"),r=e._async,n=i.tryCatch,s=i.errorObj;function a(t,e){if(!i.isArray(t))return o.call(this,t,e);var a=n(e).apply(this._boundValue(),[null].concat(t));a===s&&r.throwLater(a.e)}function o(t,e){var i=this._boundValue(),a=void 0===t?n(e).call(i,null):n(e).call(i,null,t);a===s&&r.throwLater(a.e)}function h(t,e){if(!t){var i=new Error(t+"");i.cause=t,t=i}var a=n(e).call(this._boundValue(),t);a===s&&r.throwLater(a.e)}e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var i=o;void 0!==e&&Object(e).spread&&(i=a),this._then(i,h,void 0,this,t)}return this}}},{"./util":36}],22:[function(t,i,r){"use strict";i.exports=function(){var r=function(){return new d("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new P.PromiseInspection(this._target())},s=function(t){return P.reject(new d(t))};function a(){}var o,h={},u=t("./util");o=u.isNode?function(){var t=e.domain;return void 0===t&&(t=null),t}:function(){return null},u.notEnumerableProp(P,"_getDomain",o);var l=t("./es5"),c=t("./async"),f=new c;l.defineProperty(P,"_async",{value:f});var p=t("./errors"),d=P.TypeError=p.TypeError;P.RangeError=p.RangeError;var m=P.CancellationError=p.CancellationError;P.TimeoutError=p.TimeoutError,P.OperationalError=p.OperationalError,P.RejectionError=p.OperationalError,P.AggregateError=p.AggregateError;var y=function(){},g={},_={},v=t("./thenables")(P,y),b=t("./promise_array")(P,y,v,s,a),w=t("./context")(P),M=w.create,x=t("./debuggability")(P,w),E=(x.CapturedTrace,t("./finally")(P,v,_)),k=t("./catch_filter")(_),C=t("./nodeback"),S=u.errorObj,A=u.tryCatch;function P(t){t!==y&&function(t,e){if(null==t||t.constructor!==P)throw new d("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new d("expecting a function but got "+u.classString(e))}(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function j(t){this.promise._resolveCallback(t)}function O(t){this.promise._rejectCallback(t,!1)}function R(t){var e=new P(y);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return P.prototype.toString=function(){return"[object Promise]"},P.prototype.caught=P.prototype.catch=function(t){var e=arguments.length;if(e>1){var i,r=new Array(e-1),n=0;for(i=0;i<e-1;++i){var a=arguments[i];if(!u.isObject(a))return s("Catch statement predicate: expecting an object but got "+u.classString(a));r[n++]=a}return r.length=n,t=arguments[i],this.then(void 0,k(r,t,this))}return this.then(void 0,t)},P.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},P.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var i=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(i+=", "+u.classString(e)),this._warn(i)}return this._then(t,e,void 0,void 0,void 0)},P.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},P.prototype.spread=function(t){return"function"!=typeof t?s("expecting a function but got "+u.classString(t)):this.all()._then(t,void 0,void 0,g,void 0)},P.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},P.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},P.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},P.getNewLibraryCopy=i.exports,P.is=function(t){return t instanceof P},P.fromNode=P.fromCallback=function(t){var e=new P(y);e._captureStackTrace();var i=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=A(t)(C(e,i));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},P.all=function(t){return new b(t).promise()},P.cast=function(t){var e=v(t);return e instanceof P||((e=new P(y))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},P.resolve=P.fulfilled=P.cast,P.reject=P.rejected=function(t){var e=new P(y);return e._captureStackTrace(),e._rejectCallback(t,!0),e},P.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+u.classString(t));return f.setScheduler(t)},P.prototype._then=function(t,e,i,r,n){var s=void 0!==n,a=s?n:new P(y),h=this._target(),l=h._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&l)?this._boundValue():h===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var c=o();if(0!=(50397184&l)){var p,d,g=h._settlePromiseCtx;0!=(33554432&l)?(d=h._rejectionHandler0,p=t):0!=(16777216&l)?(d=h._fulfillmentHandler0,p=e,h._unsetRejectionIsUnhandled()):(g=h._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),h._attachExtraTrace(d),p=e),f.invoke(g,h,{handler:null===c?p:"function"==typeof p&&u.domainBind(c,p),promise:a,receiver:r,value:d})}else h._addCallbacks(t,e,a,r,c);return a},P.prototype._length=function(){return 65535&this._bitField},P.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},P.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},P.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},P.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},P.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},P.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},P.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},P.prototype._isFinal=function(){return(4194304&this._bitField)>0},P.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},P.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},P.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},P.prototype._setAsyncGuaranteed=function(){f.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},P.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==h)return void 0===e&&this._isBound()?this._boundValue():e},P.prototype._promiseAt=function(t){return this[4*t-4+2]},P.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},P.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},P.prototype._boundValue=function(){},P.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,i=t._rejectionHandler0,r=t._promise0,n=t._receiverAt(0);void 0===n&&(n=h),this._addCallbacks(e,i,r,n,null)},P.prototype._migrateCallbackAt=function(t,e){var i=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),n=t._promiseAt(e),s=t._receiverAt(e);void 0===s&&(s=h),this._addCallbacks(i,r,n,s,null)},P.prototype._addCallbacks=function(t,e,i,r,n){var s=this._length();if(s>=65531&&(s=0,this._setLength(0)),0===s)this._promise0=i,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===n?t:u.domainBind(n,t)),"function"==typeof e&&(this._rejectionHandler0=null===n?e:u.domainBind(n,e));else{var a=4*s-4;this[a+2]=i,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===n?t:u.domainBind(n,t)),"function"==typeof e&&(this[a+1]=null===n?e:u.domainBind(n,e))}return this._setLength(s+1),s},P.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},P.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(r(),!1);var i=v(t,this);if(!(i instanceof P))return this._fulfill(t);e&&this._propagateFrom(i,2);var n=i._target();if(n!==this){var s=n._bitField;if(0==(50397184&s)){var a=this._length();a>0&&n._migrateCallback0(this);for(var o=1;o<a;++o)n._migrateCallbackAt(this,o);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!=(33554432&s))this._fulfill(n._value());else if(0!=(16777216&s))this._reject(n._reason());else{var h=new m("late cancellation observer");n._attachExtraTrace(h),this._reject(h)}}else this._reject(r())}},P.prototype._rejectCallback=function(t,e,i){var r=u.ensureErrorObject(t),n=r===t;if(!n&&!i&&x.warnings()){var s="a promise was rejected with a non-error: "+u.classString(t);this._warn(s,!0)}this._attachExtraTrace(r,!!e&&n),this._reject(t)},P.prototype._resolveFromExecutor=function(t){if(t!==y){var e=this;this._captureStackTrace(),this._pushContext();var i=!0,r=this._execute(t,(function(t){e._resolveCallback(t)}),(function(t){e._rejectCallback(t,i)}));i=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},P.prototype._settlePromiseFromHandler=function(t,e,i,r){var n=r._bitField;if(0==(65536&n)){var s;r._pushContext(),e===g?i&&"number"==typeof i.length?s=A(t).apply(this._boundValue(),i):(s=S).e=new d("cannot .spread() a non-array: "+u.classString(i)):s=A(t).call(e,i);var a=r._popContext();0==(65536&(n=r._bitField))&&(s===_?r._reject(i):s===S?r._rejectCallback(s.e,!1):(x.checkForgottenReturns(s,a,"",r,this),r._resolveCallback(s)))}},P.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},P.prototype._followee=function(){return this._rejectionHandler0},P.prototype._setFollowee=function(t){this._rejectionHandler0=t},P.prototype._settlePromise=function(t,e,i,r){var s=t instanceof P,o=this._bitField,h=0!=(134217728&o);0!=(65536&o)?(s&&t._invokeInternalOnCancel(),i instanceof E&&i.isFinallyHandler()?(i.cancelPromise=t,A(e).call(i,r)===S&&t._reject(S.e)):e===n?t._fulfill(n.call(i)):i instanceof a?i._promiseCancelled(t):s||t instanceof b?t._cancel():i.cancel()):"function"==typeof e?s?(h&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,i,r,t)):e.call(i,r,t):i instanceof a?i._isResolved()||(0!=(33554432&o)?i._promiseFulfilled(r,t):i._promiseRejected(r,t)):s&&(h&&t._setAsyncGuaranteed(),0!=(33554432&o)?t._fulfill(r):t._reject(r))},P.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,i=t.promise,r=t.receiver,n=t.value;"function"==typeof e?i instanceof P?this._settlePromiseFromHandler(e,r,n,i):e.call(r,n,i):i instanceof P&&i._reject(n)},P.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},P.prototype._settlePromise0=function(t,e,i){var r=this._promise0,n=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,n,e)},P.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},P.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var i=r();return this._attachExtraTrace(i),this._reject(i)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():f.settlePromises(this))}},P.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return f.fatalError(t,u.isNode);(65535&e)>0?f.settlePromises(this):this._ensurePossibleRejectionHandled()}},P.prototype._fulfillPromises=function(t,e){for(var i=1;i<t;i++){var r=this._fulfillmentHandlerAt(i),n=this._promiseAt(i),s=this._receiverAt(i);this._clearCallbackDataAtIndex(i),this._settlePromise(n,r,s,e)}},P.prototype._rejectPromises=function(t,e){for(var i=1;i<t;i++){var r=this._rejectionHandlerAt(i),n=this._promiseAt(i),s=this._receiverAt(i);this._clearCallbackDataAtIndex(i),this._settlePromise(n,r,s,e)}},P.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var i=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,i,t),this._rejectPromises(e,i)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},P.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},P.defer=P.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new P(y),resolve:j,reject:O}},u.notEnumerableProp(P,"_makeSelfResolutionError",r),t("./method")(P,y,v,s,x),t("./bind")(P,y,v,x),t("./cancel")(P,b,s,x),t("./direct_resolve")(P),t("./synchronous_inspection")(P),t("./join")(P,b,v,y,f,o),P.Promise=P,P.version="3.5.1",t("./map.js")(P,b,s,v,y,x),t("./call_get.js")(P),t("./using.js")(P,s,v,M,y,x),t("./timers.js")(P,y,x),t("./generators.js")(P,s,y,v,a,x),t("./nodeify.js")(P),t("./promisify.js")(P,y),t("./props.js")(P,b,v,s),t("./race.js")(P,y,v,s),t("./reduce.js")(P,b,s,v,y,x),t("./settle.js")(P,b,x),t("./some.js")(P,b,s),t("./filter.js")(P,y),t("./each.js")(P,y),t("./any.js")(P),u.toFastProperties(P),u.toFastProperties(P.prototype),R({a:1}),R({b:2}),R({c:3}),R(1),R((function(){})),R(void 0),R(!1),R(new P(y)),x.setBounds(c.firstLineError,u.lastLineError),P}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s){var a=t("./util");function o(t){var r=this._promise=new e(i);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.isArray,a.inherits(o,s),o.prototype.length=function(){return this._length},o.prototype.promise=function(){return this._promise},o.prototype._init=function t(i,s){var o=r(this._values,this._promise);if(o instanceof e){var h=(o=o._target())._bitField;if(this._values=o,0==(50397184&h))return this._promise._setAsyncGuaranteed(),o._then(t,this._reject,void 0,this,s);if(0==(33554432&h))return 0!=(16777216&h)?this._reject(o._reason()):this._cancel();o=o._value()}if(null!==(o=a.asArray(o)))0!==o.length?this._iterate(o):-5===s?this._resolveEmptyArray():this._resolve(function(t){switch(s){case-2:return[];case-3:return{};case-6:return new Map}}());else{var u=n("expecting an array or an iterable object but got "+a.classString(o)).reason();this._promise._rejectCallback(u,!1)}},o.prototype._iterate=function(t){var i=this.getActualLength(t.length);this._length=i,this._values=this.shouldCopyValues()?new Array(i):this._values;for(var n=this._promise,s=!1,a=null,o=0;o<i;++o){var h=r(t[o],n);a=h instanceof e?(h=h._target())._bitField:null,s?null!==a&&h.suppressUnhandledRejections():null!==a?0==(50397184&a)?(h._proxy(this,o),this._values[o]=h):s=0!=(33554432&a)?this._promiseFulfilled(h._value(),o):0!=(16777216&a)?this._promiseRejected(h._reason(),o):this._promiseCancelled(o):s=this._promiseFulfilled(h,o)}s||n._setAsyncGuaranteed()},o.prototype._isResolved=function(){return null===this._values},o.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},o.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},o.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},o.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseCancelled=function(){return this._cancel(),!0},o.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},o.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var i=0;i<t.length;++i)t[i]instanceof e&&t[i].cancel()}},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(t){return t},o}},{"./util":36}],24:[function(t,e,i){"use strict";e.exports=function(e,i){var r={},n=t("./util"),s=t("./nodeback"),a=n.withAppended,o=n.maybeWrapAsError,h=n.canEvaluate,u=t("./errors").TypeError,l={__isPromisified__:!0},c=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),f=function(t){return n.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function p(t){return!c.test(t)}function d(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function m(t,e,i){var r=n.getDataPropertyOrDefault(t,e+i,l);return!!r&&d(r)}function y(t,e,i,r){for(var s=n.inheritedDataKeys(t),a=[],o=0;o<s.length;++o){var h=s[o],l=t[h],c=r===f||f(h,l,t);"function"!=typeof l||d(l)||m(t,h,e)||!r(h,l,t,c)||a.push(h,l)}return function(t,e,i){for(var r=0;r<t.length;r+=2){var n=t[r];if(i.test(n))for(var s=n.replace(i,""),a=0;a<t.length;a+=2)if(t[a]===s)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}(a,e,i),a}var g=h?void 0:function(t,h,u,l,c,f){var p=function(){return this}(),d=t;function m(){var n=h;h===r&&(n=this);var u=new e(i);u._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:t,c=s(u,f);try{l.apply(n,a(arguments,c))}catch(t){u._rejectCallback(o(t),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(t=l),n.notEnumerableProp(m,"__isPromisified__",!0),m};function _(t,e,i,s,a){for(var o=new RegExp(function(t){return t.replace(/([$])/,"\\$")}(e)+"$"),h=y(t,e,o,i),u=0,l=h.length;u<l;u+=2){var c=h[u],f=h[u+1],p=c+e;if(s===g)t[p]=g(c,r,c,f,e,a);else{var d=s(f,(function(){return g(c,r,c,f,e,a)}));n.notEnumerableProp(d,"__isPromisified__",!0),t[p]=d}}return n.toFastProperties(t),t}e.promisify=function(t,e){if("function"!=typeof t)throw new u("expecting a function but got "+n.classString(t));if(d(t))return t;var i=void 0===(e=Object(e)).context?r:e.context,s=!!e.multiArgs,a=function(t,e,i){return g(t,e,void 0,t,null,s)}(t,i);return n.copyDescriptors(t,a,p),a},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var i=!!(e=Object(e)).multiArgs,r=e.suffix;"string"!=typeof r&&(r="Async");var s=e.filter;"function"!=typeof s&&(s=f);var a=e.promisifier;if("function"!=typeof a&&(a=g),!n.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var o=n.inheritedDataKeys(t),h=0;h<o.length;++h){var l=t[o[h]];"constructor"!==o[h]&&n.isClass(l)&&(_(l.prototype,r,s,a,i),_(l,r,s,a,i))}return _(t,r,s,a,i)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,i){"use strict";e.exports=function(e,i,r,n){var s,a=t("./util"),o=a.isObject,h=t("./es5");"function"==typeof Map&&(s=Map);var u=function(){var t=0,e=0;function i(i,r){this[t]=i,this[t+e]=r,t++}return function(r){e=r.size,t=0;var n=new Array(2*r.size);return r.forEach(i,n),n}}();function l(t){var e,i=!1;if(void 0!==s&&t instanceof s)e=u(t),i=!0;else{var r=h.keys(t),n=r.length;e=new Array(2*n);for(var a=0;a<n;++a){var o=r[a];e[a]=t[o],e[a+n]=o}}this.constructor$(e),this._isMap=i,this._init$(void 0,i?-6:-3)}function c(t){var i,s=r(t);return o(s)?(i=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new l(s).promise(),s instanceof e&&i._propagateFrom(s,2),i):n("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,i),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var i;if(this._isMap)i=function(t){for(var e=new s,i=t.length/2|0,r=0;r<i;++r){var n=t[i+r],a=t[r];e.set(n,a)}return e}(this._values);else{i={};for(var r=this.length(),n=0,a=this.length();n<a;++n)i[this._values[n+r]]=this._values[n]}return this._resolve(i),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return c(this)},e.props=function(t){return c(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,i){"use strict";function r(t){this._capacity=t,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(t){return this._capacity<t},r.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},r.prototype.push=function(t,e,i){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(i);var n=this._front+r-3;this._checkCapacity(r);var s=this._capacity-1;this[n+0&s]=t,this[n+1&s]=e,this[n+2&s]=i,this._length=r},r.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},r.prototype.length=function(){return this._length},r.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},r.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,i,r,n){for(var s=0;s<n;++s)i[s+r]=t[s+0],t[s+0]=void 0}(this,0,this,e,this._front+this._length&e-1)},e.exports=r},{}],27:[function(t,e,i){"use strict";e.exports=function(e,i,r,n){var s=t("./util"),a=function(t){return t.then((function(e){return o(e,t)}))};function o(t,o){var h=r(t);if(h instanceof e)return a(h);if(null===(t=s.asArray(t)))return n("expecting an array or an iterable object but got "+s.classString(t));var u=new e(i);void 0!==o&&u._propagateFrom(o,3);for(var l=u._fulfill,c=u._reject,f=0,p=t.length;f<p;++f){var d=t[f];(void 0!==d||f in t)&&e.cast(d)._then(l,c,void 0,u,null)}return u}e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s,a){var o=e._getDomain,h=t("./util"),u=h.tryCatch;function l(t,i,r,n){this.constructor$(t);var a=o();this._fn=null===a?i:h.domainBind(a,i),void 0!==r&&(r=e.resolve(r))._attachCancellationCallback(this),this._initialValue=r,this._currentCancellable=null,this._eachValues=n===s?Array(this._length):0===n?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function f(t,e,i,n){return"function"!=typeof e?r("expecting a function but got "+h.classString(e)):new l(t,e,i,n).promise()}function p(t){this.accum=t,this.array._gotAccum(t);var i=n(this.value,this.array._promise);return i instanceof e?(this.array._currentCancellable=i,i._then(d,void 0,void 0,this,void 0)):d.call(this,i)}function d(t){var i,r=this.array,n=r._promise,s=u(r._fn);n._pushContext(),(i=void 0!==r._eachValues?s.call(n._boundValue(),t,this.index,this.length):s.call(n._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(r._currentCancellable=i);var o=n._popContext();return a.checkForgottenReturns(i,o,void 0!==r._eachValues?"Promise.each":"Promise.reduce",n),i}h.inherits(l,i),l.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==s&&this._eachValues.push(t)},l.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},l.prototype._init=function(){},l.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},l.prototype.shouldCopyValues=function(){return!1},l.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},l.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},l.prototype._iterate=function(t){var i,r;this._values=t;var n=t.length;if(void 0!==this._initialValue?(i=this._initialValue,r=0):(i=e.resolve(t[0]),r=1),this._currentCancellable=i,!i.isRejected())for(;r<n;++r){var s={accum:null,value:t[r],index:r,length:n,array:this};i=i._then(p,void 0,void 0,s,void 0)}void 0!==this._eachValues&&(i=i._then(this._eachComplete,void 0,void 0,this,void 0)),i._then(c,c,void 0,i,this)},e.prototype.reduce=function(t,e){return f(this,t,e,null)},e.reduce=function(t,e,i,r){return f(t,e,i,r)}}},{"./util":36}],29:[function(t,n,s){"use strict";var a,o=t("./util"),h=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var u=i.setImmediate,l=e.nextTick;a=o.isRecentNode?function(t){u.call(i,t)}:function(t){l.call(e,t)}}else if("function"==typeof h&&"function"==typeof h.resolve){var c=h.resolve();a=function(t){c.then(t)}}else a="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?void 0!==r?function(t){r(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var t=document.createElement("div"),e={attributes:!0},i=!1,r=document.createElement("div");return new MutationObserver((function(){t.classList.toggle("foo"),i=!1})).observe(r,e),function(n){var s=new MutationObserver((function(){s.disconnect(),n()}));s.observe(t,e),i||(i=!0,r.classList.toggle("foo"))}}();n.exports=a},{"./util":36}],30:[function(t,e,i){"use strict";e.exports=function(e,i,r){var n=e.PromiseInspection;function s(t){this.constructor$(t)}t("./util").inherits(s,i),s.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseFulfilled=function(t,e){var i=new n;return i._bitField=33554432,i._settledValueField=t,this._promiseResolved(e,i)},s.prototype._promiseRejected=function(t,e){var i=new n;return i._bitField=16777216,i._settledValueField=t,this._promiseResolved(e,i)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new s(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,i){"use strict";e.exports=function(e,i,r){var n=t("./util"),s=t("./errors").RangeError,a=t("./errors").AggregateError,o=n.isArray,h={};function u(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(t,e){if((0|e)!==e||e<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var i=new u(t),n=i.promise();return i.setHowMany(e),i.init(),n}n.inherits(u,i),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=o(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(t){this._howMany=t},u.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(h),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e<this._values.length;++e)this._values[e]!==h&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(t){this._values.push(t)},u.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return l(t,e)},e.prototype.some=function(t){return l(this,t)},e._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(t,e,i){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var i=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},s=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},o=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return s.call(this._target())},t.prototype.isFulfilled=function(){return n.call(this._target())},t.prototype.isResolved=function(){return o.call(this._target())},t.prototype.value=function(){return i.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,i){"use strict";e.exports=function(e,i){var r=t("./util"),n=r.errorObj,s=r.isObject,a={}.hasOwnProperty;return function(t,o){if(s(t)){if(t instanceof e)return t;var h=function(t){try{return function(t){return t.then}(t)}catch(t){return n.e=t,n}}(t);if(h===n){o&&o._pushContext();var u=e.reject(h.e);return o&&o._popContext(),u}if("function"==typeof h)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(u=new e(i),t._then(u._fulfill,u._reject,void 0,u,null),u):function(t,s,a){var o=new e(i),h=o;a&&a._pushContext(),o._captureStackTrace(),a&&a._popContext();var u=!0,l=r.tryCatch(s).call(t,(function(t){o&&(o._resolveCallback(t),o=null)}),(function(t){o&&(o._rejectCallback(t,u,!0),o=null)}));return u=!1,o&&l===n&&(o._rejectCallback(l.e,!0,!0),o=null),h}(t,h,o)}return t}}},{"./util":36}],34:[function(t,e,i){"use strict";e.exports=function(e,i,r){var n=t("./util"),s=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var o=function(t){return h(+this).thenReturn(t)},h=e.delay=function(t,n){var s,h;return void 0!==n?(s=e.resolve(n)._then(o,null,null,t,void 0),r.cancellation()&&n instanceof e&&s._setOnCancel(n)):(s=new e(i),h=setTimeout((function(){s._fulfill()}),+t),r.cancellation()&&s._setOnCancel(new a(h)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};function u(t){return clearTimeout(this.handle),t}function l(t){throw clearTimeout(this.handle),t}e.prototype.delay=function(t){return h(t,this)},e.prototype.timeout=function(t,e){var i,o;t=+t;var h=new a(setTimeout((function(){i.isPending()&&function(t,e,i){var r;r="string"!=typeof e?e instanceof Error?e:new s("operation timed out"):new s(e),n.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=i&&i.cancel()}(i,e,o)}),t));return r.cancellation()?(o=this.then(),(i=o._then(u,l,void 0,h,void 0))._setOnCancel(h)):i=this._then(u,l,void 0,h,void 0),i}}},{"./util":36}],35:[function(t,e,i){"use strict";e.exports=function(e,i,r,n,s,a){var o=t("./util"),h=t("./errors").TypeError,u=t("./util").inherits,l=o.errorObj,c=o.tryCatch,f={};function p(t){setTimeout((function(){throw t}),0)}function d(t,i){var n=0,a=t.length,o=new e(s);return function s(){if(n>=a)return o._fulfill();var h=function(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[n++]);if(h instanceof e&&h._isDisposable()){try{h=r(h._getDisposer().tryDispose(i),t.promise)}catch(t){return p(t)}if(h instanceof e)return h._then(s,p,null,null,null)}s()}(),o}function m(t,e,i){this._data=t,this._promise=e,this._context=i}function y(t,e,i){this.constructor$(t,e,i)}function g(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(t){var e=this.resource(),i=this._context;void 0!==i&&i._pushContext();var r=e!==f?this.doDispose(e,t):null;return void 0!==i&&i._popContext(),this._promise._unsetDisposable(),this._data=null,r},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},u(y,m),y.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,i=0;i<t;++i){var r=this[i];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(t<2)return i("you must pass at least 2 arguments to Promise.using");var n,s=arguments[t-1];if("function"!=typeof s)return i("expecting a function but got "+o.classString(s));var h=!0;2===t&&Array.isArray(arguments[0])?(t=(n=arguments[0]).length,h=!1):(n=arguments,t--);for(var u=new _(t),f=0;f<t;++f){var p=n[f];if(m.isDisposer(p)){var y=p;(p=p.promise())._setDisposable(y)}else{var v=r(p);v instanceof e&&(p=v._then(g,null,null,{resources:u,index:f},void 0))}u[f]=p}var b=new Array(u.length);for(f=0;f<b.length;++f)b[f]=e.resolve(u[f]).reflect();var w=e.all(b).then((function(t){for(var e=0;e<t.length;++e){var i=t[e];if(i.isRejected())return l.e=i.error(),l;if(!i.isFulfilled())return void w.cancel();t[e]=i.value()}M._pushContext(),s=c(s);var r=h?s.apply(void 0,t):s(t),n=M._popContext();return a.checkForgottenReturns(r,n,"Promise.using",M),r})),M=w.lastly((function(){var t=new e.PromiseInspection(w);return d(u,t)}));return u.promise=M,M._setOnCancel(u),M},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new y(t,this,n());throw new h}}},{"./errors":12,"./util":36}],36:[function(t,r,n){"use strict";var s,a=t("./es5"),o="undefined"==typeof navigator,h={e:{}},u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:void 0!==this?this:null;function l(){try{var t=s;return s=null,t.apply(this,arguments)}catch(t){return h.e=t,h}}function c(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function f(t,e,i){if(c(t))return t;var r={value:i,configurable:!0,enumerable:!1,writable:!0};return a.defineProperty(t,e,r),t}var p=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var i=0;i<t.length;++i)if(t[i]===e)return!0;return!1};if(a.isES5){var i=Object.getOwnPropertyNames;return function(t){for(var r=[],n=Object.create(null);null!=t&&!e(t);){var s;try{s=i(t)}catch(t){return r}for(var o=0;o<s.length;++o){var h=s[o];if(!n[h]){n[h]=!0;var u=Object.getOwnPropertyDescriptor(t,h);null!=u&&null==u.get&&null==u.set&&r.push(h)}}t=a.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(i){if(e(i))return[];var n=[];t:for(var s in i)if(r.call(i,s))n.push(s);else{for(var a=0;a<t.length;++a)if(r.call(t[a],s))continue t;n.push(s)}return n}}(),d=/this\s*\.\s*\S+\s*=/,m=/^[a-z$_][a-z$_0-9]*$/i;function y(t){try{return t+""}catch(t){return"[no string representation]"}}function g(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function _(t){return g(t)&&a.propertyIsWritable(t,"stack")}var v="stack"in new Error?function(t){return _(t)?t:new Error(y(t))}:function(t){if(_(t))return t;try{throw new Error(y(t))}catch(t){return t}};function b(t){return{}.toString.call(t)}var w=function(t){return a.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var M="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,i=[],r=t[Symbol.iterator]();!(e=r.next()).done;)i.push(e.value);return i};w=function(t){return a.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?M(t):null}}var x=void 0!==e&&"[object process]"===b(e).toLowerCase(),E=void 0!==e&&void 0!==e.env,k={isClass:function(t){try{if("function"==typeof t){var e=a.names(t.prototype),i=a.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),n=d.test(t+"")&&a.names(t).length>0;if(i||r||n)return!0}return!1}catch(t){return!1}},isIdentifier:function(t){return m.test(t)},inheritedDataKeys:p,getDataPropertyOrDefault:function(t,e,i){if(!a.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:i:void 0},thrower:function(t){throw t},isArray:a.isArray,asArray:w,notEnumerableProp:f,isPrimitive:c,isObject:function(t){return"function"==typeof t||"object"==typeof t&&null!==t},isError:g,canEvaluate:o,errorObj:h,tryCatch:function(t){return s=t,l},inherits:function(t,e){var i={}.hasOwnProperty;function r(){for(var r in this.constructor=t,this.constructor$=e,e.prototype)i.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}return r.prototype=e.prototype,t.prototype=new r,t.prototype},withAppended:function(t,e){var i,r=t.length,n=new Array(r+1);for(i=0;i<r;++i)n[i]=t[i];return n[i]=e,n},maybeWrapAsError:function(t){return c(t)?new Error(y(t)):t},toFastProperties:function(t){function e(){}e.prototype=t;for(var i=8;i--;)new e;return t},filledRange:function(t,e,i){for(var r=new Array(t),n=0;n<t;++n)r[n]=e+n+i;return r},toString:y,canAttachTrace:_,ensureErrorObject:v,originatesFromRejection:function(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)},markAsOriginatingFromRejection:function(t){try{f(t,"isOperational",!0)}catch(t){}},classString:b,copyDescriptors:function(t,e,i){for(var r=a.names(t),n=0;n<r.length;++n){var s=r[n];if(i(s))try{a.defineProperty(e,s,a.getDescriptor(t,s))}catch(t){}}},hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:x,hasEnvVariables:E,env:function(t){return E?e.env[t]:void 0},global:u,getNativePromise:function(){if("function"==typeof Promise)try{var t=new Promise((function(){}));if("[object Promise]"==={}.toString.call(t))return Promise}catch(t){}},domainBind:function(t,e){return t.bind(e)}};k.isRecentNode=k.isNode&&function(){var t=e.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),k.isNode&&k.toFastProperties(e);try{throw new Error}catch(t){k.lastLineError=t}r.exports=k},{"./es5":13}]},{},[4])(4),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,i(4),i(0),i(25).setImmediate)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(!e.eol&&t)for(var i=0,r=t.length;i<r;i++)if("\r"===t[i]){if("\n"===t[i+1]){e.eol="\r\n";break}if(t[i+1]){e.eol="\r";break}}else if("\n"===t[i]){e.eol="\n";break}return e.eol||"\n"}},function(t,e,i){var r=i(65),n=i(73);t.exports=function(t,e){var i=n(t,e);return r(i)?i:void 0}},function(t,e,i){var r=i(18).Symbol;t.exports=r},function(t,e,i){var r=i(67),n="object"==typeof self&&self&&self.Object===Object&&self,s=r||n||Function("return this")();t.exports=s},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){var i=Array.isArray;t.exports=i},function(t,e,i){var r=i(30),n=i(76);t.exports=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==r(t)}},function(t,e,i){"use strict";(function(e,r){var n=i(6);t.exports=v;var s,a=i(36);v.ReadableState=_,i(11).EventEmitter;var o=function(t,e){return t.listeners(e).length},h=i(23),u=i(7).Buffer,l=e.Uint8Array||function(){},c=i(5);c.inherits=i(2);var f=i(40),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var d,m=i(41),y=i(24);c.inherits(v,h);var g=["error","close","destroy","pause","resume"];function _(t,e){t=t||{};var r=e instanceof(s=s||i(1));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,a=t.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(a||0===a)?a:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=i(26).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function v(t){if(s=s||i(1),!(this instanceof v))return new v(t);this._readableState=new _(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),h.call(this)}function b(t,e,i,r,n){var s,a=t._readableState;return null===e?(a.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,E(t)}}(t,a)):(n||(s=function(t,e){var i;return function(t){return u.isBuffer(t)||t instanceof l}(e)||"string"==typeof e||void 0===e||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i}(a,e)),s?t.emit("error",s):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),r?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):C(t,a)):w(t,a,e,!1))):r||(a.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function w(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",i),t.read(0)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&E(t)),C(t,e)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=y.destroy,v.prototype._undestroy=y.undestroy,v.prototype._destroy=function(t,e){this.push(null),e(t)},v.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=u.from(t,e),e=""),i=!0),b(this,t,e,!1,i)},v.prototype.unshift=function(t){return b(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(t){return d||(d=i(26).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var M=8388608;function x(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(k,t):k(t))}function k(t){p("emit readable"),t.emit("readable"),j(t)}function C(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(S,t,e))}function S(t,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(p("maybeReadMore read 0"),t.read(0),i!==e.length);)i=e.length;e.readingMore=!1}function A(t){p("readable nexttick read 0"),t.read(0)}function P(t,e){e.reading||(p("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(p("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function(t,e,i){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():i?function(t,e){var i=e.head,r=1,n=i.data;for(t-=n.length;i=i.next;){var s=i.data,a=t>s.length?s.length:t;if(a===s.length?n+=s:n+=s.slice(0,t),0==(t-=a)){a===s.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=s.slice(a));break}++r}return e.length-=r,n}(t,e):function(t,e){var i=u.allocUnsafe(t),r=e.head,n=1;for(r.data.copy(i),t-=r.data.length;r=r.next;){var s=r.data,a=t>s.length?s.length:t;if(s.copy(i,i.length-t,0,a),0==(t-=a)){a===s.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(a));break}++n}return e.length-=n,i}(t,e),r}(t,e.buffer,e.decoder),i);var i}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}v.prototype.read=function(t){p("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):E(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&R(this),null;var r,n=e.needReadable;return p("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&p("length less than watermark",n=!0),e.ended||e.reading?p("reading or ended",n=!1):n&&(p("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=x(i,e))),null===(r=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&R(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var i=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,p("pipe count=%d opts=%j",s.pipesCount,e);var h=e&&!1===e.end||t===r.stdout||t===r.stderr?_:u;function u(){p("onend"),t.end()}s.endEmitted?n.nextTick(h):i.once("end",h),t.on("unpipe",(function e(r,n){p("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,p("cleanup"),t.removeListener("close",y),t.removeListener("finish",g),t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",_),i.removeListener("data",d),c=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}));var l=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,j(t))}}(i);t.on("drain",l);var c=!1,f=!1;function d(e){p("ondata"),f=!1,!1!==t.write(e)||f||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==I(s.pipes,t))&&!c&&(p("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,f=!0),i.pause())}function m(e){p("onerror",e),_(),t.removeListener("error",m),0===o(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",g),_()}function g(){p("onfinish"),t.removeListener("close",y),_()}function _(){p("unpipe"),i.unpipe(t)}return i.on("data",d),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",m),t.once("close",y),t.once("finish",g),t.emit("pipe",i),s.flowing||(p("pipe resume"),i.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)r[s].emit("unpipe",this,i);return this}var a=I(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},v.prototype.on=function(t,e){var i=h.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&E(this):n.nextTick(A,this))}return i},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(p("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(P,t,e))}(this,t)),this},v.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",(function(){if(p("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){p("wrapped data"),i.decoder&&(n=i.decoder.write(n)),(!i.objectMode||null!=n)&&(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var s=0;s<g.length;s++)t.on(g[s],this.emit.bind(this,g[s]));return this._read=function(e){p("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=O}).call(this,i(0),i(4))},function(t,e,i){t.exports=i(11).EventEmitter},function(t,e,i){"use strict";var r=i(6);function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var i=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(n,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(r.nextTick(n,i,t),i._writableState&&(i._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,i){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function s(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new s(n.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new s(n.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},i(43),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(0))},function(t,e,i){"use strict";var r=i(7).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=u,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:return this.write=f,void(this.end=p)}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,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(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 u(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 l(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 c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(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<t.length?e?e+this.text(t,i):this.text(t,i):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},s.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var n=a(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||-2===n?0:(n=a(e[r]))>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||-2===n?0:(n=a(e[r]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):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){"use strict";t.exports=s;var r=i(1),n=i(5);function s(t){if(!(this instanceof s))return new s(t);r.call(this,t),this._transformState={afterTransform:function(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,i){o(t,e,i)})):o(this,null,null)}function o(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}n.inherits=i(2),n.inherits(s,r),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,i){throw new Error("_transform() is not implemented")},s.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},s.prototype._destroy=function(t,e){var i=this;r.prototype._destroy.call(this,t,(function(t){e(t),i.emit("close")}))}},function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.bufFromString=function(e){var i=t.byteLength(e),r=t.allocUnsafe?t.allocUnsafe(i):new t(i);return r.write(e),r},e.emptyBuffer=function(){return t.allocUnsafe?t.allocUnsafe(0):new t(0)},e.filterArray=function(t,e){for(var i=[],r=0;r<t.length;r++)e.indexOf(r)>-1&&i.push(t[r]);return i},e.trimLeft=String.prototype.trimLeft?function(t){return t.trimLeft()}:function(t){return t.replace(/^\s+/,"")},e.trimRight=String.prototype.trimRight?function(t){return t.trimRight()}:function(t){return t.replace(/\s+$/,"")}}).call(this,i(3).Buffer)},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){function e(e,i,r){var n=t.call(this,"Error: "+e+". JSON Line number: "+i+(r?" near: "+r:""))||this;return n.err=e,n.line=i,n.extra=r,n.name="CSV Parse Error",n}return r(e,t),e.column_mismatched=function(t,i){return new e("column_mismatched",t,i)},e.unclosed_quote=function(t,i){return new e("unclosed_quote",t,i)},e.fromJSON=function(t){return new e(t.err,t.line,t.extra)},e.prototype.toJSON=function(){return{err:this.err,line:this.line,extra:this.extra}},e}(Error);e.default=n},function(t,e,i){var r=i(17),n=i(68),s=i(69),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?n(t):s(t)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,i){t.exports=i(33)},function(t,e,i){"use strict";var r=i(34),n=function(t,e){return new r.Converter(t,e)};n.csv=n,n.Converter=r.Converter,t.exports=n},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(35),a=i(50),o=i(51),h=n(i(14)),u=i(52),l=i(105),c=function(t){function e(e,i){void 0===i&&(i={});var r=t.call(this,i)||this;return r.options=i,r.params=a.mergeParams(e),r.runtime=o.initParseRuntime(r),r.result=new l.Result(r),r.processor=new u.ProcessorLocal(r),r.once("error",(function(t){setTimeout((function(){r.result.processError(t),r.emit("done",t)}),0)})),r.once("done",(function(){r.processor.destroy()})),r}return r(e,t),e.prototype.preRawData=function(t){return this.runtime.preRawDataHook=t,this},e.prototype.preFileLine=function(t){return this.runtime.preFileLineHook=t,this},e.prototype.subscribe=function(t,e,i){return this.parseRuntime.subscribe={onNext:t,onError:e,onCompleted:i},this},e.prototype.fromFile=function(t,e){var r=this,n=i(!function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}());return n.exists(t,(function(i){i?n.createReadStream(t,e).pipe(r):r.emit("error",new Error("File does not exist. Check to make sure the file path to your csv is correct."))})),this},e.prototype.fromStream=function(t){return t.pipe(this),this},e.prototype.fromString=function(t){t.toString();var e=new s.Readable,i=0;return e._read=function(e){if(i>=t.length)this.push(null);else{var r=t.substr(i,e);this.push(r),i+=e}},this.fromStream(e)},e.prototype.then=function(t,e){var i=this;return new h.default((function(r,n){i.parseRuntime.then={onfulfilled:function(e){r(t?t(e):e)},onrejected:function(t){e?r(e(t)):n(t)}}}))},Object.defineProperty(e.prototype,"parseParam",{get:function(){return this.params},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parseRuntime",{get:function(){return this.runtime},enumerable:!0,configurable:!0}),e.prototype._transform=function(t,e,i){var r=this;this.processor.process(t).then((function(t){if(t.length>0)return r.runtime.started=!0,r.result.processResult(t)})).then((function(){r.emit("drained"),i()}),(function(t){r.runtime.hasError=!0,r.runtime.error=t,r.emit("error",t),i()}))},e.prototype._flush=function(t){var e=this;this.processor.flush().then((function(t){if(t.length>0)return e.result.processResult(t)})).then((function(){e.processEnd(t)}),(function(i){e.emit("error",i),t()}))},e.prototype.processEnd=function(t){this.result.endProcess(),this.emit("done"),t()},Object.defineProperty(e.prototype,"parsedLineNumber",{get:function(){return this.runtime.parsedLineNumber},enumerable:!0,configurable:!0}),e}(s.Transform);e.Converter=c},function(t,e,i){t.exports=n;var r=i(11).EventEmitter;function n(){r.call(this)}i(2)(n,r),n.Readable=i(12),n.Writable=i(46),n.Duplex=i(47),n.Transform=i(48),n.PassThrough=i(49),n.Stream=n,n.prototype.pipe=function(t,e){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function s(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(i.on("end",o),i.on("close",h));var a=!1;function o(){a||(a=!0,t.end())}function h(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){i.removeListener("data",n),t.removeListener("drain",s),i.removeListener("end",o),i.removeListener("close",h),i.removeListener("error",u),t.removeListener("error",u),i.removeListener("end",l),i.removeListener("close",l),t.removeListener("close",l)}return i.on("error",u),t.on("error",u),i.on("end",l),i.on("close",l),t.on("close",l),t.emit("pipe",i),t}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){"use strict";e.byteLength=function(t){var e=u(t),i=e[0],r=e[1];return 3*(i+r)/4-r},e.toByteArray=function(t){for(var e,i=u(t),r=i[0],a=i[1],o=new s(3*(r+a)/4-a),h=0,l=a>0?r-4:r,c=0;c<l;c+=4)e=n[t.charCodeAt(c)]<<18|n[t.charCodeAt(c+1)]<<12|n[t.charCodeAt(c+2)]<<6|n[t.charCodeAt(c+3)],o[h++]=e>>16&255,o[h++]=e>>8&255,o[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(c)]<<2|n[t.charCodeAt(c+1)]>>4,o[h++]=255&e),1===a&&(e=n[t.charCodeAt(c)]<<10|n[t.charCodeAt(c+1)]<<4|n[t.charCodeAt(c+2)]>>2,o[h++]=e>>8&255,o[h++]=255&e),o},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],a=0,o=i-n;a<o;a+=16383)s.push(c(t,a,a+16383>o?o:a+16383));return 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]+"=")),s.join("")};for(var r=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=a.length;o<h;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function u(t){var e=t.length;if(e%4>0)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 l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,i){for(var r,n=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),n.push(l(r));return n.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,r,n){var s,a,o=8*n-r-1,h=(1<<o)-1,u=h>>1,l=-7,c=i?n-1:0,f=i?-1:1,p=t[e+c];for(c+=f,s=p&(1<<-l)-1,p>>=-l,l+=o;l>0;s=256*s+t[e+c],c+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+t[e+c],c+=f,l-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),s-=u}return(p?-1:1)*a*Math.pow(2,s-r)},e.write=function(t,e,i,r,n,s){var a,o,h,u=8*s-n-1,l=(1<<u)-1,c=l>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,m=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=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+c>=1?f/h:f*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=l?(o=0,a=l):a+c>=1?(o=(e*h-1)*Math.pow(2,n),a+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[i+p]=255&o,p+=d,o/=256,n-=8);for(a=a<<n|o,u+=n;u>0;t[i+p]=255&a,p+=d,a/=256,u-=8);t[i+p-d]|=128*m}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e){},function(t,e,i){"use strict";var r=i(7).Buffer,n=i(42);function s(t,e,i){t.copy(e,i)}t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e=r.allocUnsafe(t>>>0),i=this.head,n=0;i;)s(i.data,e,n),n+=i.data.length,i=i.next;return e},t}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,i){(function(t,e){!function(t,i){"use strict";if(!t.setImmediate){var r,n=1,s={},a=!1,o=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){l(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?function(){var e="setImmediate$"+Math.random()+"$",i=function(i){i.source===t&&"string"==typeof i.data&&0===i.data.indexOf(e)&&l(+i.data.slice(e.length))};t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),r=function(i){t.postMessage(e+i,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){l(t.data)},r=function(e){t.port2.postMessage(e)}}():o&&"onreadystatechange"in o.createElement("script")?function(){var t=o.documentElement;r=function(e){var i=o.createElement("script");i.onreadystatechange=function(){l(e),i.onreadystatechange=null,t.removeChild(i),i=null},t.appendChild(i)}}():r=function(t){setTimeout(l,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var a={callback:t,args:e};return s[n]=a,r(n),n++},h.clearImmediate=u}function u(t){delete s[t]}function l(t){if(a)setTimeout(l,0,t);else{var e=s[t];if(e){a=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(undefined,i)}}(e)}finally{u(t),a=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(0),i(4))},function(t,e,i){(function(e){function i(t){try{if(!e.localStorage)return!1}catch(t){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,i(0))},function(t,e,i){"use strict";t.exports=s;var r=i(27),n=i(5);function s(t){if(!(this instanceof s))return new s(t);r.call(this,t)}n.inherits=i(2),n.inherits(s,r),s.prototype._transform=function(t,e,i){i(null,t)}},function(t,e,i){t.exports=i(13)},function(t,e,i){t.exports=i(1)},function(t,e,i){t.exports=i(12).Transform},function(t,e,i){t.exports=i(12).PassThrough},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeParams=function(t){var e={delimiter:",",ignoreColumns:void 0,includeColumns:void 0,quote:'"',trim:!0,checkType:!1,ignoreEmpty:!1,noheader:!1,headers:void 0,flatKeys:!1,maxRowLength:0,checkColumn:!1,escape:'"',colParser:{},eol:void 0,alwaysSplitAtEOL:!1,output:"json"};for(var i in t||(t={}),t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?e[i]=[].concat(t[i]):e[i]=t[i]);return e}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initParseRuntime=function(t){var e=t.parseParam,i={needProcessIgnoreColumn:!1,needProcessIncludeColumn:!1,selectedColumns:void 0,ended:!1,hasError:!1,error:void 0,delimiter:t.parseParam.delimiter,eol:t.parseParam.eol,columnConv:[],headerType:[],headerTitle:[],headerFlag:[],headers:void 0,started:!1,parsedLineNumber:0,columnValueSetter:[]};return e.ignoreColumns&&(i.needProcessIgnoreColumn=!0),e.includeColumns&&(i.needProcessIncludeColumn=!0),i}},function(t,e,i){"use strict";(function(t){var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(53),a=n(i(14)),o=i(54),h=n(i(15)),u=i(57),l=i(28),c=i(58),f=n(i(59)),p=n(i(29)),d=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.rowSplit=new c.RowSplit(t.converter),t.eolEmitted=!1,t._needEmitEol=void 0,t.headEmitted=!1,t._needEmitHead=void 0,t}return r(i,e),i.prototype.flush=function(){var t=this;if(this.runtime.csvLineBuffer&&this.runtime.csvLineBuffer.length>0){var e=this.runtime.csvLineBuffer;return this.runtime.csvLineBuffer=void 0,this.process(e,!0).then((function(e){return t.runtime.csvLineBuffer&&t.runtime.csvLineBuffer.length>0?a.default.reject(p.default.unclosed_quote(t.runtime.parsedLineNumber,t.runtime.csvLineBuffer.toString())):a.default.resolve(e)}))}return a.default.resolve([])},i.prototype.destroy=function(){return a.default.resolve()},Object.defineProperty(i.prototype,"needEmitEol",{get:function(){return void 0===this._needEmitEol&&(this._needEmitEol=this.converter.listeners("eol").length>0),this._needEmitEol},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"needEmitHead",{get:function(){return void 0===this._needEmitHead&&(this._needEmitHead=this.converter.listeners("header").length>0),this._needEmitHead},enumerable:!0,configurable:!0}),i.prototype.process=function(t,e){var i,r=this;return void 0===e&&(e=!1),i=e?t.toString():o.prepareData(t,this.converter.parseRuntime),a.default.resolve().then((function(){return r.runtime.preRawDataHook?r.runtime.preRawDataHook(i):i})).then((function(t){return t&&t.length>0?r.processCSV(t,e):a.default.resolve([])}))},i.prototype.processCSV=function(t,e){var i=this,r=this.params,n=this.runtime;n.eol||h.default(t,n),this.needEmitEol&&!this.eolEmitted&&n.eol&&(this.converter.emit("eol",n.eol),this.eolEmitted=!0),r.ignoreEmpty&&!n.started&&(t=l.trimLeft(t));var s=u.stringToLines(t,n);return e?(s.lines.push(s.partial),s.partial=""):this.prependLeftBuf(l.bufFromString(s.partial)),s.lines.length>0?(n.preFileLineHook?this.runPreLineHook(s.lines):a.default.resolve(s.lines)).then((function(t){return n.started||i.runtime.headers?i.processCSVBody(t):i.processDataWithHead(t)})):a.default.resolve([])},i.prototype.processDataWithHead=function(t){if(this.params.noheader)this.params.headers?this.runtime.headers=this.params.headers:this.runtime.headers=[];else{for(var e="",i=[];t.length;){var r=e+t.shift(),n=this.rowSplit.parse(r);if(n.closed){i=n.cells,e="";break}e=r+h.default(r,this.runtime)}if(this.prependLeftBuf(l.bufFromString(e)),0===i.length)return[];this.params.headers?this.runtime.headers=this.params.headers:this.runtime.headers=i}return(this.runtime.needProcessIgnoreColumn||this.runtime.needProcessIncludeColumn)&&this.filterHeader(),this.needEmitHead&&!this.headEmitted&&(this.converter.emit("header",this.runtime.headers),this.headEmitted=!0),this.processCSVBody(t)},i.prototype.filterHeader=function(){if(this.runtime.selectedColumns=[],this.runtime.headers){for(var t=this.runtime.headers,e=0;e<t.length;e++)if(this.params.ignoreColumns)if(this.params.ignoreColumns.test(t[e])){if(!this.params.includeColumns||!this.params.includeColumns.test(t[e]))continue;this.runtime.selectedColumns.push(e)}else this.runtime.selectedColumns.push(e);else this.params.includeColumns?this.params.includeColumns.test(t[e])&&this.runtime.selectedColumns.push(e):this.runtime.selectedColumns.push(e);this.runtime.headers=l.filterArray(this.runtime.headers,this.runtime.selectedColumns)}},i.prototype.processCSVBody=function(t){if("line"===this.params.output)return t;var e=this.rowSplit.parseMultiLines(t);return this.prependLeftBuf(l.bufFromString(e.partial)),"csv"===this.params.output?e.rowsCells:f.default(e.rowsCells,this.converter)},i.prototype.prependLeftBuf=function(e){e&&(this.runtime.csvLineBuffer?this.runtime.csvLineBuffer=t.concat([e,this.runtime.csvLineBuffer]):this.runtime.csvLineBuffer=e)},i.prototype.runPreLineHook=function(t){var e=this;return new a.default((function(i,r){!function t(e,i,r,n){if(r>=e.length)n();else if(i.preFileLineHook){var s=e[r],a=i.preFileLineHook(s,i.parsedLineNumber+r);if(r++,a&&a.then)a.then((function(s){e[r-1]=s,t(e,i,r,n)}));else{for(e[r-1]=a;r<e.length;)e[r]=i.preFileLineHook(e[r],i.parsedLineNumber+r),r++;n()}}else n()}(t,e.runtime,0,(function(e){e?r(e):i(t)}))}))},i}(s.Processor);e.ProcessorLocal=d}).call(this,i(3).Buffer)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Processor=function(t){this.converter=t,this.params=t.parseParam,this.runtime=t.parseRuntime}},function(t,e,i){"use strict";(function(t){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(55));e.prepareData=function(e,i){var r=function(e,i){return i.csvLineBuffer&&i.csvLineBuffer.length>0?t.concat([i.csvLineBuffer,e]):e}(e,i);i.csvLineBuffer=void 0;var s=function(t,e){var i=t.length-1;if(0!=(128&t[i])){for(;128==(192&t[i]);)i--;i--}return i!=t.length-1?(e.csvLineBuffer=t.slice(i+1),t.slice(0,i+1)):t}(r,i).toString("utf8");return!1===i.started?n.default(s):s}}).call(this,i(3).Buffer)},function(t,e,i){"use strict";(function(e){var r=i(56);t.exports=function(t){return"string"==typeof t&&65279===t.charCodeAt(0)?t.slice(1):e.isBuffer(t)&&r(t)&&239===t[0]&&187===t[1]&&191===t[2]?t.slice(3):t}}).call(this,i(3).Buffer)},function(t,e){t.exports=function(t){for(var e=0;e<t.length;)if(9==t[e]||10==t[e]||13==t[e]||32<=t[e]&&t[e]<=126)e+=1;else if(194<=t[e]&&t[e]<=223&&128<=t[e+1]&&t[e+1]<=191)e+=2;else if(224==t[e]&&160<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191||(225<=t[e]&&t[e]<=236||238==t[e]||239==t[e])&&128<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191||237==t[e]&&128<=t[e+1]&&t[e+1]<=159&&128<=t[e+2]&&t[e+2]<=191)e+=3;else{if(!(240==t[e]&&144<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191||241<=t[e]&&t[e]<=243&&128<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191||244==t[e]&&128<=t[e+1]&&t[e+1]<=143&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191))return!1;e+=4}return!0}},function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(15));e.stringToLines=function(t,e){var i=n.default(t,e),r=t.split(i);return{lines:r,partial:r.pop()||""}}},function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(15)),s=i(28),a=[",","|","\t",";",":"],o=function(){function t(t){this.conv=t,this.cachedRegExp={},this.delimiterEmitted=!1,this._needEmitDelimiter=void 0,this.quote=t.parseParam.quote,this.trim=t.parseParam.trim,this.escape=t.parseParam.escape}return Object.defineProperty(t.prototype,"needEmitDelimiter",{get:function(){return void 0===this._needEmitDelimiter&&(this._needEmitDelimiter=this.conv.listeners("delimiter").length>0),this._needEmitDelimiter},enumerable:!0,configurable:!0}),t.prototype.parse=function(t){if(0===t.length||this.conv.parseParam.ignoreEmpty&&0===t.trim().length)return{cells:[],closed:!0};var e=this.quote,i=this.trim;this.escape,(this.conv.parseRuntime.delimiter instanceof Array||"auto"===this.conv.parseRuntime.delimiter.toLowerCase())&&(this.conv.parseRuntime.delimiter=this.getDelimiter(t)),this.needEmitDelimiter&&!this.delimiterEmitted&&(this.conv.emit("delimiter",this.conv.parseRuntime.delimiter),this.delimiterEmitted=!0);var r=this.conv.parseRuntime.delimiter,n=t.split(r);if("off"===e){if(i)for(var s=0;s<n.length;s++)n[s]=n[s].trim();return{cells:n,closed:!0}}return this.toCSVRow(n,i,e,r)},t.prototype.toCSVRow=function(t,e,i,r){for(var n=[],a=!1,o="",h=0,u=t.length;h<u;h++){var l=t[h];!a&&e&&(l=s.trimLeft(l));var c=l.length;if(a)this.isQuoteClose(l)?(a=!1,o+=r+(l=l.substr(0,c-1)),o=this.escapeQuote(o),e&&(o=s.trimRight(o)),n.push(o),o=""):o+=r+l;else{if(2===c&&l===this.quote+this.quote){n.push("");continue}if(this.isQuoteOpen(l)){if(l=l.substr(1),this.isQuoteClose(l)){l=l.substring(0,l.lastIndexOf(i)),l=this.escapeQuote(l),n.push(l);continue}if(-1!==l.indexOf(i)){for(var f=0,p=0,d=l;p<d.length;p++)d[p]===i&&f++;if(f%2==1){e&&(l=s.trimRight(l)),n.push(i+l);continue}a=!0,o+=l;continue}a=!0,o+=l;continue}e&&(l=s.trimRight(l)),n.push(l)}}return{cells:n,closed:!a}},t.prototype.getDelimiter=function(t){var e;if("auto"===this.conv.parseParam.delimiter)e=a;else{if(!(this.conv.parseParam.delimiter instanceof Array))return this.conv.parseParam.delimiter;e=this.conv.parseParam.delimiter}var i=0,r=",";return e.forEach((function(e){var n=t.split(e).length;n>i&&(r=e,i=n)})),r},t.prototype.isQuoteOpen=function(t){var e=this.quote,i=this.escape;return t[0]===e&&(t[1]!==e||t[1]===i&&(t[2]===e||2===t.length))},t.prototype.isQuoteClose=function(t){var e=this.quote,i=this.escape;this.conv.parseParam.trim&&(t=s.trimRight(t));for(var r=0,n=t.length-1;t[n]===e||t[n]===i;)n--,r++;return r%2!=0},t.prototype.escapeQuote=function(t){var e="es|"+this.quote+"|"+this.escape;void 0===this.cachedRegExp[e]&&(this.cachedRegExp[e]=new RegExp("\\"+this.escape+"\\"+this.quote,"g"));var i=this.cachedRegExp[e];return t.replace(i,this.quote)},t.prototype.parseMultiLines=function(t){for(var e=[],i="";t.length;){var r=i+t.shift(),a=this.parse(r);0===a.cells.length&&this.conv.parseParam.ignoreEmpty||(a.closed||this.conv.parseParam.alwaysSplitAtEOL?(this.conv.parseRuntime.selectedColumns?e.push(s.filterArray(a.cells,this.conv.parseRuntime.selectedColumns)):e.push(a.cells),i=""):i=r+(n.default(r,this.conv.parseRuntime)||"\n"))}return{rowsCells:e,partial:i}},t}();e.RowSplit=o},function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(29)),s=r(i(60)),a=/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;function o(t,e,i){if(e.parseParam.checkColumn&&e.parseRuntime.headers&&t.length!==e.parseRuntime.headers.length)throw n.default.column_mismatched(e.parseRuntime.parsedLineNumber+i);return function(t,e,i){for(var r=!1,n={},s=0,a=t.length;s<a;s++){var o=t[s];if(!i.parseParam.ignoreEmpty||""!==o){r=!0;var h=e[s];h&&""!==h||(h=e[s]="field"+(s+1));var c=u(h,s,i);if(c){var f=c(o,h,n,t,s);void 0!==f&&l(n,h,f,i,s)}else{i.parseParam.checkType&&(o=p(o,h,s,i)(o));void 0!==o&&l(n,h,o,i,s)}}}return r?n:null}(t,e.parseRuntime.headers||[],e)||null}e.default=function(t,e){for(var i=[],r=0,n=t.length;r<n;r++){var s=o(t[r],e,r);s&&i.push(s)}return i};var h={string:m,number:d,omit:function(){}};function u(t,e,i){if(void 0!==i.parseRuntime.columnConv[e])return i.parseRuntime.columnConv[e];var r=i.parseParam.colParser[t];if(void 0===r)return i.parseRuntime.columnConv[e]=null;if("object"==typeof r&&(r=r.cellParser||"string"),"string"==typeof r){r=r.trim().toLowerCase();var n=h[r];return i.parseRuntime.columnConv[e]=n||null}return i.parseRuntime.columnConv[e]="function"==typeof r?r:null}function l(t,e,i,r,n){r.parseRuntime.columnValueSetter[n]||(r.parseParam.flatKeys?r.parseRuntime.columnValueSetter[n]=c:e.indexOf(".")>-1?r.parseParam.colParser[e]&&r.parseParam.colParser[e].flat?r.parseRuntime.columnValueSetter[n]=c:r.parseRuntime.columnValueSetter[n]=f:r.parseRuntime.columnValueSetter[n]=c),r.parseRuntime.columnValueSetter[n](t,e,i)}function c(t,e,i){t[e]=i}function f(t,e,i){s.default(t,e,i)}function p(t,e,i,r){return r.parseRuntime.headerType[i]?r.parseRuntime.headerType[i]:e.indexOf("number#!")>-1?r.parseRuntime.headerType[i]=d:e.indexOf("string#!")>-1?r.parseRuntime.headerType[i]=m:r.parseParam.checkType?r.parseRuntime.headerType[i]=y:r.parseRuntime.headerType[i]=m}function d(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t){return t.toString()}function y(t){var e=t.trim();return""===e?m(t):a.test(e)?d(t):5===e.length&&"false"===e.toLowerCase()||4===e.length&&"true"===e.toLowerCase()?function(t){var e=t.trim();return 5!==e.length||"false"!==e.toLowerCase()}(t):"{"===e[0]&&"}"===e[e.length-1]||"["===e[0]&&"]"===e[e.length-1]?function(t){try{return JSON.parse(t)}catch(e){return t}}(t):m(t)}},function(t,e,i){var r=i(61);t.exports=function(t,e,i){return null==t?t:r(t,e,i)}},function(t,e,i){var r=i(62),n=i(74),s=i(103),a=i(19),o=i(104);t.exports=function(t,e,i,h){if(!a(t))return t;for(var u=-1,l=(e=n(e,t)).length,c=l-1,f=t;null!=f&&++u<l;){var p=o(e[u]),d=i;if(u!=c){var m=f[p];void 0===(d=h?h(m,p,f):void 0)&&(d=a(m)?m:s(e[u+1])?[]:{})}r(f,p,d),f=f[p]}return t}},function(t,e,i){var r=i(63),n=i(31),s=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){var a=t[e];s.call(t,e)&&n(a,i)&&(void 0!==i||e in t)||r(t,e,i)}},function(t,e,i){var r=i(64);t.exports=function(t,e,i){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}},function(t,e,i){var r=i(16),n=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=n},function(t,e,i){var r=i(66),n=i(70),s=i(19),a=i(72),o=/^\[object .+?Constructor\]$/,h=Function.prototype,u=Object.prototype,l=h.toString,c=u.hasOwnProperty,f=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!s(t)||n(t))&&(r(t)?f:o).test(a(t))}},function(t,e,i){var r=i(30),n=i(19);t.exports=function(t){if(!n(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i(0))},function(t,e,i){var r=i(17),n=Object.prototype,s=n.hasOwnProperty,a=n.toString,o=r?r.toStringTag:void 0;t.exports=function(t){var e=s.call(t,o),i=t[o];try{t[o]=void 0;var r=!0}catch(t){}var n=a.call(t);return r&&(e?t[o]=i:delete t[o]),n}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var r=i(71),n=function(){var t=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!n&&n in t}},function(t,e,i){var r=i(18)["__core-js_shared__"];t.exports=r},function(t,e){var i=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return i.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,i){var r=i(20),n=i(75),s=i(77),a=i(100);t.exports=function(t,e){return r(t)?t:n(t,e)?[t]:s(a(t))}},function(t,e,i){var r=i(20),n=i(21),s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!n(t))||a.test(t)||!s.test(t)||null!=e&&t in Object(e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,i){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,s=i(78)((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(r,(function(t,i,r,s){e.push(r?s.replace(n,"$1"):i||t)})),e}));t.exports=s},function(t,e,i){var r=i(79);t.exports=function(t){var e=r(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}},function(t,e,i){var r=i(80);function n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var r=arguments,n=e?e.apply(this,r):r[0],s=i.cache;if(s.has(n))return s.get(n);var a=t.apply(this,r);return i.cache=s.set(n,a)||s,a};return i.cache=new(n.Cache||r),i}n.Cache=r,t.exports=n},function(t,e,i){var r=i(81),n=i(95),s=i(97),a=i(98),o=i(99);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=s,h.prototype.has=a,h.prototype.set=o,t.exports=h},function(t,e,i){var r=i(82),n=i(88),s=i(94);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(s||n),string:new r}}},function(t,e,i){var r=i(83),n=i(84),s=i(85),a=i(86),o=i(87);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=s,h.prototype.has=a,h.prototype.set=o,t.exports=h},function(t,e,i){var r=i(8);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,i){var r=i(8),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return n.call(e,t)?e[t]:void 0}},function(t,e,i){var r=i(8),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:n.call(e,t)}},function(t,e,i){var r=i(8);t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,i){var r=i(89),n=i(90),s=i(91),a=i(92),o=i(93);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=s,h.prototype.has=a,h.prototype.set=o,t.exports=h},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,i){var r=i(9),n=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=r(e,t);return!(i<0||(i==e.length-1?e.pop():n.call(e,i,1),--this.size,0))}},function(t,e,i){var r=i(9);t.exports=function(t){var e=this.__data__,i=r(e,t);return i<0?void 0:e[i][1]}},function(t,e,i){var r=i(9);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,i){var r=i(9);t.exports=function(t,e){var i=this.__data__,n=r(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}},function(t,e,i){var r=i(16)(i(18),"Map");t.exports=r},function(t,e,i){var r=i(10);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,i){var r=i(10);t.exports=function(t){return r(this,t).get(t)}},function(t,e,i){var r=i(10);t.exports=function(t){return r(this,t).has(t)}},function(t,e,i){var r=i(10);t.exports=function(t,e){var i=r(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}},function(t,e,i){var r=i(101);t.exports=function(t){return null==t?"":r(t)}},function(t,e,i){var r=i(17),n=i(102),s=i(20),a=i(21),o=r?r.prototype:void 0,h=o?o.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(s(e))return n(e,t)+"";if(a(e))return h?h.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}},function(t,e){t.exports=function(t,e){for(var i=-1,r=null==t?0:t.length,n=Array(r);++i<r;)n[i]=e(t[i],i,t);return n}},function(t,e){var i=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&i.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,i){var r=i(21);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(14)),s=function(){function t(t){this.converter=t,this.finalResult=[]}return Object.defineProperty(t.prototype,"needEmitLine",{get:function(){return!!this.converter.parseRuntime.subscribe&&!!this.converter.parseRuntime.subscribe.onNext||this.needPushDownstream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"needPushDownstream",{get:function(){return void 0===this._needPushDownstream&&(this._needPushDownstream=this.converter.listeners("data").length>0||this.converter.listeners("readable").length>0),this._needPushDownstream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"needEmitAll",{get:function(){return!!this.converter.parseRuntime.then},enumerable:!0,configurable:!0}),t.prototype.processResult=function(t){var e=this;return this.converter.parseRuntime.parsedLineNumber,new n.default((function(i,r){e.needEmitLine?function t(e,i,r,n,s){if(r>=e.length)s();else if(i.parseRuntime.subscribe&&i.parseRuntime.subscribe.onNext){var o=i.parseRuntime.subscribe.onNext,h=e[r],u=o(h,i.parseRuntime.parsedLineNumber+r);if(r++,u&&u.then)u.then((function(){!function(e,i,r,n,s,o,h){s&&a(r,h),t(e,r,n,s,o)}(e,0,i,r,n,s,h)}),s);else{for(n&&a(i,h);r<e.length;){var l=e[r];o(l,i.parseRuntime.parsedLineNumber+r),r++,n&&a(i,l)}s()}}else{if(n)for(;r<e.length;)l=e[r++],a(i,l);s()}}(t,e.converter,0,e.needPushDownstream,(function(n){n?r(n):(e.appendFinalResult(t),i())})):(e.appendFinalResult(t),i())}))},t.prototype.appendFinalResult=function(t){this.needEmitAll&&(this.finalResult=this.finalResult.concat(t)),this.converter.parseRuntime.parsedLineNumber+=t.length},t.prototype.processError=function(t){this.converter.parseRuntime.subscribe&&this.converter.parseRuntime.subscribe.onError&&this.converter.parseRuntime.subscribe.onError(t),this.converter.parseRuntime.then&&this.converter.parseRuntime.then.onrejected&&this.converter.parseRuntime.then.onrejected(t)},t.prototype.endProcess=function(){this.needEmitAll&&this.converter.parseRuntime.then&&this.converter.parseRuntime.then.onfulfilled&&this.converter.parseRuntime.then.onfulfilled(this.finalResult),this.converter.parseRuntime.subscribe&&this.converter.parseRuntime.subscribe.onCompleted&&this.converter.parseRuntime.subscribe.onCompleted()},t}();function a(t,e){"object"!=typeof e||t.options.objectMode?t.push(e):t.push(JSON.stringify(e)+"\n","utf8")}e.Result=s}]);var toGeoJSON=function(){"use strict";var t,e=/\s*/g,i=/^\s*|\s*$/g,r=/\s+/;function n(t){if(!t||!t.length)return 0;for(var e=0,i=0;e<t.length;e++)i=(i<<5)-i+t.charCodeAt(e)|0;return i}function s(t,e){return t.getElementsByTagName(e)}function a(t,e){return t.getAttribute(e)}function o(t,e){return parseFloat(a(t,e))}function h(t,e){var i=s(t,e);return i.length?i[0]:null}function u(t){for(var e=0,i=[];e<t.length;e++)i[e]=parseFloat(t[e]);return i}function l(t){t&&function(t){t.normalize&&t.normalize()}(t);return t&&t.textContent||""}function c(t,e){var i,r,n={};for(r=0;r<e.length;r++)(i=h(t,e[r]))&&(n[e[r]]=l(i));return n}function f(t,e){for(var i in e)t[i]=e[i]}function p(t){return u(t.replace(e,"").split(","))}function d(t){for(var e=t.replace(i,"").split(r),n=[],s=0;s<e.length;s++)n.push(p(e[s]));return n}function m(t){var e,i=[o(t,"lon"),o(t,"lat")],r=h(t,"ele"),n=h(t,"gpxtpx:hr")||h(t,"hr"),s=h(t,"time");if(r){e=parseFloat(l(r));isNaN(e)||i.push(e)}return{coordinates:i,time:s?l(s):null,heartRate:n?parseFloat(l(n)):null}}if("undefined"!=typeof XMLSerializer)t=new XMLSerializer;else{var y="object"==typeof process&&!process.browser,g="object"==typeof Titanium;if("object"!=typeof exports||!y&&!g)throw new Error("Unable to initialize serializer");t=new(require("xmldom").XMLSerializer)}function _(e){return void 0!==e.xml?e.xml:t.serializeToString(e)}return{kml:function(t){for(var e={type:"FeatureCollection",features:[]},i={},r={},o={},c=["Polygon","LineString","Point","Track","gx:Track"],f=s(t,"Placemark"),m=s(t,"Style"),y=s(t,"StyleMap"),g=0;g<m.length;g++){var v=n(_(m[g])).toString(16);i["#"+a(m[g],"id")]=v;r[v]=m[g]}for(var b=0;b<y.length;b++){i["#"+a(y[b],"id")]=n(_(y[b])).toString(16);for(var w=s(y[b],"Pair"),M={},x=0;x<w.length;x++)M[l(h(w[x],"key"))]=l(h(w[x],"styleUrl"));o["#"+a(y[b],"id")]=M}for(var E=0;E<f.length;E++)e.features=e.features.concat(A(f[E]));function k(t){var e,i;"#"===(t=t||"").substr(0,1)&&(t=t.substr(1));6!==t.length&&3!==t.length||(e=t);if(8===t.length){i=parseInt(t.substr(0,2),16)/255;e="#"+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)}return[e,isNaN(i)?void 0:i]}function C(t){var e=s(t,"coord"),i=[],r=[];0===e.length&&(e=s(t,"gx:coord"));for(var n=0;n<e.length;n++)i.push(u(l(e[n]).split(" ")));for(var a=s(t,"when"),o=0;o<a.length;o++)r.push(l(a[o]));return{coords:i,times:r}}function S(t){var e,i,r,n,a,o=[],u=[];if(h(t,"MultiGeometry"))return S(h(t,"MultiGeometry"));if(h(t,"MultiTrack"))return S(h(t,"MultiTrack"));if(h(t,"gx:MultiTrack"))return S(h(t,"gx:MultiTrack"));for(r=0;r<c.length;r++)if(i=s(t,c[r]))for(n=0;n<i.length;n++){e=i[n];if("Point"===c[r])o.push({type:"Point",coordinates:p(l(h(e,"coordinates")))});else if("LineString"===c[r])o.push({type:"LineString",coordinates:d(l(h(e,"coordinates")))});else if("Polygon"===c[r]){var f=s(e,"LinearRing"),m=[];for(a=0;a<f.length;a++)m.push(d(l(h(f[a],"coordinates"))));o.push({type:"Polygon",coordinates:m})}else if("Track"===c[r]||"gx:Track"===c[r]){var y=C(e);o.push({type:"LineString",coordinates:y.coords});y.times.length&&u.push(y.times)}}return{geoms:o,coordTimes:u}}function A(t){var e,n=S(t),u={},c=l(h(t,"name")),f=l(h(t,"address")),p=l(h(t,"styleUrl")),d=l(h(t,"description")),m=h(t,"TimeSpan"),y=h(t,"TimeStamp"),g=h(t,"ExtendedData"),_=h(t,"LineStyle"),v=h(t,"PolyStyle"),b=h(t,"visibility");if(!n.geoms.length)return[];c&&(u.name=c);f&&(u.address=f);if(p){"#"!==p[0]&&(p="#"+p);u.styleUrl=p;i[p]&&(u.styleHash=i[p]);if(o[p]){u.styleMapHash=o[p];u.styleHash=i[o[p].normal]}var w=r[u.styleHash];if(w){_||(_=h(w,"LineStyle"));v||(v=h(w,"PolyStyle"));var M=h(w,"IconStyle");if(M){var x=h(M,"Icon");if(x){var E=l(h(x,"href"));E&&(u.icon=E)}}}}d&&(u.description=d);if(m){var C=l(h(m,"begin")),A=l(h(m,"end"));u.timespan={begin:C,end:A}}y&&(u.timestamp=l(h(y,"when")));if(_){var P=k(l(h(_,"color"))),j=P[0],O=P[1],R=parseFloat(l(h(_,"width")));j&&(u.stroke=j);isNaN(O)||(u["stroke-opacity"]=O);isNaN(R)||(u["stroke-width"]=R)}if(v){var T=k(l(h(v,"color"))),I=T[0],N=T[1],L=l(h(v,"fill")),B=l(h(v,"outline"));I&&(u.fill=I);isNaN(N)||(u["fill-opacity"]=N);L&&(u["fill-opacity"]="1"===L?u["fill-opacity"]||1:0);B&&(u["stroke-opacity"]="1"===B?u["stroke-opacity"]||1:0)}if(g){var F=s(g,"Data"),D=s(g,"SimpleData");for(e=0;e<F.length;e++)u[F[e].getAttribute("name")]=l(h(F[e],"value"));for(e=0;e<D.length;e++)u[D[e].getAttribute("name")]=l(D[e])}b&&(u.visibility=l(b));n.coordTimes.length&&(u.coordTimes=1===n.coordTimes.length?n.coordTimes[0]:n.coordTimes);var z={type:"Feature",geometry:1===n.geoms.length?n.geoms[0]:{type:"GeometryCollection",geometries:n.geoms},properties:u};a(t,"id")&&(z.id=a(t,"id"));return[z]}return e},gpx:function(t){var e,i,r=s(t,"trk"),n=s(t,"rte"),o=s(t,"wpt"),u={type:"FeatureCollection",features:[]};for(e=0;e<r.length;e++)(i=y(r[e]))&&u.features.push(i);for(e=0;e<n.length;e++)(i=g(n[e]))&&u.features.push(i);for(e=0;e<o.length;e++)u.features.push(_(o[e]));function p(t,e){for(var i=0;i<e;i++)t.push(null);return t}function d(t,e){var i=s(t,e),r=[],n=[],a=[],o=i.length;if(o<2)return{};for(var h=0;h<o;h++){var u=m(i[h]);r.push(u.coordinates);u.time&&n.push(u.time);if(u.heartRate||a.length){a.length||p(a,h);a.push(u.heartRate||null)}}return{line:r,times:n,heartRates:a}}function y(t){for(var e,i=s(t,"trkseg"),r=[],n=[],a=[],o=0;o<i.length;o++)if(e=d(i[o],"trkpt")){e.line&&r.push(e.line);e.times&&e.times.length&&n.push(e.times);if(a.length||e.heartRates&&e.heartRates.length){if(!a.length)for(var u=0;u<o;u++)a.push(p([],r[u].length));e.heartRates&&e.heartRates.length?a.push(e.heartRates):a.push(p([],e.line.length||0))}}if(0!==r.length){var l=b(t);f(l,v(h(t,"extensions")));n.length&&(l.coordTimes=1===r.length?n[0]:n);a.length&&(l.heartRates=1===r.length?a[0]:a);return{type:"Feature",properties:l,geometry:{type:1===r.length?"LineString":"MultiLineString",coordinates:1===r.length?r[0]:r}}}}function g(t){var e=d(t,"rtept");if(e.line){var i=b(t);f(i,v(h(t,"extensions")));return{type:"Feature",properties:i,geometry:{type:"LineString",coordinates:e.line}}}}function _(t){var e=b(t);f(e,c(t,["sym"]));return{type:"Feature",properties:e,geometry:{type:"Point",coordinates:m(t).coordinates}}}function v(t){var e={};if(t){var i=h(t,"line");if(i){var r=l(h(i,"color")),n=parseFloat(l(h(i,"opacity"))),s=parseFloat(l(h(i,"width")));r&&(e.stroke=r);isNaN(n)||(e["stroke-opacity"]=n);isNaN(s)||(e["stroke-width"]=96*s/25.4)}}return e}function b(t){var e=c(t,["name","cmt","desc","type","time","keywords"]),i=s(t,"link");i.length&&(e.links=[]);for(var r,n=0;n<i.length;n++){f(r={href:a(i[n],"href")},c(i[n],["text","type"]));e.links.push(r)}return e}return u}}}();"undefined"!=typeof module&&(module.exports=toGeoJSON);!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.proj4=e()}(this,(function(){"use strict";function t(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),n=e.toLowerCase().replace(ht,""),s=-1;++s<r.length;)if((i=r[s]).toLowerCase().replace(ht,"")===n)return t[i]}function e(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=lt}function i(t){return new e(t).output()}function r(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var r=e?{}:t,s=i.reduce((function(t,e){return n(e,t),t}),r);e&&(t[e]=s)}function n(t,e){if(Array.isArray(t)){var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(e[i]={},void n(t[0],e[i])):void(e[i]=t[0]);if(t.length)if("TOWGS84"!==i){if("AXIS"===i)return i in e||(e[i]=[]),void e[i].push(t);Array.isArray(i)||(e[i]={});var s;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&n(t[2],e[i]));case"SPHEROID":case"ELLIPSOID":return e[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&n(t[3],e[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void r(e,i,t);default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return n(t,e[i]);return r(e,i,t)}}else e[i]=t;else e[i]=!0}else e[t]=!0}function s(t){return t*yt}function a(t){function e(e){return e*(t.to_meter||1)}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",r=0,n=t.AXIS.length;r<n;++r){var a=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a);[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["azimuth","Azimuth"],["alpha","azimuth",s],["srsCode","name"]].forEach((function(e){return function(t,e){var i=e[0],r=e[1];!(i in t)&&r in t&&(t[i]=t[r],3===e.length&&(t[i]=e[2](t[i])))}(t,e)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}function o(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?o[t]=ut(arguments[1]):o[t]=gt(arguments[1]):o[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?o.apply(e,t):o(t)}));if("string"==typeof t){if(t in o)return o[t]}else"EPSG"in t?o["EPSG:"+t.EPSG]=t:"ESRI"in t?o["ESRI:"+t.ESRI]=t:"IAU2000"in t?o["IAU2000:"+t.IAU2000]=t:console.log(t);return}}function h(e){var i=t(e,"authority");if(i){var r=t(i,"epsg");return r&&vt.indexOf(r)>-1}}function u(e){var i=t(e,"extension");if(i)return t(i,"proj4")}function l(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in o}(t))return o[t];if(function(t){return _t.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=gt(t);if(h(e))return o["EPSG:3857"];var i=u(e);return i?ut(i):e}return function(t){return"+"===t[0]}(t)?ut(t):void 0}function c(t){return t}function f(t,e){var i=At.length;return t.names?(At[i]=t,t.names.forEach((function(t){St[t.toLowerCase()]=i})),this):(console.log(e),!0)}function p(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:Tt[t]||null,isNull:!1}}function d(t){return t/3600*Math.PI/180}function m(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function y(t,e,i){for(var r=[],n=0;n<e.nSubgrids;n++){var s=_(t,176,i),a=v(t,176,s,i),o=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),h=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);r.push({ll:[d(s.lowerLongitude),d(s.lowerLatitude)],del:[d(s.longitudeInterval),d(s.latitudeInterval)],lim:[o,h],count:s.gridNodeCount,cvs:g(a)})}return r}function g(t){return t.map((function(t){return[d(t.longitudeShift),d(t.latitudeShift)]}))}function _(t,e,i){return{name:m(t,e+8,e+16).trim(),parent:m(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 v(t,e,i,r){for(var n=e+176,s=[],a=0;a<i.gridNodeCount;a++){var o={latitudeShift:t.getFloat32(n+16*a,r),longitudeShift:t.getFloat32(n+16*a+4,r),latitudeAccuracy:t.getFloat32(n+16*a+8,r),longitudeAccuracy:t.getFloat32(n+16*a+12,r)};s.push(o)}return s}function b(e,i){if(!(this instanceof b))return new b(e);i=i||function(t){if(t)throw t};var r=l(e);if("object"==typeof r){var n=b.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var s=t(Rt,r.datumCode);s&&(r.datum_params=r.datum_params||(s.towgs84?s.towgs84.split(","):null),r.ellps=s.ellipse,r.datumName=s.datumName?s.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var a=function(e,i,r,n,s){if(!e){var a=t(jt,n);a||(a=Ot),e=a.a,i=a.b,r=a.rf}return r&&!i&&(i=(1-1/r)*e),(0===r||Math.abs(e-i)<tt)&&(s=!0,i=e),{a:e,b:i,rf:r,sphere:s}}(r.a,r.b,r.rf,r.ellps,r.sphere),o=function(t,e,i,r){var n=t*t,s=e*e,a=(n-s)/n,o=0;return r?(n=(t*=1-a*(Y+a*(K+a*$)))*t,a=0):o=Math.sqrt(a),{es:a,e:o,ep2:(n-s)/s}}(a.a,a.b,a.rf,r.R_A),h=function(t){return void 0===t?null:t.split(",").map(p)}(r.nadgrids),u=r.datum||function(t,e,i,r,n,s,a){var o={};return o.datum_type=void 0===t||"none"===t?V:X,e&&(o.datum_params=e.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=W),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=H,o.datum_params[3]*=Z,o.datum_params[4]*=Z,o.datum_params[5]*=Z,o.datum_params[6]=o.datum_params[6]/1e6+1))),a&&(o.datum_type=Q,o.grids=a),o.a=i,o.b=r,o.es=n,o.ep2=s,o}(r.datumCode,r.datum_params,a.a,a.b,o.es,o.ep2,h);bt(this,r),bt(this,n),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=u,this.init(),i(null,this)}else i(e)}else i(e)}function w(t,e,i){var r,n,s,a,o=t.x,h=t.y,u=t.z?t.z:0;if(h<-J&&h>-1.001*J)h=-J;else if(h>J&&h<1.001*J)h=J;else{if(h<-J)return{x:-1/0,y:-1/0,z:t.z};if(h>J)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),n=Math.sin(h),a=Math.cos(h),s=n*n,{x:((r=i/Math.sqrt(1-e*s))+u)*a*Math.cos(o),y:(r+u)*a*Math.sin(o),z:(r*(1-e)+u)*n}}function M(t,e,i,r){var n,s,a,o,h,u,l,c,f,p,d,m,y,g,_,v=t.x,b=t.y,w=t.z?t.z:0;if(n=Math.sqrt(v*v+b*b),s=Math.sqrt(v*v+b*b+w*w),n/i<1e-12){if(g=0,s/i<1e-12)return J,_=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(b,v);a=w/s,c=(o=n/s)*(1-e)*(h=1/Math.sqrt(1-e*(2-e)*o*o)),f=a*h,y=0;do{y++,u=e*(l=i/Math.sqrt(1-e*f*f))/(l+(_=n*c+w*f-l*(1-e*f*f))),m=(d=a*(h=1/Math.sqrt(1-u*(2-u)*o*o)))*c-(p=o*(1-u)*h)*f,c=p,f=d}while(m*m>1e-24&&y<30);return{x:g,y:Math.atan(d/Math.abs(p)),z:_}}function x(t){return t===W||t===H}function E(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=[],a=0;a<t.grids.length;a++){var o=t.grids[a];if(s.push(o.name),o.isNull){n=r;break}if(null!==o.grid){var h=o.grid.subgrids[0],u=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,l=h.ll[0]-u,c=h.ll[1]-u,f=h.ll[0]+(h.lim[0]-1)*h.del[0]+u,p=h.ll[1]+(h.lim[1]-1)*h.del[1]+u;if(!(c>r.y||l>r.x||p<r.y||f<r.x||(n=k(r,e,h),isNaN(n.x))))break}else if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*it+" "+r.y*it+" tried: '"+s+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function k(t,e,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var n={x:t.x,y:t.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=xt(n.x-Math.PI)+Math.PI;var s=C(n,i);if(e){if(isNaN(s.x))return r;s.x=n.x-s.x,s.y=n.y-s.y;var a,o,h=9;do{if(o=C(s,i),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:n.x-(o.x+s.x),y:n.y-(o.y+s.y)},s.x+=a.x,s.y+=a.y}while(h--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=xt(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 C(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 u=e.cvs[i][0],l=e.cvs[i][1];i++;var c=e.cvs[i][0],f=e.cvs[i][1];i+=e.lim[0];var p=e.cvs[i][0],d=e.cvs[i][1];i--;var m=e.cvs[i][0],y=e.cvs[i][1],g=a*o,_=a*(1-o),v=(1-a)*(1-o),b=(1-a)*o;return h.x=v*u+_*c+b*m+g*p,h.y=v*l+_*f+b*y+g*d,h}function S(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 A(t,e,i,r){var n;if(Array.isArray(i)&&(i=Lt(i)),Bt(i),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===W||t.datum.datum_type===H)&&"WGS84"!==e.datumCode||(e.datum.datum_type===W||e.datum.datum_type===H)&&"WGS84"!==t.datumCode}(t,e)&&(i=A(t,n=new b("WGS84"),i,r),t=n),r&&"enu"!==t.axis&&(i=Nt(t,!1,i)),"longlat"===t.projName)i={x:i.x*et,y:i.y*et,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=It(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*it,y:i.y*it,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?Nt(e,!0,i):i}function P(t,e,i,r){var n,s,a;return Array.isArray(i)?(n=A(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=A(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 j(t){return t instanceof b?t:t.oProj?t.oProj:b(t)}function O(t,e,i){t=j(t);var r,n=!1;return void 0===e?(e=t,t=Ft,n=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=Ft,n=!0),e=j(e),i?P(t,e,i):(r={forward:function(i,r){return P(t,e,i,r)},inverse:function(i,r){return P(e,t,i,r)}},n&&(r.oProj=e),r)}function R(t,e){return e=e||5,function(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+function(t,e,i){var r=F(i);return function(t,e,i){var r=i-1,n=zt.charCodeAt(r),s=Ut.charCodeAt(r),a=n+t-1,o=s+e,h=!1;return a>Qt&&(a=a-Qt+qt-1,h=!0),(a===Gt||n<Gt&&a>Gt||(a>Gt||n<Gt)&&h)&&a++,(a===Wt||n<Wt&&a>Wt||(a>Wt||n<Wt)&&h)&&++a===Gt&&a++,a>Qt&&(a=a-Qt+qt-1),o>Ht?(o=o-Ht+qt-1,h=!0):h=!1,(o===Gt||s<Gt&&o>Gt||(o>Gt||s<Gt)&&h)&&o++,(o===Wt||s<Wt&&o>Wt||(o>Wt||s<Wt)&&h)&&++o===Gt&&o++,o>Ht&&(o=o-Ht+qt-1),String.fromCharCode(a)+String.fromCharCode(o)}(Math.floor(t/1e5),Math.floor(e/1e5)%20,r)}(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+r.substr(r.length-5,e)}(function(t){var e,i,r,n,s,a,o=t.lat,h=t.lon,u=6378137,l=I(o),c=I(h);a=Math.floor((h+180)/6)+1,180===h&&(a=60),o>=56&&o<64&&h>=3&&h<12&&(a=32),o>=72&&o<84&&(h>=0&&h<9?a=31:h>=9&&h<21?a=33:h>=21&&h<33?a=35:h>=33&&h<42&&(a=37)),s=I(6*(a-1)-180+3),e=u/Math.sqrt(1-.00669438*Math.sin(l)*Math.sin(l)),i=Math.tan(l)*Math.tan(l),r=.006739496752268451*Math.cos(l)*Math.cos(l);var f=.9996*e*((n=Math.cos(l)*(c-s))+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,p=.9996*(u*(.9983242984503243*l-.002514607064228144*Math.sin(2*l)+2639046602129982e-21*Math.sin(4*l)-3.418046101696858e-9*Math.sin(6*l))+e*Math.tan(l)*(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));return o<0&&(p+=1e7),{northing:Math.round(p),easting:Math.round(f),zoneNumber:a,zoneLetter:B(o)}}({lat:t[1],lon:t[0]}),e)}function T(t){var e=L(D(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function I(t){return t*(Math.PI/180)}function N(t){return t/Math.PI*180}function L(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,u,l,c,f,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=e;r<"N"&&(y-=1e7),l=6*(n-1)-180+3,f=(c=y/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*c)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*c)+151*d*d*d/96*Math.sin(6*c),s=p/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),a=Math.tan(f)*Math.tan(f),o=.006739496752268451*Math.cos(f)*Math.cos(f),h=.99330562*p/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),u=m/(.9996*s);var g=f-s*Math.tan(f)/h*(u*u/2-(5+3*a+10*o-4*o*o-.06065547077041606)*u*u*u*u/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*u*u*u*u*u*u/720);g=N(g);var _,v=(u-(1+2*a+o)*u*u*u/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*u*u*u*u*u/120)/Math.cos(f);v=l+N(v);if(t.accuracy){var b=L({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});_={top:b.lat,right:b.lon,bottom:g,left:v}}else _={lat:g,lon:v};return _}function B(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 F(t){var e=t%Dt;return 0===e&&(e=Dt),e}function D(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=F(a),u=function(t,e){for(var i=zt.charCodeAt(e-1),r=1e5,n=!1;i!==t.charCodeAt(0);){if(++i===Gt&&i++,i===Wt&&i++,i>Qt){if(n)throw"Bad character: "+t;i=qt,n=!0}r+=1e5}return r}(r.charAt(0),h),l=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Ut.charCodeAt(e-1),r=0,n=!1;i!==t.charCodeAt(0);){if(++i===Gt&&i++,i===Wt&&i++,i>Ht){if(n)throw"Bad character: "+t;i=qt,n=!0}r+=1e5}return r}(r.charAt(1),h);l<z(o);)l+=2e6;var c=i-s;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,m=c/2,y=0,g=0;return m>0&&(f=1e5/Math.pow(10,m),p=t.substring(s,s+m),y=parseFloat(p)*f,d=t.substring(s+m),g=parseFloat(d)*f),{easting:y+u,northing:g+l,zoneLetter:o,zoneNumber:a,accuracy:f}}function z(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 U(t,e,i){if(!(this instanceof U))return new U(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")}function q(t,e,i,r){var n;return t<tt?(r.value=Ke.AREA_0,n=0):(n=Math.atan2(e,i),Math.abs(n)<=rt?r.value=Ke.AREA_0:n>rt&&n<=J+rt?(r.value=Ke.AREA_1,n-=J):n>J+rt||n<=-(J+rt)?(r.value=Ke.AREA_2,n=n>=0?n-st:n+st):(r.value=Ke.AREA_3,n+=J)),n}function G(t,e){var i=t+e;return i<-st?i+=nt:i>+st&&(i-=nt),i}var W=1,H=2,Q=3,X=4,V=5,Z=484813681109536e-20,J=Math.PI/2,Y=.16666666666666666,K=.04722222222222222,$=.022156084656084655,tt=1e-10,et=.017453292519943295,it=57.29577951308232,rt=Math.PI/4,nt=2*Math.PI,st=3.14159265359,at={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},ot={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},ht=/[\s_\-\/\(\)]/g,ut=function(e){var i,r,n,s={},a=e.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t}),{}),o={proj:"projName",datum:"datumCode",rf:function(t){s.rf=parseFloat(t)},lat_0:function(t){s.lat0=t*et},lat_1:function(t){s.lat1=t*et},lat_2:function(t){s.lat2=t*et},lat_ts:function(t){s.lat_ts=t*et},lon_0:function(t){s.long0=t*et},lon_1:function(t){s.long1=t*et},lon_2:function(t){s.long2=t*et},alpha:function(t){s.alpha=parseFloat(t)*et},gamma:function(t){s.rectified_grid_angle=parseFloat(t)},lonc:function(t){s.longc=t*et},x_0:function(t){s.x0=parseFloat(t)},y_0:function(t){s.y0=parseFloat(t)},k_0:function(t){s.k0=parseFloat(t)},k:function(t){s.k0=parseFloat(t)},a:function(t){s.a=parseFloat(t)},b:function(t){s.b=parseFloat(t)},r_a:function(){s.R_A=!0},zone:function(t){s.zone=parseInt(t,10)},south:function(){s.utmSouth=!0},towgs84:function(t){s.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){s.to_meter=parseFloat(t)},units:function(e){s.units=e;var i=t(ot,e);i&&(s.to_meter=i.to_meter)},from_greenwich:function(t){s.from_greenwich=t*et},pm:function(e){var i=t(at,e);s.from_greenwich=(i||parseFloat(e))*et},nadgrids:function(t){"@null"===t?s.datumCode="none":s.nadgrids=t},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(s.axis=t)},approx:function(){s.approx=!0}};for(i in a)r=a[i],i in o?"function"==typeof(n=o[i])?n(r):s[n]=r:s[i]=r;return"string"==typeof s.datumCode&&"WGS84"!==s.datumCode&&(s.datumCode=s.datumCode.toLowerCase()),s},lt=1,ct=/\s/,ft=/[A-Za-z]/,pt=/[A-Za-z84]/,dt=/[,\]]/,mt=/[\d\.E\-\+]/;e.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;ct.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case lt: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}},e.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(dt.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)},e.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=lt)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=lt,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},e.prototype.number=function(t){if(!mt.test(t)){if(dt.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},e.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},e.prototype.keyword=function(t){if(pt.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=lt)}if(!dt.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},e.prototype.neutral=function(t){if(ft.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(mt.test(t))return this.word=t,void(this.state=3);if(!dt.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},e.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var yt=.017453292519943295,gt=function(t){var e=i(t),r=e.shift(),s=e.shift();e.unshift(["name",s]),e.unshift(["type",r]);var o={};return n(e,o),a(o),o};!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"]}(o);var _t=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],vt=["3857","900913","3785","102113"],bt=function(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t},wt=function(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)},Mt=function(t){return t<0?-1:1},xt=function(t){return Math.abs(t)<=st?t:t-Mt(t)*nt},Et=function(t,e,i){var r=t*i,n=.5*t;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(J-e))/r},kt=function(t,e){for(var i,r,n=.5*t,s=J-2*Math.atan(e),a=0;a<=15;a++)if(i=t*Math.sin(s),s+=r=J-2*Math.atan(e*Math.pow((1-i)/(1+i),n))-s,Math.abs(r)<=1e-10)return s;return-9999},Ct=[{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=wt(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,n=t.y;if(n*it>90&&n*it<-90&&r*it>180&&r*it<-180)return null;if(Math.abs(Math.abs(n)-J)<=tt)return null;if(this.sphere)e=this.x0+this.a*this.k0*xt(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(rt+.5*n));else{var s=Math.sin(n),a=Et(this.e,n,s);e=this.x0+this.a*this.k0*xt(r-this.long0),i=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,r=t.x-this.x0,n=t.y-this.y0;if(this.sphere)i=J-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(i=kt(this.e,s)))return null}return e=xt(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:c,inverse:c,names:["longlat","identity"]}],St={},At=[],Pt={start:function(){Ct.forEach(f)},add:f,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==St[e]&&At[St[e]]?At[St[e]]:void 0}},jt={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"}},Ot=jt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};jt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Rt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Tt={};b.projections=Pt,b.projections.start();var It=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)&&(t.datum_type===W?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_type!==H||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(t.datum_type===V||e.datum_type===V)return i;var r=t.a,n=t.es;if(t.datum_type===Q){if(0!==E(t,!1,i))return;r=6378137,n=.0066943799901413165}var s=e.a,a=e.b,o=e.es;return e.datum_type===Q&&(s=6378137,a=6356752.314,o=.0066943799901413165),n!==o||r!==s||x(t.datum_type)||x(e.datum_type)?(i=w(i,n,r),x(t.datum_type)&&(i=function(t,e,i){if(e===W)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===H){var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],h=i[5],u=i[6];return{x:u*(t.x-h*t.y+o*t.z)+r,y:u*(h*t.x+t.y-a*t.z)+n,z:u*(-o*t.x+a*t.y+t.z)+s}}}(i,t.datum_type,t.datum_params)),x(e.datum_type)&&(i=function(t,e,i){if(e===W)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===H){var r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],h=i[5],u=i[6],l=(t.x-r)/u,c=(t.y-n)/u,f=(t.z-s)/u;return{x:l+h*c-o*f,y:-h*l+c+a*f,z:o*l-a*c+f}}}(i,e.datum_type,e.datum_params)),i=M(i,o,s,a),e.datum_type!==Q||0===E(e,!0,i)?i:void 0):i},Nt=function(t,e,i){var r,n,s,a=i.x,o=i.y,h=i.z||0,u={};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":case"n":u[n]=r;break;case"w":case"s":u[n]=-r;break;case"u":void 0!==i[n]&&(u.z=r);break;case"d":void 0!==i[n]&&(u.z=-r);break;default:return null}return u},Lt=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},Bt=function(t){S(t.x),S(t.y)},Ft=b("WGS84"),Dt=6,zt="AJSAJS",Ut="AFAFAF",qt=65,Gt=73,Wt=79,Ht=86,Qt=90,Xt={forward:R,inverse:function(t){var e=L(D(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:T};U.fromMGRS=function(t){return new U(T(t))},U.prototype.toMGRS=function(t){return R([this.x,this.y],t)};var Vt=.01068115234375,Zt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Vt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Vt)));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},Jt=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])))},Yt=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=(Jt(n,a,Math.cos(n),i)-t)*(o*Math.sqrt(o))*r,Math.abs(o)<tt)return n}return n},Kt={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=Zt(this.es),this.ml0=Jt(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=xt(n-this.long0),o=Math.sin(s),h=Math.cos(s);if(this.es){var u=h*a,l=Math.pow(u,2),c=this.ep2*Math.pow(h,2),f=Math.pow(c,2),p=Math.abs(h)>tt?Math.tan(s):0,d=Math.pow(p,2),m=Math.pow(d,2);e=1-this.es*Math.pow(o,2),u/=Math.sqrt(e);var y=Jt(s,o,h,this.en);i=this.a*(this.k0*u*(1+l/6*(1-d+c+l/20*(5-18*d+m+14*c-58*d*c+l/42*(61+179*m-m*d-479*d)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+o*a*u/2*(1+l/12*(5-d+9*c+4*f+l/30*(61+m-58*d+270*c-330*d*c+l/56*(1385+543*m-m*d-3111*d))))))+this.y0}else{var g=h*Math.sin(a);if(Math.abs(Math.abs(g)-1)<tt)return 93;if(i=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,r=h*Math.cos(a)/Math.sqrt(1-Math.pow(g,2)),(g=Math.abs(r))>=1){if(g-1>tt)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,n,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+a/this.k0,i=Yt(e,this.es,this.en),Math.abs(i)<J){var o=Math.sin(i),h=Math.cos(i),u=Math.abs(h)>tt?Math.tan(i):0,l=this.ep2*Math.pow(h,2),c=Math.pow(l,2),f=Math.pow(u,2),p=Math.pow(f,2);e=1-this.es*Math.pow(o,2);var d=s*Math.sqrt(e)/this.k0,m=Math.pow(d,2);r=i-(e*=u)*m/(1-this.es)*.5*(1-m/12*(5+3*f-9*l*f+l-4*c-m/30*(61+90*f-252*l*f+45*p+46*l-m/56*(1385+3633*f+4095*p+1574*p*f)))),n=xt(this.long0+d*(1-m/6*(1+2*f+l-m/20*(5+28*f+24*p+8*l*f+6*l-m/42*(61+662*f+1320*p+720*p*f))))/h)}else r=J*Mt(a),n=0;else{var y=Math.exp(s/this.k0),g=.5*(y-1/y),_=this.lat0+a/this.k0,v=Math.cos(_);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(g,2))),r=Math.asin(e),a<0&&(r=-r),n=0===g&&0===v?0:xt(Math.atan2(g,v)+this.long0)}return t.x=n,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},$t=function(t){var e=Math.exp(t);return(e-1/e)/2},te=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))},ee=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/(te(1,e)+1))),t<0?-e:e},ie=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)},re=function(t,e,i){for(var r,n,s=Math.sin(e),a=Math.cos(e),o=$t(i),h=function(t){var e=Math.exp(t);return(e+1/e)/2}(i),u=2*a*h,l=-2*s*o,c=t.length-1,f=t[c],p=0,d=0,m=0;--c>=0;)r=d,n=p,f=u*(d=f)-r-l*(p=m)+t[c],m=l*d-n+u*p;return[(u=s*h)*f-(l=a*o)*m,u*m+l*f]},ne={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&&(Kt.init.apply(this),this.forward=Kt.forward,this.inverse=Kt.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*(.25+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]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=ie(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=xt(t.x-this.long0),i=t.y;i=ie(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,te(r,n*a)),e=ee(Math.tan(e));var o,h,u=re(this.gtu,2*i,2*e);i+=u[0],e+=u[1];return 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);n=(n-this.Zb)/this.Qn,r/=this.Qn;if(Math.abs(r)<=2.623395162778){var s=re(this.utg,2*n,2*r);n+=s[0],r+=s[1],r=Math.atan($t(r));var a=Math.sin(n),o=Math.cos(n),h=Math.sin(r),u=Math.cos(r);n=Math.atan2(a*u,te(h,u*o)),r=Math.atan2(h,u*o),e=xt(r+this.long0),i=ie(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"]},se={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(xt(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)*et,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ne.init.apply(this),this.forward=ne.forward,this.inverse=ne.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ae=function(t,e){return Math.pow((1-t)/(1+t),e)},oe={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+rt)/(Math.pow(Math.tan(.5*this.lat0+rt),this.C)*ae(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+rt),this.C)*ae(this.e*Math.sin(i),this.ratexp))-J,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+rt)/this.K,1/this.C),n=20;n>0&&(i=2*Math.atan(r*ae(this.e*Math.sin(t.y),-.5*this.e))-J,!(Math.abs(i-t.y)<1e-14));--n)t.y=i;return n?(t.x=e,t.y=i,t):null},names:["gauss"]},he={init:function(){oe.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=xt(t.x-this.long0),oe.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,oe.inverse.apply(this,[t]),t.x=xt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ue={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)<=tt&&(this.k0=.5*(1+Mt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=tt&&(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)<=tt&&(this.k0=.5*this.cons*wt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Et(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=wt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-J,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,i,r,n,s,a,o=t.x,h=t.y,u=Math.sin(h),l=Math.cos(h),c=xt(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=tt&&Math.abs(h+this.lat0)<=tt?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*u+this.coslat0*l*Math.cos(c)),t.x=this.a*e*l*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*u-this.sinlat0*l*Math.cos(c))+this.y0,t):(i=2*Math.atan(this.ssfn_(h,u,this.e))-J,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=tt?(s=Et(this.e,h*this.con,this.con*u),a=2*this.a*this.k0*s/this.cons,t.x=this.x0+a*Math.sin(o-this.long0),t.y=this.y0-this.con*a*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<tt?(e=2*this.a*this.k0/(1+n*Math.cos(c)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(c))),t.y=e*(this.cosX0*r-this.sinX0*n*Math.cos(c))+this.y0),t.x=e*n*Math.sin(c)+this.x0,t))},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,i=this.lat0,a<=tt?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/a),e=xt(Math.abs(this.coslat0)<tt?this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(o),a*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=tt){if(a<=tt)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,r=a*this.cons/(2*this.a*this.k0),i=this.con*kt(this.e,r),e=this.con*xt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=tt?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/a),e=xt(this.long0+Math.atan2(t.x*Math.sin(n),a*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),i=-1*kt(this.e,Math.tan(.5*(J+s)));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*(J+t))*Math.pow((1-e)/(1+e),.5*i)}},le={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,u=s,l=-1e3,c=0;Math.abs(u-l)>1e-7;){if(++c>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(u))/2)),l=u,u=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=u,t},names:["somerc"]},ce=1e-7,fe={init:function(){var t,e,i,r,n,s,a,o,h,u,l,c=0,f=0,p=0,d=0,m=0,y=0,g=0;this.no_off=function(t){var e="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(e)}(this),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var v=!1;if("rectified_grid_angle"in this&&(v=!0),_&&(g=this.alpha),v&&(c=this.rectified_grid_angle*et),_||v)f=this.longc;else if(p=this.long1,m=this.lat1,d=this.long2,y=this.lat2,Math.abs(m-y)<=ce||(t=Math.abs(m))<=ce||Math.abs(t-J)<=ce||Math.abs(Math.abs(this.lat0)-J)<=ce||Math.abs(Math.abs(y)-J)<=ce)throw new Error;var b=1-this.es;e=Math.sqrt(b),Math.abs(this.lat0)>tt?(o=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*o*o,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*e/t,(n=(r=this.B*e/(i*Math.sqrt(t)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(Et(this.e,this.lat0,o),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=n=1),_||v?(_?(l=Math.asin(Math.sin(g)/r),v||(c=g)):(l=c,g=Math.asin(r*Math.sin(l))),this.lam0=f-Math.asin(.5*(n-1/n)*Math.tan(l))/this.B):(s=Math.pow(Et(this.e,m,Math.sin(m)),this.B),a=Math.pow(Et(this.e,y,Math.sin(y)),this.B),n=this.E/s,h=(a-s)/(a+s),u=((u=this.E*this.E)-a*s)/(u+a*s),(t=p-d)<-Math.pi?d-=nt:t>Math.pi&&(d+=nt),this.lam0=xt(.5*(p+d)-Math.atan(u*Math.tan(.5*this.B*(p-d))/h)/this.B),l=Math.atan(2*Math.sin(this.B*xt(p-this.lam0))/(n-1/n)),c=g=Math.asin(r*Math.sin(l))),this.singam=Math.sin(l),this.cosgam=Math.cos(l),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(g))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*l,this.v_pole_n=this.ArB*Math.log(Math.tan(rt-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(rt+n))},forward:function(t){var e,i,r,n,s,a,o,h,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-J)>tt){if(e=.5*((s=this.E/Math.pow(Et(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/s)),i=.5*(s+a),n=Math.sin(this.B*t.x),r=(e*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<tt)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*t.x),o=Math.abs(a)<ce?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+n*this.singam,a)}else h=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(u.x=o,u.y=h):(o-=this.u_0,u.x=h*this.cosrot+o*this.sinrot,u.y=o*this.cosrot-h*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,n,s,a,o,h={};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),n=.5*((r=Math.exp(-this.BrA*i))-1/r),s=.5*(r+1/r),o=((a=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(o)-1)<tt)h.x=0,h.y=o<0?-J:J;else{if(h.y=this.E/Math.sqrt((1+o)/(1-o)),h.y=kt(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(n*this.cosgam-a*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h},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"]},pe={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)<tt)){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=wt(this.e,e,i),n=Et(this.e,this.lat1,e),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=wt(this.e,s,a),h=Et(this.e,this.lat2,s),u=Et(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>tt?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(u,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)<=tt&&(i=Mt(i)*(J-2*tt));var r,n,s=Math.abs(Math.abs(i)-J);if(s>tt)r=Et(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((s=i*this.ns)<=0)return null;n=0}var a=this.ns*xt(e-this.long0);return t.x=this.k0*(n*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(a))+this.y0,t},inverse:function(t){var e,i,r,n,s,a=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+o*o),i=1):(e=-Math.sqrt(a*a+o*o),i=-1);var h=0;if(0!==e&&(h=Math.atan2(i*a,i*o)),0!==e||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),-9999===(n=kt(this.e,r)))return null}else n=-J;return s=xt(h/this.ns+this.long0),t.x=s,t.y=n,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)"]},de={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,u=t.y,l=xt(h-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-l*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 u=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,u+=1}while(0===o&&u<15);return u>=15?null:t},names:["Krovak","krovak"]},me=function(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},ye=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},ge=function(t){return.375*t*(1+.25*t*(1+.46875*t))},_e=function(t){return.05859375*t*t*(1+.75*t)},ve=function(t){return t*t*t*(35/3072)},be=function(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)},we=function(t){return Math.abs(t)<J?t:t-Mt(t)*Math.PI},Me=function(t,e,i,r,n){var s,a;s=t/e;for(var o=0;o<15;o++)if(s+=a=(t-(e*s-i*Math.sin(2*s)+r*Math.sin(4*s)-n*Math.sin(6*s)))/(e-2*i*Math.cos(2*s)+4*r*Math.cos(4*s)-6*n*Math.cos(6*s)),Math.abs(a)<=1e-10)return s;return NaN},xe={init:function(){this.sphere||(this.e0=ye(this.es),this.e1=ge(this.es),this.e2=_e(this.es),this.e3=ve(this.es),this.ml0=this.a*me(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,i,r=t.x,n=t.y;if(r=xt(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var s=Math.sin(n),a=Math.cos(n),o=be(this.a,this.e,s),h=Math.tan(n)*Math.tan(n),u=r*Math.cos(n),l=u*u,c=this.es*a*a/(1-this.es);e=o*u*(1-l*h*(1/6-(8-h+8*c)*l/120)),i=this.a*me(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*s/a*l*(.5+(5-h+6*c)*l/24)}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r=t.x/this.a,n=t.y/this.a;if(this.sphere){var s=n+this.lat0;e=Math.asin(Math.sin(s)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=this.ml0/this.a+n,o=Me(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-J)<=tt)return t.x=this.long0,t.y=J,n<0&&(t.y*=-1),t;var h=be(this.a,this.e,Math.sin(o)),u=h*h*h/this.a/this.a*(1-this.es),l=Math.pow(Math.tan(o),2),c=r*this.a/h,f=c*c;e=o-h*Math.tan(o)/u*c*c*(.5-(1+3*l)*c*c/24),i=c*(1-f*(l/3+(1+3*l)*l*f/15))/Math.cos(o)}return t.x=xt(i+this.long0),t.y=we(e),t},names:["Cassini","Cassini_Soldner","cass"]},Ee=function(t,e){var i;return t>1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e},ke=.3333333333333333,Ce=.17222222222222222,Se=.10257936507936508,Ae=.06388888888888888,Pe=.0664021164021164,je=.016415012942191543,Oe={init:function(){var t=Math.abs(this.lat0);if(Math.abs(t-J)<tt?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<tt?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=Ee(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=t*ke,e=t*t,i[0]+=e*Ce,i[1]=e*Ae,e*=t,i[0]+=e*Se,i[1]+=e*Pe,i[2]=e*je,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),e=Math.sin(this.lat0),this.sinb1=Ee(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*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,n,s,a,o,h,u,l,c=t.x,f=t.y;if(c=xt(c-this.long0),this.sphere){if(s=Math.sin(f),l=Math.cos(f),r=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+l*r:1+this.sinph0*s+this.cosph0*l*r)<=tt)return null;e=(i=Math.sqrt(2/i))*l*Math.sin(c),i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*l*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<tt)return null;i=rt-.5*f,e=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(c),i*=r}}else{switch(o=0,h=0,u=0,r=Math.cos(c),n=Math.sin(c),s=Math.sin(f),a=Ee(this.e,s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=a/this.qp,h=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:u=1+this.sinb1*o+this.cosb1*h*r;break;case this.EQUIT:u=1+h*r;break;case this.N_POLE:u=J+f,a=this.qp-a;break;case this.S_POLE:u=f-J,a=this.qp+a}if(Math.abs(u)<tt)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),i=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*o-this.sinb1*h*r):(u=Math.sqrt(2/(1+h*r)))*o*this.ymf,e=this.xmf*u*h*n;break;case this.N_POLE:case this.S_POLE:a>=0?(e=(u=Math.sqrt(a))*n,i=r*(this.mode===this.S_POLE?u:-u)):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,n,s,a,o,h=t.x/this.a,u=t.y/this.a;if(this.sphere){var l,c=0,f=0;if((i=.5*(l=Math.sqrt(h*h+u*u)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(l)<=tt?0:Math.asin(u*f/l),h*=f,u=c*l;break;case this.OBLIQ:i=Math.abs(l)<=tt?this.lat0:Math.asin(c*this.sinph0+u*f*this.cosph0/l),h*=f*this.cosph0,u=(c-Math.sin(i)*this.sinph0)*l;break;case this.N_POLE:u=-u,i=J-i;break;case this.S_POLE:i-=J}e=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(h,u):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,u*=this.dd,(a=Math.sqrt(h*h+u*u))<tt)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*a/this.rq),r=Math.cos(n),h*=n=Math.sin(n),this.mode===this.OBLIQ?(o=r*this.sinb1+u*n*this.cosb1/a,s=this.qp*o,u=a*this.cosb1*r-u*this.sinb1*n):(o=u*n/a,s=this.qp*o,u=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(s=h*h+u*u))return t.x=this.long0,t.y=this.lat0,t;o=1-s/this.qp,this.mode===this.S_POLE&&(o=-o)}e=Math.atan2(h,u),i=function(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}(Math.asin(o),this.apa)}return t.x=xt(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},Re=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},Te={init:function(){Math.abs(this.lat1+this.lat2)<tt||(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=wt(this.e3,this.sin_po,this.cos_po),this.qs1=Ee(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=wt(this.e3,this.sin_po,this.cos_po),this.qs2=Ee(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=Ee(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>tt?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=Ee(this.e3,this.sin_phi,this.cos_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*xt(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=xt(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=Re(.5*e);if(t<tt)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}},Ie={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,u=t.y;return r=xt(h-this.long0),e=Math.sin(u),i=Math.cos(u),n=Math.cos(r),(s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=tt?(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=Re(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=xt(this.long0+s)):(a=this.phic0,s=0),t.x=s,t.y=a,t},names:["gnom"]},Ne={init:function(){this.sphere||(this.k0=wt(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=xt(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=Ee(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){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=xt(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*J:J;for(var r,n,s,a,o=Math.asin(.5*e),h=0;h<30;h++)if(n=Math.sin(o),s=Math.cos(o),a=t*n,o+=r=Math.pow(1-a*a,2)/(2*s)*(e/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),e=xt(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t},names:["cea"]},Le={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=xt(e-this.long0),n=we(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=xt(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=we(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Be={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ye(this.es),this.e1=ge(this.es),this.e2=_e(this.es),this.e3=ve(this.es),this.ml0=this.a*me(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,r,n=t.x,s=t.y,a=xt(n-this.long0);if(r=a*Math.sin(s),this.sphere)Math.abs(s)<=tt?(e=this.a*a,i=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(s),i=this.a*(we(s-this.lat0)+(1-Math.cos(r))/Math.tan(s)));else if(Math.abs(s)<=tt)e=this.a*a,i=-1*this.ml0;else{var o=be(this.a,this.e,Math.sin(s))/Math.tan(s);e=o*Math.sin(r),i=this.a*me(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,u;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=tt)e=xt(r/this.a+this.long0),i=0;else{a=this.lat0+n/this.a,o=r*r/this.a/this.a+a*a,h=a;var l;for(s=20;s;--s)if(h+=u=-1*(a*(h*(l=Math.tan(h))+1)-h-.5*(h*h+o)*l)/((h-a)/l-1),Math.abs(u)<=tt){i=h;break}e=xt(this.long0+Math.asin(r*Math.tan(h)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=tt)i=0,e=xt(this.long0+r/this.a);else{a=(this.ml0+n)/this.a,o=r*r/this.a/this.a+a*a,h=a;var c,f,p,d,m;for(s=20;s;--s)if(m=this.e*Math.sin(h),c=Math.sqrt(1-m*m)*Math.tan(h),f=this.a*me(this.e0,this.e1,this.e2,this.e3,h),p=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),h-=u=(a*(c*(d=f/this.a)+1)-d-.5*c*(d*d+o))/(this.es*Math.sin(2*h)*(d*d+o-2*a*d)/(4*c)+(a-d)*(c*p-2/Math.sin(2*h))-p),Math.abs(u)<=tt){i=h;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=xt(this.long0+Math.asin(r*c/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]},Fe={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,r=t.y-this.lat0,n=i-this.long0,s=r/Z*1e-5,a=n,o=1,h=0;for(e=1;e<=10;e++)o*=s,h+=this.A[e]*o;var u,l=h,c=a,f=1,p=0,d=0,m=0;for(e=1;e<=6;e++)u=p*l+f*c,f=f*l-p*c,p=u,d=d+this.B_re[e]*f-this.B_im[e]*p,m=m+this.B_im[e]*f+this.B_re[e]*p;return t.x=m*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,i,r=t.x,n=t.y,s=r-this.x0,a=(n-this.y0)/this.a,o=s/this.a,h=1,u=0,l=0,c=0;for(e=1;e<=6;e++)i=u*a+h*o,h=h*a-u*o,u=i,l=l+this.C_re[e]*h-this.C_im[e]*u,c=c+this.C_im[e]*h+this.C_re[e]*u;for(var f=0;f<this.iterations;f++){var p,d=l,m=c,y=a,g=o;for(e=2;e<=6;e++)p=m*l+d*c,d=d*l-m*c,m=p,y+=(e-1)*(this.B_re[e]*d-this.B_im[e]*m),g+=(e-1)*(this.B_im[e]*d+this.B_re[e]*m);d=1,m=0;var _=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)p=m*l+d*c,d=d*l-m*c,m=p,_+=e*(this.B_re[e]*d-this.B_im[e]*m),v+=e*(this.B_im[e]*d+this.B_re[e]*m);var b=_*_+v*v;l=(y*_+g*v)/b,c=(g*_-y*v)/b}var w=l,M=c,x=1,E=0;for(e=1;e<=9;e++)x*=w,E+=this.D[e]*x;var k=this.lat0+E*Z*1e5,C=this.long0+M;return t.x=C,t.y=k,t},names:["New_Zealand_Map_Grid","nzmg"]},De={init:function(){},forward:function(t){var e=t.x,i=t.y,r=xt(e-this.long0),n=this.x0+this.a*r,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=n,t.y=s,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=xt(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t},names:["Miller_Cylindrical","mill"]},ze={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Zt(this.es)},forward:function(t){var e,i,r=t.x,n=t.y;if(r=xt(r-this.long0),this.sphere){if(this.m)for(var s=this.n*Math.sin(n),a=20;a;--a){var o=(this.m*n+Math.sin(n)-s)/(this.m+Math.cos(n));if(n-=o,Math.abs(o)<tt)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;e=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var h=Math.sin(n),u=Math.cos(n);i=this.a*Jt(n,h,u,this.en),e=this.a*r*u/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,r/=this.C_x*(this.m+Math.cos(e)),this.m?e=Re((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=Re(Math.sin(e)/this.n)),r=xt(r+this.long0),e=we(e)):(e=Yt(t.y/this.a,this.es,this.en),(n=Math.abs(e))<J?(n=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(e)),r=xt(i)):n-tt<J&&(r=this.long0)),t.x=r,t.y=e,t},names:["Sinusoidal","sinu"]},Ue={init:function(){},forward:function(t){for(var e=t.x,i=t.y,r=xt(e-this.long0),n=i,s=Math.PI*Math.sin(i);;){var a=-(n+Math.sin(n)-s)/(1+Math.cos(n));if(n+=a,Math.abs(a)<tt)break}n/=2,Math.PI/2-Math.abs(i)<tt&&(r=0);var o=.900316316158*this.a*r*Math.cos(n)+this.x0,h=1.4142135623731*this.a*Math.sin(n)+this.y0;return t.x=o,t.y=h,t},inverse:function(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var r=xt(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"]},qe={init:function(){Math.abs(this.lat1+this.lat2)<tt||(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=ye(this.es),this.e1=ge(this.es),this.e2=_e(this.es),this.e3=ve(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=wt(this.e,this.sinphi,this.cosphi),this.ml1=me(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<tt?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=wt(this.e,this.sinphi,this.cosphi),this.ml2=me(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=me(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=me(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-n)}var s=this.ns*xt(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){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,r,n;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=xt(this.long0+s/this.ns),r=we(this.g-i/this.a),t.x=n,t.y=r,t;var a=this.g-i/this.a;return r=Me(a,this.e0,this.e1,this.e2,this.e3),n=xt(this.long0+s/this.ns),t.x=n,t.y=r,t},names:["Equidistant_Conic","eqdc"]},Ge={init:function(){this.R=this.a},forward:function(t){var e,i,r=t.x,n=t.y,s=xt(r-this.long0);Math.abs(n)<=tt&&(e=this.x0+this.R*s,i=this.y0);var a=Re(2*Math.abs(n/Math.PI));(Math.abs(s)<=tt||Math.abs(Math.abs(n)-J)<=tt)&&(e=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/s-s/Math.PI),h=o*o,u=Math.sin(a),l=Math.cos(a),c=l/(u+l-1),f=c*c,p=c*(2/u-1),d=p*p,m=Math.PI*this.R*(o*(c-d)+Math.sqrt(h*(c-d)*(c-d)-(d+h)*(f-d)))/(d+h);s<0&&(m=-m),e=this.x0+m;var y=h+c;return m=Math.PI*this.R*(p*y-o*Math.sqrt((d+h)*(h+1)-y*y))/(d+h),i=n>=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,u,l,c,f;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,s=(r=t.x/c)*r+(n=t.y/c)*n,c=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)/(u=(a-o*o/3/h)/h)/(l=2*Math.sqrt(-u/3)),Math.abs(c)>1&&(c=c>=0?1:-1),f=Math.acos(c)/3,i=t.y>=0?(-l*Math.cos(f+Math.PI/3)-o/3/h)*Math.PI:-(-l*Math.cos(f+Math.PI/3)-o/3/h)*Math.PI,e=Math.abs(r)<tt?this.long0:xt(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"]},We={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,i,r,n,s,a,o,h,u,l,c,f,p,d,m,y,g,_,v,b,w,M,x=t.x,E=t.y,k=Math.sin(t.y),C=Math.cos(t.y),S=xt(x-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=tt?(t.x=this.x0+this.a*(J-E)*Math.sin(S),t.y=this.y0-this.a*(J-E)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=tt?(t.x=this.x0+this.a*(J+E)*Math.sin(S),t.y=this.y0+this.a*(J+E)*Math.cos(S),t):(_=this.sin_p12*k+this.cos_p12*C*Math.cos(S),g=(y=Math.acos(_))?y/Math.sin(y):1,t.x=this.x0+this.a*g*C*Math.sin(S),t.y=this.y0+this.a*g*(this.cos_p12*k-this.sin_p12*C*Math.cos(S)),t):(e=ye(this.es),i=ge(this.es),r=_e(this.es),n=ve(this.es),Math.abs(this.sin_p12-1)<=tt?(s=this.a*me(e,i,r,n,J),a=this.a*me(e,i,r,n,E),t.x=this.x0+(s-a)*Math.sin(S),t.y=this.y0-(s-a)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=tt?(s=this.a*me(e,i,r,n,J),a=this.a*me(e,i,r,n,E),t.x=this.x0+(s+a)*Math.sin(S),t.y=this.y0+(s+a)*Math.cos(S),t):(o=k/C,h=be(this.a,this.e,this.sin_p12),u=be(this.a,this.e,k),l=Math.atan((1-this.es)*o+this.es*h*this.sin_p12/(u*C)),v=0===(c=Math.atan2(Math.sin(S),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(S)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(c)-Math.PI)<=tt?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(S)*Math.cos(l)/Math.sin(c)),f=this.e*this.sin_p12/Math.sqrt(1-this.es),y=h*v*(1-(b=v*v)*(m=(p=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*p)*(1-m)/6+(w=b*v)/8*(d=f*p)*(1-2*m)+(M=w*v)/120*(m*(4-7*m)-3*f*f*(1-7*m))-M*v/48*d),t.x=this.x0+y*Math.sin(c),t.y=this.y0+y*Math.cos(c),t))},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,s,a,o,h,u,l,c,f,p,d,m,y,g,_,v,b,w,M,x;if(this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*J*this.a)return;return i=e/this.a,r=Math.sin(i),n=Math.cos(i),s=this.long0,Math.abs(e)<=tt?a=this.lat0:(a=Re(n*this.sin_p12+t.y*r*this.cos_p12/e),o=Math.abs(this.lat0)-J,s=xt(Math.abs(o)<=tt?this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))),t.x=s,t.y=a,t}return h=ye(this.es),u=ge(this.es),l=_e(this.es),c=ve(this.es),Math.abs(this.sin_p12-1)<=tt?(f=this.a*me(h,u,l,c,J),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Me((f-e)/this.a,h,u,l,c),s=xt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=a,t):Math.abs(this.sin_p12+1)<=tt?(f=this.a*me(h,u,l,c,J),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Me((e-f)/this.a,h,u,l,c),s=xt(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),p=be(this.a,this.e,this.sin_p12),y=Math.cos(m),_=-(g=this.e*this.cos_p12*y)*g/(1-this.es),v=3*this.es*(1-_)*this.sin_p12*this.cos_p12*y/(1-this.es),M=1-_*(w=(b=e/p)-_*(1+_)*Math.pow(b,3)/6-v*(1+3*_)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,d=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=xt(this.long0+Math.asin(Math.sin(m)*Math.sin(w)/Math.cos(d))),x=Math.sin(d),a=Math.atan2((x-this.es*M*this.sin_p12)*Math.tan(d),x*(1-this.es)),t.x=s,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]},He={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,u=t.y;return r=xt(h-this.long0),e=Math.sin(u),i=Math.cos(u),n=Math.cos(r),((s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=tt)&&(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,n,s,a,o;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=Re(e/this.a),r=Math.sin(i),n=Math.cos(i),a=this.long0,Math.abs(e)<=tt?(o=this.lat0,t.x=a,t.y=o,t):(o=Re(n*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.abs(this.lat0)-J,Math.abs(s)<=tt?(a=xt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=o,t):(a=xt(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r)),t.x=a,t.y=o,t))},names:["ortho"]},Qe=1,Xe=2,Ve=3,Ze=4,Je=5,Ye=6,Ke={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4},$e={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>=J-rt/2?this.face=Je:this.lat0<=-(J-rt/2)?this.face=Ye:Math.abs(this.long0)<=rt?this.face=Qe:Math.abs(this.long0)<=J+rt?this.face=this.long0>0?Xe:Ze:this.face=Ve,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,n,s,a,o={x:0,y:0},h={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===Je)n=J-e,i>=rt&&i<=J+rt?(h.value=Ke.AREA_0,r=i-J):i>J+rt||i<=-(J+rt)?(h.value=Ke.AREA_1,r=i>0?i-st:i+st):i>-(J+rt)&&i<=-rt?(h.value=Ke.AREA_2,r=i+J):(h.value=Ke.AREA_3,r=i);else if(this.face===Ye)n=J+e,i>=rt&&i<=J+rt?(h.value=Ke.AREA_0,r=-i+J):i<rt&&i>=-rt?(h.value=Ke.AREA_1,r=-i):i<-rt&&i>=-(J+rt)?(h.value=Ke.AREA_2,r=-i-J):(h.value=Ke.AREA_3,r=i>0?-i+st:-i-st);else{var u,l,c,f,p,d;this.face===Xe?i=G(i,+J):this.face===Ve?i=G(i,+st):this.face===Ze&&(i=G(i,-J)),f=Math.sin(e),p=Math.cos(e),d=Math.sin(i),u=p*Math.cos(i),l=p*d,c=f,this.face===Qe?r=q(n=Math.acos(u),c,l,h):this.face===Xe?r=q(n=Math.acos(l),c,-u,h):this.face===Ve?r=q(n=Math.acos(-u),c,-l,h):this.face===Ze?r=q(n=Math.acos(-l),c,u,h):(n=r=0,h.value=Ke.AREA_0)}return a=Math.atan(12/st*(r+Math.acos(Math.sin(r)*Math.cos(rt))-J)),s=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===Ke.AREA_1?a+=J:h.value===Ke.AREA_2?a+=st:h.value===Ke.AREA_3&&(a+=1.5*st),o.x=s*Math.cos(a),o.y=s*Math.sin(a),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var e,i,r,n,s,a,o,h,u,l={lam:0,phi:0},c={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)?c.value=Ke.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(c.value=Ke.AREA_1,e-=J):t.x<0&&-t.x>=Math.abs(t.y)?(c.value=Ke.AREA_2,e=e<0?e+st:e-st):(c.value=Ke.AREA_3,e+=J),u=st/12*Math.tan(e),s=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),a=Math.atan(s),(o=1-(r=Math.cos(e))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?o=-1:o>1&&(o=1),this.face===Je)h=Math.acos(o),l.phi=J-h,c.value===Ke.AREA_0?l.lam=a+J:c.value===Ke.AREA_1?l.lam=a<0?a+st:a-st:c.value===Ke.AREA_2?l.lam=a-J:l.lam=a;else if(this.face===Ye)h=Math.acos(o),l.phi=h-J,c.value===Ke.AREA_0?l.lam=-a+J:c.value===Ke.AREA_1?l.lam=-a:c.value===Ke.AREA_2?l.lam=-a-J:l.lam=a<0?-a-st:-a+st;else{var f,p,d;u=(f=o)*f,p=(u+=(d=u>=1?0:Math.sqrt(1-u)*Math.sin(a))*d)>=1?0:Math.sqrt(1-u),c.value===Ke.AREA_1?(u=p,p=-d,d=u):c.value===Ke.AREA_2?(p=-p,d=-d):c.value===Ke.AREA_3&&(u=p,p=d,d=-u),this.face===Xe?(u=f,f=-p,p=u):this.face===Ve?(f=-f,p=-p):this.face===Ze&&(u=f,f=p,p=-u),l.phi=Math.acos(-d)-J,l.lam=Math.atan2(p,f),this.face===Xe?l.lam=G(l.lam,-J):this.face===Ve?l.lam=G(l.lam,-st):this.face===Ze&&(l.lam=G(l.lam,+J))}if(0!==this.es){var m,y,g;m=l.phi<0?1:0,y=Math.tan(l.phi),g=this.b/Math.sqrt(y*y+this.one_minus_f_squared),l.phi=Math.atan(Math.sqrt(this.a*this.a-g*g)/(this.one_minus_f*g)),m&&(l.phi=-l.phi)}return l.lam+=this.long0,t.x=l.lam,t.y=l.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ti=[[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]],ei=[[-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]],ii=.8487,ri=1.3523,ni=it/5,si=1/ni,ai=18,oi=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},hi={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=xt(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*ni);r<0?r=0:r>=ai&&(r=17);var n={x:oi(ti[r],i=it*(i-si*r))*e,y:oi(ei[r],i)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*ii+this.x0,n.y=n.y*this.a*ri+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*ii),y:Math.abs(t.y-this.y0)/(this.a*ri)};if(e.y>=1)e.x/=ti[ai][0],e.y=t.y<0?-J:J;else{var i=Math.floor(e.y*ai);for(i<0?i=0:i>=ai&&(i=17);;)if(ei[i][0]>e.y)--i;else{if(!(ei[i+1][0]<=e.y))break;++i}var r=ei[i],n=5*(e.y-r[0])/(ei[i+1][0]-r[0]);n=function(t,e,i,r){for(var n=e;r;--r){var s=t(n);if(n-=s,Math.abs(s)<i)break}return n}((function(t){return(oi(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)}),n,tt,100),e.x/=oi(ti[i],n),e.y=(5*i+n)*et,t.y<0&&(e.y=-e.y)}return e.x=xt(e.x+this.long0),e},names:["Robinson","robin"]},ui={init:function(){this.name="geocent"},forward:function(t){return w(t,this.es,this.a)},inverse:function(t){return M(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},li=0,ci=1,fi=2,pi=3,di={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},mi={init:function(){if(Object.keys(di).forEach(function(t){if(void 0===this[t])this[t]=di[t].def;else{if(di[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);di[t].num&&(this[t]=parseFloat(this[t]))}di[t].degrees&&(this[t]=this[t]*et)}.bind(this)),Math.abs(Math.abs(this.lat0)-J)<tt?this.mode=this.lat0<0?ci:li:Math.abs(this.lat0)<tt?this.mode=fi:(this.mode=pi,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,i,r,n,s=Math.sin(t.y),a=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case pi:i=this.sinph0*s+this.cosph0*a*o;break;case fi:i=a*o;break;case ci:i=-s;break;case li:i=s}switch(e=(i=this.pn1/(this.p-i))*a*Math.sin(t.x),this.mode){case pi:i*=this.cosph0*s-this.sinph0*a*o;break;case fi:i*=s;break;case li:i*=-a*o;break;case ci:i*=a*o}return n=1/((r=i*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-i*this.sg)*this.cw*n,i=r*n,t.x=e*this.a,t.y=i*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,i,r,n={x:t.x,y:t.y};r=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*r,i=this.pn1*t.y*this.cw*r,t.x=e*this.cg+i*this.sg,t.y=i*this.cg-e*this.sg;var s=te(t.x,t.y);if(Math.abs(s)<tt)n.x=0,n.y=t.y;else{var a,o;switch(o=1-s*s*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/s+s/this.pn1),a=Math.sqrt(1-o*o),this.mode){case pi:n.y=Math.asin(a*this.sinph0+t.y*o*this.cosph0/s),t.y=(a-this.sinph0*Math.sin(n.y))*s,t.x*=o*this.cosph0;break;case fi:n.y=Math.asin(t.y*o/s),t.y=a*s,t.x*=o;break;case li:n.y=Math.asin(a),t.y=-t.y;break;case ci:n.y=-Math.asin(a)}n.x=Math.atan2(t.x,t.y)}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},yi={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>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/te(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/te(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/te(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/te(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/te(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)*te(1,o)):(a=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*te(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"]};return O.defaultDatum="WGS84",O.Proj=b,O.WGS84=new O.Proj("WGS84"),O.Point=U,O.toPoint=Lt,O.defs=o,O.nadgrid=function(t,e){var i=new DataView(e),r=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:m(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:y(i,n,r)};return Tt[t]=s,s},O.transform=A,O.mgrs=Xt,O.version="2.8.0",function(t){t.Proj.projections.add(Kt),t.Proj.projections.add(ne),t.Proj.projections.add(se),t.Proj.projections.add(he),t.Proj.projections.add(ue),t.Proj.projections.add(le),t.Proj.projections.add(fe),t.Proj.projections.add(pe),t.Proj.projections.add(de),t.Proj.projections.add(xe),t.Proj.projections.add(Oe),t.Proj.projections.add(Te),t.Proj.projections.add(Ie),t.Proj.projections.add(Ne),t.Proj.projections.add(Le),t.Proj.projections.add(Be),t.Proj.projections.add(Fe),t.Proj.projections.add(De),t.Proj.projections.add(ze),t.Proj.projections.add(Ue),t.Proj.projections.add(qe),t.Proj.projections.add(Ge),t.Proj.projections.add(We),t.Proj.projections.add(He),t.Proj.projections.add($e),t.Proj.projections.add(hi),t.Proj.projections.add(ui),t.Proj.projections.add(mi),t.Proj.projections.add(yi)}(O),O}));!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).shp=t()}}((function(){return function t(e,i,r){function n(a,o){if(!i[a]){if(!e[a]){var h="function"==typeof require&&require;if(!o&&h)return h(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return n(e[a][1][t]||t)}),l,l.exports,t,e,i,r)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(t,e,i){t("text-encoding-polyfill");var r=t("string_decoder").StringDecoder;function n(t){var e=new r;return(e.write(t)+e.end()).replace(/\0/g,"").trim()}e.exports=function t(e,i){console.log("encoding",e);if(!e)return n;try{new TextDecoder(e.trim())}catch(a){console.log("catch",a);var r=s.exec(e);console.log("match",r);if(r&&!i){console.log("m1",r[1]);return t("windows-"+r[1],!0)}return n}return function(t){var i=new TextDecoder(e);return(i.decode(t,{stream:!0})+i.decode()).replace(/\0/g,"").trim()}};var s=/^(?:ANSI\s)?(\d+)$/m},{string_decoder:21,"text-encoding-polyfill":3}],2:[function(t,e,i){var r=t("./decoder");function n(t,e,i,r,n){var s=n(t.slice(e,e+i));switch(r){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function s(t,e,i,r){for(var s,a,o={},h=0,u=i.length;h<u;){s=n(t,e,(a=i[h]).len,a.dataType,r);e+=a.len;void 0!==s&&(o[a.name]=s);h++}return o}e.exports=function(t,e){for(var i=r(e),n=function(t){var e={};e.lastUpdated=new Date(t.readUInt8(1)+1900,t.readUInt8(2),t.readUInt8(3));e.records=t.readUInt32LE(4);e.headerLen=t.readUInt16LE(8);e.recLen=t.readUInt16LE(10);return e}(t),a=function(t,e,i){for(var r=[],n=32;n<e;){r.push({name:i(t.slice(n,n+11)),dataType:String.fromCharCode(t.readUInt8(n+11)),len:t.readUInt8(n+16),decimal:t.readUInt8(n+17)});if(13===t.readUInt8(n+32))break;n+=32}return r}(t,n.headerLen-1,i),o=2+(a.length+1<<5),h=n.recLen,u=n.records,l=[];u;){l.push(s(t,o,a,i));o+=h;u--}return l}},{"./decoder":1}],3:[function(t,e,i){e.exports=t("./lib/encoding.js")},{"./lib/encoding.js":4}],4:[function(t,e,i){!function(i){"use strict";void 0!==e&&e.exports&&!i["encoding-indexes"]&&t("./encoding-indexes.js");function r(t,e,i){return e<=t&&t<=i}var n=Math.floor;function s(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function a(t){return 0<=t&&t<=127}var o=a,h=-1;function u(t){this.tokens=[].slice.call(t);this.tokens.reverse()}u.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():h},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var l=-1;function c(t,e){if(t)throw TypeError("Decoder error");return e||65533}function f(t){throw TypeError("The code point "+t+" could not be encoded.")}function p(t){t=String(t).trim().toLowerCase();return Object.prototype.hasOwnProperty.call(m,t)?m[t]:null}var d=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],m={};d.forEach((function(t){t.encodings.forEach((function(t){t.labels.forEach((function(e){m[e]=t}))}))}));var y,g,_={},v={};function b(t,e){return e&&e[t]||null}function w(t,e){var i=e.indexOf(t);return-1===i?null:i}function M(t){if(!("encoding-indexes"in i))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return i["encoding-indexes"][t]}var x="utf-8";function E(t,e){if(!(this instanceof E))throw TypeError("Called as a function. Did you forget 'new'?");t=void 0!==t?String(t):x;e=s(e);this._encoding=null;this._decoder=null;this._ignoreBOM=!1;this._BOMseen=!1;this._error_mode="replacement";this._do_not_flush=!1;var i=p(t);if(null===i||"replacement"===i.name)throw RangeError("Unknown encoding: "+t);if(!v[i.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var r=this;r._encoding=i;Boolean(e.fatal)&&(r._error_mode="fatal");Boolean(e.ignoreBOM)&&(r._ignoreBOM=!0);if(!Object.defineProperty){this.encoding=r._encoding.name.toLowerCase();this.fatal="fatal"===r._error_mode;this.ignoreBOM=r._ignoreBOM}return r}if(Object.defineProperty){Object.defineProperty(E.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Object.defineProperty(E.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}});Object.defineProperty(E.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})}E.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);if(!this._do_not_flush){this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode});this._BOMseen=!1}this._do_not_flush=Boolean(e.stream);for(var r,n=new u(i),a=[];;){var o=n.read();if(o===h)break;if((r=this._decoder.handler(n,o))===l)break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}if(!this._do_not_flush){do{if((r=this._decoder.handler(n,n.read()))===l)break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}while(!n.endOfStream());this._decoder=null}return function(t){if((e=["UTF-8","UTF-16LE","UTF-16BE"],i=this._encoding.name,-1!==e.indexOf(i))&&!this._ignoreBOM&&!this._BOMseen)if(t.length>0&&65279===t[0]){this._BOMseen=!0;t.shift()}else t.length>0&&(this._BOMseen=!0);var e,i;return function(t){for(var e="",i=0;i<t.length;++i){var r=t[i];if(r<=65535)e+=String.fromCharCode(r);else{r-=65536;e+=String.fromCharCode(55296+(r>>10),56320+(1023&r))}}return e}(t)}.call(this,a)};function k(t,e){if(!(this instanceof k))throw TypeError("Called as a function. Did you forget 'new'?");e=s(e);this._encoding=null;this._encoder=null;this._do_not_flush=!1;this._fatal=Boolean(e.fatal)?"fatal":"replacement";var r=this;if(Boolean(e.NONSTANDARD_allowLegacyEncoding)){var n=p(t=void 0!==t?String(t):x);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+t);if(!_[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else{r._encoding=p("utf-8");void 0!==t&&"console"in i&&console.warn("TextEncoder constructor called with encoding label, which is ignored.")}Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase());return r}Object.defineProperty&&Object.defineProperty(k.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});k.prototype.encode=function(t,e){t=void 0===t?"":String(t);e=s(e);this._do_not_flush||(this._encoder=_[this._encoding.name]({fatal:"fatal"===this._fatal}));this._do_not_flush=Boolean(e.stream);for(var i,r=new u(function(t){for(var e=String(t),i=e.length,r=0,n=[];r<i;){var s=e.charCodeAt(r);if(s<55296||s>57343)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(a===h)break;if((i=this._encoder.handler(r,a))===l)break;Array.isArray(i)?n.push.apply(n,i):n.push(i)}if(!this._do_not_flush){for(;(i=this._encoder.handler(r,r.read()))!==l;)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)};function C(t){var e=t.fatal,i=0,n=0,s=0,a=128,o=191;this.handler=function(t,u){if(u===h&&0!==s){s=0;return c(e)}if(u===h)return l;if(0===s){if(r(u,0,127))return u;if(r(u,194,223)){s=1;i=31&u}else if(r(u,224,239)){224===u&&(a=160);237===u&&(o=159);s=2;i=15&u}else{if(!r(u,240,244))return c(e);240===u&&(a=144);244===u&&(o=143);s=3;i=7&u}return null}if(!r(u,a,o)){i=s=n=0;a=128;o=191;t.prepend(u);return c(e)}a=128;o=191;i=i<<6|63&u;if((n+=1)!==s)return null;var f=i;i=s=n=0;return f}}function S(t){t.fatal;this.handler=function(t,e){if(e===h)return l;if(o(e))return e;var i,n;if(r(e,128,2047)){i=1;n=192}else if(r(e,2048,65535)){i=2;n=224}else if(r(e,65536,1114111)){i=3;n=240}for(var s=[(e>>6*i)+n];i>0;){var a=e>>6*(i-1);s.push(128|63&a);i-=1}return s}}_["UTF-8"]=function(t){return new S(t)};v["UTF-8"]=function(t){return new C(t)};function A(t,e){var i=e.fatal;this.handler=function(e,r){if(r===h)return l;if(a(r))return r;var n=t[r-128];return null===n?c(i):n}}function P(t,e){e.fatal;this.handler=function(e,i){if(i===h)return l;if(o(i))return i;var r=w(i,t);null===r&&f(i);return r+128}}"encoding-indexes"in i&&d.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,i=M(e.toLowerCase());v[e]=function(t){return new A(i,t)};_[e]=function(t){return new P(i,t)}}))}));v.GBK=function(t){return new j(t)};_.GBK=function(t){return new O(t,!0)};function j(t){var e=t.fatal,i=0,n=0,s=0;this.handler=function(t,o){if(o===h&&0===i&&0===n&&0===s)return l;if(o===h&&(0!==i||0!==n||0!==s)){i=0;n=0;s=0;c(e)}var u;if(0!==s){u=null;r(o,48,57)&&(u=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,i=0,r=0,n=M("gb18030-ranges");for(e=0;e<n.length;++e){var s=n[e];if(!(s[0]<=t))break;i=s[0];r=s[1]}return r+t-i}(10*(126*(10*(i-129)+n-48)+s-129)+o-48));var f=[n,s,o];i=0;n=0;s=0;if(null===u){t.prepend(f);return c(e)}return u}if(0!==n){if(r(o,129,254)){s=o;return null}t.prepend([n,o]);i=0;n=0;return c(e)}if(0!==i){if(r(o,48,57)){n=o;return null}var p=i,d=null;i=0;var m=o<127?64:65;(r(o,64,126)||r(o,128,254))&&(d=190*(p-129)+(o-m));null===(u=null===d?null:b(d,M("gb18030")))&&a(o)&&t.prepend(o);return null===u?c(e):u}if(a(o))return o;if(128===o)return 8364;if(r(o,129,254)){i=o;return null}return c(e)}}function O(t,e){t.fatal;this.handler=function(t,i){if(i===h)return l;if(o(i))return i;if(58853===i)return f(i);if(e&&8364===i)return 128;var r=w(i,M("gb18030"));if(null!==r){var s=r%190;return[n(r/190)+129,s+(s<63?64:65)]}if(e)return f(i);r=function(t){if(59335===t)return 7457;var e,i=0,r=0,n=M("gb18030-ranges");for(e=0;e<n.length;++e){var s=n[e];if(!(s[1]<=t))break;i=s[1];r=s[0]}return r+t-i}(i);var a=n(r/10/126/10),u=n((r-=10*a*126*10)/10/126),c=n((r-=10*u*126)/10);return[a+129,u+48,c+129,r-10*c+48]}}_.gb18030=function(t){return new O(t)};v.gb18030=function(t){return new j(t)};function R(t){var e=t.fatal,i=0;this.handler=function(t,n){if(n===h&&0!==i){i=0;return c(e)}if(n===h&&0===i)return l;if(0!==i){var s=i,o=null;i=0;var u=n<127?64:98;(r(n,64,126)||r(n,161,254))&&(o=157*(s-129)+(n-u));switch(o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var f=null===o?null:b(o,M("big5"));null===f&&a(n)&&t.prepend(n);return null===f?c(e):f}if(a(n))return n;if(r(n,129,254)){i=n;return null}return c(e)}}function T(t){t.fatal;this.handler=function(t,e){if(e===h)return l;if(o(e))return e;var i=function(t){g=g||M("big5").map((function(t,e){return e<5024?null:t}));var e=g;return 9552===t||9566===t||9569===t||9578===t||21313===t||21317===t?e.lastIndexOf(t):w(t,e)}(e);if(null===i)return f(e);var r=n(i/157)+129;if(r<161)return f(e);var s=i%157;return[r,s+(s<63?64:98)]}}_.Big5=function(t){return new T(t)};v.Big5=function(t){return new R(t)};function I(t){var e=t.fatal,i=!1,n=0;this.handler=function(t,s){if(s===h&&0!==n){n=0;return c(e)}if(s===h&&0===n)return l;if(142===n&&r(s,161,223)){n=0;return 65216+s}if(143===n&&r(s,161,254)){i=!0;n=s;return null}if(0!==n){var o=n;n=0;var u=null;r(o,161,254)&&r(s,161,254)&&(u=b(94*(o-161)+(s-161),M(i?"jis0212":"jis0208")));i=!1;r(s,161,254)||t.prepend(s);return null===u?c(e):u}if(a(s))return s;if(142===s||143===s||r(s,161,254)){n=s;return null}return c(e)}}function N(t){t.fatal;this.handler=function(t,e){if(e===h)return l;if(o(e))return e;if(165===e)return 92;if(8254===e)return 126;if(r(e,65377,65439))return[142,e-65377+161];8722===e&&(e=65293);var i=w(e,M("jis0208"));return null===i?f(e):[n(i/94)+161,i%94+161]}}_["EUC-JP"]=function(t){return new N(t)};v["EUC-JP"]=function(t){return new I(t)};function L(t){var e=t.fatal,i=0,n=1,s=2,a=3,o=4,u=5,f=6,p=i,d=i,m=0,y=!1;this.handler=function(t,g){switch(p){default:case i:if(27===g){p=u;return null}if(r(g,0,127)&&14!==g&&15!==g&&27!==g){y=!1;return g}if(g===h)return l;y=!1;return c(e);case n:if(27===g){p=u;return null}if(92===g){y=!1;return 165}if(126===g){y=!1;return 8254}if(r(g,0,127)&&14!==g&&15!==g&&27!==g&&92!==g&&126!==g){y=!1;return g}if(g===h)return l;y=!1;return c(e);case s:if(27===g){p=u;return null}if(r(g,33,95)){y=!1;return 65344+g}if(g===h)return l;y=!1;return c(e);case a:if(27===g){p=u;return null}if(r(g,33,126)){y=!1;m=g;p=o;return null}if(g===h)return l;y=!1;return c(e);case o:if(27===g){p=u;return c(e)}if(r(g,33,126)){p=a;var _=b(94*(m-33)+g-33,M("jis0208"));return null===_?c(e):_}if(g===h){p=a;t.prepend(g);return c(e)}p=a;return c(e);case u:if(36===g||40===g){m=g;p=f;return null}t.prepend(g);y=!1;p=d;return c(e);case f:var v=m;m=0;var w=null;40===v&&66===g&&(w=i);40===v&&74===g&&(w=n);40===v&&73===g&&(w=s);36!==v||64!==g&&66!==g||(w=a);if(null!==w){p=p=w;var x=y;y=!0;return x?c(e):null}t.prepend([v,g]);y=!1;p=d;return c(e)}}}function B(t){t.fatal;var e=0,i=1,r=2,s=e;this.handler=function(t,a){if(a===h&&s!==e){t.prepend(a);s=e;return[27,40,66]}if(a===h&&s===e)return l;if(!(s!==e&&s!==i||14!==a&&15!==a&&27!==a))return f(65533);if(s===e&&o(a))return a;if(s===i&&(o(a)&&92!==a&&126!==a||165==a||8254==a)){if(o(a))return a;if(165===a)return 92;if(8254===a)return 126}if(o(a)&&s!==e){t.prepend(a);s=e;return[27,40,66]}if((165===a||8254===a)&&s!==i){t.prepend(a);s=i;return[27,40,74]}8722===a&&(a=65293);var u=w(a,M("jis0208"));if(null===u)return f(a);if(s!==r){t.prepend(a);s=r;return[27,36,66]}return[n(u/94)+33,u%94+33]}}_["ISO-2022-JP"]=function(t){return new B(t)};v["ISO-2022-JP"]=function(t){return new L(t)};function F(t){var e=t.fatal,i=0;this.handler=function(t,n){if(n===h&&0!==i){i=0;return c(e)}if(n===h&&0===i)return l;if(0!==i){var s=i,o=null;i=0;var u=n<127?64:65,f=s<160?129:193;(r(n,64,126)||r(n,128,252))&&(o=188*(s-f)+n-u);if(r(o,8836,10715))return 48508+o;var p=null===o?null:b(o,M("jis0208"));null===p&&a(n)&&t.prepend(n);return null===p?c(e):p}if(a(n)||128===n)return n;if(r(n,161,223))return 65216+n;if(r(n,129,159)||r(n,224,252)){i=n;return null}return c(e)}}function D(t){t.fatal;this.handler=function(t,e){if(e===h)return l;if(o(e)||128===e)return e;if(165===e)return 92;if(8254===e)return 126;if(r(e,65377,65439))return e-65377+161;8722===e&&(e=65293);var i=function(t){y=y||M("jis0208").map((function(t,e){return r(e,8272,8835)?null:t}));return y.indexOf(t)}(e);if(null===i)return f(e);var s=n(i/188),a=i%188;return[s+(s<31?129:193),a+(a<63?64:65)]}}_.Shift_JIS=function(t){return new D(t)};v.Shift_JIS=function(t){return new F(t)};function z(t){var e=t.fatal,i=0;this.handler=function(t,n){if(n===h&&0!==i){i=0;return c(e)}if(n===h&&0===i)return l;if(0!==i){var s=i,o=null;i=0;r(n,65,254)&&(o=190*(s-129)+(n-65));var u=null===o?null:b(o,M("euc-kr"));null===o&&a(n)&&t.prepend(n);return null===u?c(e):u}if(a(n))return n;if(r(n,129,254)){i=n;return null}return c(e)}}function U(t){t.fatal;this.handler=function(t,e){if(e===h)return l;if(o(e))return e;var i=w(e,M("euc-kr"));return null===i?f(e):[n(i/190)+129,i%190+65]}}_["EUC-KR"]=function(t){return new U(t)};v["EUC-KR"]=function(t){return new z(t)};function q(t,e){var i=t>>8,r=255&t;return e?[i,r]:[r,i]}function G(t,e){var i=e.fatal,n=null,s=null;this.handler=function(e,a){if(a===h&&(null!==n||null!==s))return c(i);if(a===h&&null===n&&null===s)return l;if(null===n){n=a;return null}var o;o=t?(n<<8)+a:(a<<8)+n;n=null;if(null!==s){var u=s;s=null;if(r(o,56320,57343))return 65536+1024*(u-55296)+(o-56320);e.prepend(q(o,t));return c(i)}if(r(o,55296,56319)){s=o;return null}return r(o,56320,57343)?c(i):o}}function W(t,e){e.fatal;this.handler=function(e,i){if(i===h)return l;if(r(i,0,65535))return q(i,t);var n=q(55296+(i-65536>>10),t),s=q(56320+(i-65536&1023),t);return n.concat(s)}}_["UTF-16BE"]=function(t){return new W(!0,t)};v["UTF-16BE"]=function(t){return new G(!0,t)};_["UTF-16LE"]=function(t){return new W(!1,t)};v["UTF-16LE"]=function(t){return new G(!1,t)};function H(t){t.fatal;this.handler=function(t,e){return e===h?l:a(e)?e:63360+e-128}}function Q(t){t.fatal;this.handler=function(t,e){return e===h?l:o(e)?e:r(e,63360,63487)?e-63360+128:f(e)}}_["x-user-defined"]=function(t){return new Q(t)};v["x-user-defined"]=function(t){return new H(t)};i.TextEncoder||(i.TextEncoder=k);i.TextDecoder||(i.TextDecoder=E);void 0!==e&&e.exports&&(e.exports={TextEncoder:i.TextEncoder,TextDecoder:i.TextDecoder,EncodingIndexes:i["encoding-indexes"]})}(this||{})},{"./encoding-indexes.js":11}],5:[function(t,e,i){"use strict";const r=t("lie"),n=t("./combine"),s=t("buffer").Buffer;e.exports=function(t,e){return new r((function(i,r){const a=n(t,e),o=new XMLHttpRequest;o.open("GET",a,!0);"prj"!==e&&"cpg"!==e&&(o.responseType="arraybuffer");o.addEventListener("load",(function(){return o.status>399?"prj"===e||"cpg"===e?i(!1):r(new Error(o.status)):i("prj"!==e&&"cpg"!==e?s.from(o.response):o.response)}),!1);o.send()}))}},{"./combine":7,buffer:12,lie:16}],6:[function(t,e,i){(function(i){(function(){"use strict";const r=t("./binaryajax-browser"),n=t("./combine"),s=t("buffer").Buffer;e.exports=async function(t,e){if(!i.fetch)return r(t,e);const a=n(t,e),o="prj"===e||"cpg"===e;try{const t=await fetch(a);if(t.status>399)throw new Error(t.statusText);if(o)return t.text();const e=await t.arrayBuffer();return s.from(e)}catch(t){if(o)return!1;throw t}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./binaryajax-browser":5,"./combine":7,buffer:12}],7:[function(t,e,i){(function(t){(function(){const i=t.URL;e.exports=(t,e)=>{if(!e)return t;const r=new i(t);r.pathname=`${r.pathname}.${e}`;return r.href}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(t,e,i){"use strict";function r(t,e){!function(t){let e=0,i=1;const r=t.length;let n,s;for(;i<r;){n=s||t[0];s=t[i];e+=(s[0]-n[0])*(s[1]+n[1]);i++}return e>0}(e)&&t.length?t[t.length-1].push(e):t.push([e]);return t}s.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}};s.prototype.parseZPoint=function(t){const e=this.parsePoint(t);e.coordinates.push(t.readDoubleLE(16));return e};s.prototype.parsePointArray=function(t,e,i){const r=[];let n=0;for(;n<i;){r.push(this.parseCoord(t,e));e+=16;n++}return r};s.prototype.parseZPointArray=function(t,e,i,r){let n=0;for(;n<i;){r[n].push(t.readDoubleLE(e));n++;e+=8}return r};s.prototype.parseArrayGroup=function(t,e,i,r,n){const s=[];let a,o,h=0,u=0;for(;h<r;){h++;i+=4;a=u;u=h===r?n:t.readInt32LE(i);o=u-a;if(o){s.push(this.parsePointArray(t,e,o));e+=o<<4}}return s};s.prototype.parseZArrayGroup=function(t,e,i,r){let n=0;for(;n<i;){r[n]=this.parseZPointArray(t,e,r[n].length,r[n]);e+=r[n].length<<3;n++}return r};s.prototype.parseMultiPoint=function(t){const e={},i=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[i[0],i[1],r[0],r[1]];const n=t.readInt32LE(32,!0);if(1===n){e.type="Point";e.coordinates=this.parseCoord(t,36)}else{e.type="MultiPoint";e.coordinates=this.parsePointArray(t,36,n)}return e};s.prototype.parseZMultiPoint=function(t){const e=this.parseMultiPoint(t);let i;if("Point"===e.type){e.coordinates.push(t.readDoubleLE(72));return e}i=e.coordinates.length;const r=52+(i<<4);e.coordinates=this.parseZPointArray(t,r,i,e.coordinates);return e};s.prototype.parsePolyline=function(t){const e={},i=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[i[0],i[1],r[0],r[1]];const n=t.readInt32LE(32),s=t.readInt32LE(36);let a,o;if(1===n){e.type="LineString";a=44;e.coordinates=this.parsePointArray(t,a,s)}else{e.type="MultiLineString";a=40+(n<<2);o=40;e.coordinates=this.parseArrayGroup(t,a,40,n,s)}return e};s.prototype.parseZPolyline=function(t){const e=this.parsePolyline(t),i=e.coordinates.length;let r;if("LineString"===e.type){r=60+(i<<4);e.coordinates=this.parseZPointArray(t,r,i,e.coordinates);return e}r=56+(e.coordinates.reduce((function(t,e){return t+e.length}),0)<<4)+(i<<2);e.coordinates=this.parseZArrayGroup(t,r,i,e.coordinates);return e};s.prototype.polyFuncs=function(t){if("LineString"===t.type){t.type="Polygon";t.coordinates=[t.coordinates];return t}t.coordinates=t.coordinates.reduce(r,[]);if(1===t.coordinates.length){t.type="Polygon";t.coordinates=t.coordinates[0];return t}t.type="MultiPolygon";return t};s.prototype.parsePolygon=function(t){return this.polyFuncs(this.parsePolyline(t))};s.prototype.parseZPolygon=function(t){return this.polyFuncs(this.parseZPolyline(t))};const n={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function s(t,e){if(!(this instanceof s))return new s(t,e);this.buffer=t;this.headers=this.parseHeader();this.headers.length<this.buffer.byteLength&&(this.buffer=this.buffer.slice(0,this.headers.length));this.shpFuncs(e);this.rows=this.getRows()}s.prototype.shpFuncs=function(t){let e=this.headers.shpCode;e>20&&(e-=20);if(!(e in n))throw new Error("I don't know that shp type");this.parseFunc=this[n[e]];this.parseCoord=(i=t)?function(t,e){return i.inverse([t.readDoubleLE(e),t.readDoubleLE(e+8)])}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]};var i};s.prototype.getShpCode=function(){return this.parseHeader().shpCode};s.prototype.parseHeader=function(){const t=this.buffer.slice(0,100);return{length:t.readInt32BE(24)<<1,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(){let t=100;const e=this.buffer.byteLength,i=[];let r;for(;t<e;){r=this.getRow(t);if(!r)break;t+=8;t+=r.len;r.type?i.push(this.parseFunc(r.data)):i.push(null)}return i};s.prototype.getRow=function(t){const e=this.buffer.slice(t,t+12),i=e.readInt32BE(4)<<1,r=e.readInt32BE(0);return 0===i?{id:r,len:i,type:0}:{id:r,len:i,data:this.buffer.slice(t+12,t+i+8),type:e.readInt32LE(8)}};e.exports=function(t,e){return new s(t,e).rows}},{}],9:[function(t,e,i){"use strict";const r=t("jszip");e.exports=async t=>{const e=new r;await e.loadAsync(t);const i=e.file(/.+/),n={};await Promise.all(i.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text");n[t.name]=e})));return n}},{jszip:15}],10:[function(t,e,i){"use strict";i.byteLength=function(t){var e=u(t),i=e[0],r=e[1];return 3*(i+r)/4-r};i.toByteArray=function(t){var e,i,r=u(t),a=r[0],o=r[1],h=new s(function(t,e,i){return 3*(e+i)/4-i}(0,a,o)),l=0,c=o>0?a-4:a;for(i=0;i<c;i+=4){e=n[t.charCodeAt(i)]<<18|n[t.charCodeAt(i+1)]<<12|n[t.charCodeAt(i+2)]<<6|n[t.charCodeAt(i+3)];h[l++]=e>>16&255;h[l++]=e>>8&255;h[l++]=255&e}if(2===o){e=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4;h[l++]=255&e}if(1===o){e=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2;h[l++]=e>>8&255;h[l++]=255&e}return h};i.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],a=16383,o=0,h=i-n;o<h;o+=a)s.push(l(t,o,o+a>h?h:o+a));if(1===n){e=t[i-1];s.push(r[e>>2]+r[e<<4&63]+"==")}else if(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;o<h;++o){r[o]=a[o];n[a.charCodeAt(o)]=o}n["-".charCodeAt(0)]=62;n["_".charCodeAt(0)]=63;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=e);return[i,i===e?0:4-i%4]}function l(t,e,i){for(var n,s,a=[],o=e;o<i;o+=3){n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]);a.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s])}return a.join("")}},{}],11:[function(t,e,i){},{}],12:[function(t,e,i){(function(e){(function(){"use strict";var e=t("base64-js"),r=t("ieee754");i.Buffer=a;i.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)};i.INSPECT_MAX_BYTES=50;var n=2147483647;i.kMaxLength=n;a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===t.foo()}catch(t){return!1}}();a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);e.__proto__=a.prototype;return e}function a(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return o(t,e,i)}"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1});a.poolSize=8192;function o(t,e,i){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var i=0|f(t,e),r=s(i),n=r.write(t,e);n!==i&&(r=r.slice(0,n));return r}(t,e);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i);r.__proto__=a.prototype;return r}(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return a.from(r,e,i);var n=function(t){if(a.isBuffer(t)){var e=0|c(t.length),i=s(e);if(0===i.length)return i;t.copy(i,0,0,e);return i}if(void 0!==t.length)return"number"!=typeof t.length||U(t.length)?s(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a.from=function(t,e,i){return o(t,e,i)};a.prototype.__proto__=Uint8Array.prototype;a.__proto__=Uint8Array;function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}a.alloc=function(t,e,i){return function(t,e,i){h(t);return t<=0?s(t):void 0!==e?"string"==typeof i?s(t).fill(e,i):s(t).fill(e):s(t)}(t,e,i)};function u(t){h(t);return s(t<0?0:0|c(t))}a.allocUnsafe=function(t){return u(t)};a.allocUnsafeSlow=function(t){return u(t)};function l(t){for(var e=t.length<0?0:0|c(t.length),i=s(e),r=0;r<e;r+=1)i[r]=255&t[r];return i}function c(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype};a.compare=function(t,e){z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength));z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength));if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var i=t.length,r=e.length,n=0,s=Math.min(i,r);n<s;++n)if(t[n]!==e[n]){i=t[n];r=e[n];break}return i<r?-1:r<i?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var i;if(void 0===e){e=0;for(i=0;i<t.length;++i)e+=t[i].length}var r=a.allocUnsafe(e),n=0;for(i=0;i<t.length;++i){var s=t[i];z(s,Uint8Array)&&(s=a.from(s));if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,n);n+=s.length}return r};function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return B(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(n)return r?-1:B(t).length;e=(""+e).toLowerCase();n=!0}}a.byteLength=f;function p(t,e,i){var r=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===i||i>this.length)&&(i=this.length);if(i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";t||(t="utf8");for(;;)switch(t){case"hex":return A(this,e,i);case"utf8":case"utf-8":return E(this,e,i);case"ascii":return C(this,e,i);case"latin1":case"binary":return S(this,e,i);case"base64":return x(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();r=!0}}a.prototype._isBuffer=!0;function d(t,e,i){var r=t[e];t[e]=t[i];t[i]=r}a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4){d(this,e,e+3);d(this,e+1,e+2)}return this};a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8){d(this,e,e+7);d(this,e+1,e+6);d(this,e+2,e+5);d(this,e+3,e+4)}return this};a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):p.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)};a.prototype.inspect=function(){var t="",e=i.INSPECT_MAX_BYTES;t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();this.length>e&&(t+=" ... ");return"<Buffer "+t+">"};a.prototype.compare=function(t,e,i,r,n){z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength));if(!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);void 0===e&&(e=0);void 0===i&&(i=t?t.length:0);void 0===r&&(r=0);void 0===n&&(n=this.length);if(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),o=(i>>>=0)-(e>>>=0),h=Math.min(s,o),u=this.slice(r,n),l=t.slice(e,i),c=0;c<h;++c)if(u[c]!==l[c]){s=u[c];o=l[c];break}return s<o?-1:o<s?1:0};function m(t,e,i,r,n){if(0===t.length)return-1;if("string"==typeof i){r=i;i=0}else i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648);U(i=+i)&&(i=n?0:t.length-1);i<0&&(i=t.length+i);if(i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}"string"==typeof e&&(e=a.from(e,r));if(a.isBuffer(e))return 0===e.length?-1:y(t,e,i,r,n);if("number"==typeof e){e&=255;return"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 u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var l=-1;for(s=i;s<o;s++)if(u(t,s)===u(e,-1===l?0:s-l)){-1===l&&(l=s);if(s-l+1===h)return l*a}else{-1!==l&&(s-=s-l);l=-1}}else{i+h>o&&(i=o-h);for(s=i;s>=0;s--){for(var c=!0,f=0;f<h;f++)if(u(t,s+f)!==u(e,f)){c=!1;break}if(c)return s}}return-1}a.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)};a.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)};a.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)};function g(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var s=e.length;r>s/2&&(r=s/2);for(var a=0;a<r;++a){var o=parseInt(e.substr(2*a,2),16);if(U(o))return a;t[i+a]=o}return a}function _(t,e,i,r){return D(B(e,t.length-i),t,i,r)}function v(t,e,i,r){return D(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function b(t,e,i,r){return v(t,e,i,r)}function w(t,e,i,r){return D(F(e),t,i,r)}function M(t,e,i,r){return D(function(t,e){for(var i,r,n,s=[],a=0;a<t.length&&!((e-=2)<0);++a){r=(i=t.charCodeAt(a))>>8;n=i%256;s.push(n);s.push(r)}return s}(e,t.length-i),t,i,r)}a.prototype.write=function(t,e,i,r){if(void 0===e){r="utf8";i=this.length;e=0}else if(void 0===i&&"string"==typeof e){r=e;i=this.length;e=0}else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0;if(isFinite(i)){i>>>=0;void 0===r&&(r="utf8")}else{r=i;i=void 0}}var n=this.length-e;(void 0===i||i>n)&&(i=n);if(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 g(this,t,e,i);case"utf8":case"utf-8":return _(this,t,e,i);case"ascii":return v(this,t,e,i);case"latin1":case"binary":return b(this,t,e,i);case"base64":return w(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(t,i,r){return 0===i&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(i,r))}function E(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n<i;){var s=t[n],a=null,o=s>239?4:s>223?3:s>191?2:1;if(n+o<=i){var h,u,l,c;switch(o){case 1:s<128&&(a=s);break;case 2:128==(192&(h=t[n+1]))&&(c=(31&s)<<6|63&h)>127&&(a=c);break;case 3:h=t[n+1];u=t[n+2];128==(192&h)&&128==(192&u)&&(c=(15&s)<<12|(63&h)<<6|63&u)>2047&&(c<55296||c>57343)&&(a=c);break;case 4:h=t[n+1];u=t[n+2];l=t[n+3];128==(192&h)&&128==(192&u)&&128==(192&l)&&(c=(15&s)<<18|(63&h)<<12|(63&u)<<6|63&l)>65535&&c<1114112&&(a=c)}}if(null===a){a=65533;o=1}else if(a>65535){a-=65536;r.push(a>>>10&1023|55296);a=56320|1023&a}r.push(a);n+=o}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var i="",r=0;for(;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=k));return i}(r)}var k=4096;function C(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function S(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function A(t,e,i){var r=t.length;(!e||e<0)&&(e=0);(!i||i<0||i>r)&&(i=r);for(var n="",s=e;s<i;++s)n+=L(t[s]);return n}function P(t,e,i){for(var r=t.slice(e,i),n="",s=0;s<r.length;s+=2)n+=String.fromCharCode(r[s]+256*r[s+1]);return n}a.prototype.slice=function(t,e){var i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i);(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i);e<t&&(e=t);var r=this.subarray(t,e);r.__proto__=a.prototype;return r};function j(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(t,e,i){t>>>=0;e>>>=0;i||j(t,e,this.length);for(var r=this[t],n=1,s=0;++s<e&&(n*=256);)r+=this[t+s]*n;return r};a.prototype.readUIntBE=function(t,e,i){t>>>=0;e>>>=0;i||j(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(n*=256);)r+=this[t+--e]*n;return r};a.prototype.readUInt8=function(t,e){t>>>=0;e||j(t,1,this.length);return this[t]};a.prototype.readUInt16LE=function(t,e){t>>>=0;e||j(t,2,this.length);return this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){t>>>=0;e||j(t,2,this.length);return this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){t>>>=0;e||j(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]};a.prototype.readUInt32BE=function(t,e){t>>>=0;e||j(t,4,this.length);return 16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,i){t>>>=0;e>>>=0;i||j(t,e,this.length);for(var r=this[t],n=1,s=0;++s<e&&(n*=256);)r+=this[t+s]*n;r>=(n*=128)&&(r-=Math.pow(2,8*e));return r};a.prototype.readIntBE=function(t,e,i){t>>>=0;e>>>=0;i||j(t,e,this.length);for(var r=e,n=1,s=this[t+--r];r>0&&(n*=256);)s+=this[t+--r]*n;s>=(n*=128)&&(s-=Math.pow(2,8*e));return s};a.prototype.readInt8=function(t,e){t>>>=0;e||j(t,1,this.length);return 128&this[t]?-1*(255-this[t]+1):this[t]};a.prototype.readInt16LE=function(t,e){t>>>=0;e||j(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i};a.prototype.readInt16BE=function(t,e){t>>>=0;e||j(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i};a.prototype.readInt32LE=function(t,e){t>>>=0;e||j(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){t>>>=0;e||j(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){t>>>=0;e||j(t,4,this.length);return r.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){t>>>=0;e||j(t,4,this.length);return r.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){t>>>=0;e||j(t,8,this.length);return r.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){t>>>=0;e||j(t,8,this.length);return r.read(this,t,!1,52,8)};function O(t,e,i,r,n,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(t,e,i,r){t=+t;e>>>=0;i>>>=0;if(!r){O(this,t,e,i,Math.pow(2,8*i)-1,0)}var n=1,s=0;this[e]=255&t;for(;++s<i&&(n*=256);)this[e+s]=t/n&255;return e+i};a.prototype.writeUIntBE=function(t,e,i,r){t=+t;e>>>=0;i>>>=0;if(!r){O(this,t,e,i,Math.pow(2,8*i)-1,0)}var n=i-1,s=1;this[e+n]=255&t;for(;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+i};a.prototype.writeUInt8=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,1,255,0);this[e]=255&t;return e+1};a.prototype.writeUInt16LE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,2,65535,0);this[e]=255&t;this[e+1]=t>>>8;return e+2};a.prototype.writeUInt16BE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,2,65535,0);this[e]=t>>>8;this[e+1]=255&t;return e+2};a.prototype.writeUInt32LE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,4,4294967295,0);this[e+3]=t>>>24;this[e+2]=t>>>16;this[e+1]=t>>>8;this[e]=255&t;return e+4};a.prototype.writeUInt32BE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,4,4294967295,0);this[e]=t>>>24;this[e+1]=t>>>16;this[e+2]=t>>>8;this[e+3]=255&t;return e+4};a.prototype.writeIntLE=function(t,e,i,r){t=+t;e>>>=0;if(!r){var n=Math.pow(2,8*i-1);O(this,t,e,i,n-1,-n)}var s=0,a=1,o=0;this[e]=255&t;for(;++s<i&&(a*=256);){t<0&&0===o&&0!==this[e+s-1]&&(o=1);this[e+s]=(t/a>>0)-o&255}return e+i};a.prototype.writeIntBE=function(t,e,i,r){t=+t;e>>>=0;if(!r){var n=Math.pow(2,8*i-1);O(this,t,e,i,n-1,-n)}var s=i-1,a=1,o=0;this[e+s]=255&t;for(;--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};a.prototype.writeInt8=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,1,127,-128);t<0&&(t=255+t+1);this[e]=255&t;return e+1};a.prototype.writeInt16LE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,2,32767,-32768);this[e]=255&t;this[e+1]=t>>>8;return e+2};a.prototype.writeInt16BE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,2,32767,-32768);this[e]=t>>>8;this[e+1]=255&t;return e+2};a.prototype.writeInt32LE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,4,2147483647,-2147483648);this[e]=255&t;this[e+1]=t>>>8;this[e+2]=t>>>16;this[e+3]=t>>>24;return e+4};a.prototype.writeInt32BE=function(t,e,i){t=+t;e>>>=0;i||O(this,t,e,4,2147483647,-2147483648);t<0&&(t=4294967295+t+1);this[e]=t>>>24;this[e+1]=t>>>16;this[e+2]=t>>>8;this[e+3]=255&t;return e+4};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 T(t,e,i,n,s){e=+e;i>>>=0;s||R(t,0,i,4);r.write(t,e,i,n,23,4);return i+4}a.prototype.writeFloatLE=function(t,e,i){return T(this,t,e,!0,i)};a.prototype.writeFloatBE=function(t,e,i){return T(this,t,e,!1,i)};function I(t,e,i,n,s){e=+e;i>>>=0;s||R(t,0,i,8);r.write(t,e,i,n,52,8);return i+8}a.prototype.writeDoubleLE=function(t,e,i){return I(this,t,e,!0,i)};a.prototype.writeDoubleBE=function(t,e,i){return I(this,t,e,!1,i)};a.prototype.copy=function(t,e,i,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");i||(i=0);r||0===r||(r=this.length);e>=t.length&&(e=t.length);e||(e=0);r>0&&r<i&&(r=i);if(r===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);t.length-e<r-i&&(r=t.length-e+i);var n=r-i;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,i,r);else if(this===t&&i<e&&e<r)for(var s=n-1;s>=0;--s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,r),e);return n};a.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e){r=e;e=0;i=this.length}else if("string"==typeof i){r=i;i=this.length}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var n=t.charCodeAt(0);("utf8"===r&&n<128||"latin1"===r)&&(t=n)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e>>>=0;i=void 0===i?this.length:i>>>0;t||(t=0);var s;if("number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{var o=a.isBuffer(t)?t:a.from(t,r),h=o.length;if(0===h)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=o[s%h]}return this};var N=/[^+/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var i,r=t.length,n=null,s=[],a=0;a<r;++a){if((i=t.charCodeAt(a))>55295&&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);n=null;if(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 e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,e,i,r){for(var n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:13}],13:[function(t,e,i){i.read=function(t,e,i,r,n){var s,a,o=8*n-r-1,h=(1<<o)-1,u=h>>1,l=-7,c=i?n-1:0,f=i?-1:1,p=t[e+c];c+=f;s=p&(1<<-l)-1;p>>=-l;l+=o;for(;l>0;s=256*s+t[e+c],c+=f,l-=8);a=s&(1<<-l)-1;s>>=-l;l+=r;for(;l>0;a=256*a+t[e+c],c+=f,l-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r);s-=u}return(p?-1:1)*a*Math.pow(2,s-r)};i.write=function(t,e,i,r,n,s){var a,o,h,u=8*s-n-1,l=(1<<u)-1,c=l>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===1/0){o=isNaN(e)?1:0;a=l}else{a=Math.floor(Math.log(e)/Math.LN2);if(e*(h=Math.pow(2,-a))<1){a--;h*=2}if((e+=a+c>=1?f/h:f*Math.pow(2,1-c))*h>=2){a++;h/=2}if(a+c>=l){o=0;a=l}else if(a+c>=1){o=(e*h-1)*Math.pow(2,n);a+=c}else{o=e*Math.pow(2,c-1)*Math.pow(2,n);a=0}}for(;n>=8;t[i+p]=255&o,p+=d,o/=256,n-=8);a=a<<n|o;u+=n;for(;u>0;t[i+p]=255&a,p+=d,a/=256,u-=8);t[i+p-d]|=128*m}},{}],14:[function(t,e,i){(function(t){(function(){"use strict";var i,r,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var s=0,a=new n(l),o=t.document.createTextNode("");a.observe(o,{characterData:!0});i=function(){o.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l();e.onreadystatechange=null;e.parentNode.removeChild(e);e=null};t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var h=new t.MessageChannel;h.port1.onmessage=l;i=function(){h.port2.postMessage(0)}}var u=[];function l(){r=!0;for(var t,e,i=u.length;i;){e=u;u=[];t=-1;for(;++t<i;)e[t]();i=u.length}r=!1}e.exports=function(t){1!==u.push(t)||r||i()}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(t,e,i){(function(r,n,s){(function(){!function(t){if("object"==typeof i&&void 0!==e)e.exports=t();else{("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){(function(r){!function(t){"object"==typeof i&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){(function(r){!function(t){"object"==typeof i&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){(function(r){!function(t){"object"==typeof i&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){(function(r){!function(t){"object"==typeof i&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){(function(r){!function(t){"object"==typeof i&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(i,r,n){function s(o,h){if(!r[o]){if(!i[o]){var u="function"==typeof t&&t;if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,e,i,r,n)}return r[o].exports}for(var a="function"==typeof t&&t,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){"use strict";var r=t("./utils"),n=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,n,a,o,h,u,l=[],c=0,f=t.length,p=f,d="string"!==r.getTypeOf(t);c<t.length;)p=f-c,n=d?(e=t[c++],i=c<f?t[c++]:0,c<f?t[c++]:0):(e=t.charCodeAt(c++),i=c<f?t.charCodeAt(c++):0,c<f?t.charCodeAt(c++):0),a=e>>2,o=(3&e)<<4|i>>4,h=1<p?(15&i)<<2|n>>6:64,u=2<p?63&n:64,l.push(s.charAt(a)+s.charAt(o)+s.charAt(h)+s.charAt(u));return l.join("")},i.decode=function(t){var e,i,r,a,o,h,u=0,l=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var c,f=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(c=n.uint8array?new Uint8Array(0|f):new Array(0|f);u<t.length;)e=s.indexOf(t.charAt(u++))<<2|(a=s.indexOf(t.charAt(u++)))>>4,i=(15&a)<<4|(o=s.indexOf(t.charAt(u++)))>>2,r=(3&o)<<6|(h=s.indexOf(t.charAt(u++))),c[l++]=e,64!==o&&(c[l++]=i),64!==h&&(c[l++]=r);return c}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var r=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,i,r,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=r,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,i){return t.pipe(new s).pipe(new a("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var r=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(t){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var r=t("./utils"),n=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}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==r.getTypeOf(t)?function(t,e,i){var r=n,s=0+i;t^=-1;for(var a=0;a<s;a++)t=t>>>8^r[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i){var r=n,s=0+i;t^=-1;for(var a=0;a<s;a++)t=t>>>8^r[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var r;r="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:r}},{lie:37}],7:[function(t,e,i){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),a=t("./stream/GenericWorker"),o=r?"uint8array":"array";function h(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",s.inherits(h,a),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,t.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new h("Deflate",t)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";function r(t,e){var i,r="";for(i=0;i<e;i++)r+=String.fromCharCode(255&t),t>>>=8;return r}function n(t,e,i,n,a,l){var c,f,p=t.file,d=t.compression,m=l!==o.utf8encode,y=s.transformTo("string",l(p.name)),g=s.transformTo("string",o.utf8encode(p.name)),_=p.comment,v=s.transformTo("string",l(_)),b=s.transformTo("string",o.utf8encode(_)),w=g.length!==p.name.length,M=b.length!==_.length,x="",E="",k="",C=p.dir,S=p.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var P=0;e&&(P|=8),m||!w&&!M||(P|=2048);var j,O=0,R=0;C&&(O|=16),"UNIX"===a?(R=798,O|=((j=p.unixPermissions)||(j=C?16893:33204),(65535&j)<<16)):(R=20,O|=63&(p.dosPermissions||0)),c=S.getUTCHours(),c<<=6,c|=S.getUTCMinutes(),c<<=5,c|=S.getUTCSeconds()/2,f=S.getUTCFullYear()-1980,f<<=4,f|=S.getUTCMonth()+1,f<<=5,f|=S.getUTCDate(),w&&(x+="up"+r((E=r(1,1)+r(h(y),4)+g).length,2)+E),M&&(x+="uc"+r((k=r(1,1)+r(h(v),4)+b).length,2)+k);var T="";return T+="\n\0",T+=r(P,2),T+=d.magic,T+=r(c,2),T+=r(f,2),T+=r(A.crc32,4),T+=r(A.compressedSize,4),T+=r(A.uncompressedSize,4),T+=r(y.length,2),T+=r(x.length,2),{fileRecord:u.LOCAL_FILE_HEADER+T+y+x,dirRecord:u.CENTRAL_FILE_HEADER+r(R,2)+T+r(v.length,2)+"\0\0\0\0"+r(O,4)+r(n,4)+y+x+v}}var s=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),h=t("../crc32"),u=t("../signature");function l(t,e,i,r){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(l,a),l.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-r-1))/i:100}}))},l.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(t){this.accumulate=!1;var e,i=this.streamFiles&&!t.file.dir,s=n(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),i)this.push({data:(e=t,u.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i,n,a,o,h,l,c=this.bytesWritten-t,f=(i=this.dirRecords.length,n=c,a=t,o=this.zipComment,h=this.encodeFileName,l=s.transformTo("string",h(o)),u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(i,2)+r(i,2)+r(n,4)+r(a,4)+r(l.length,2)+l);this.push({data:f,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){"use strict";var r=t("../compressions"),n=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var s=new n(e.streamFiles,i,e.platform,e.encodeFileName),a=0;try{t.forEach((function(t,i){a++;var n=function(t,e){var i=t||e,n=r[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),o=i.options.compressionOptions||e.compressionOptions||{},h=i.dir,u=i.date;i._compressWorker(n,o).withStreamInfo("file",{name:t,dir:h,date:u,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(s)})),s.entriesCount=a}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new r;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(r.prototype=t("./object")).loadAsync=t("./load"),r.support=t("./support"),r.defaults=t("./defaults"),r.version="3.5.0",r.loadAsync=function(t,e){return(new r).loadAsync(t,e)},r.external=t("./external"),e.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){"use strict";var r=t("./utils"),n=t("./external"),s=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function u(t){return new n.Promise((function(e,i){var r=t.decompressed.getContentWorker().pipe(new o);r.on("error",(function(t){i(t)})).on("end",(function(){r.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var i=this;return e=r.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),h.isNode&&h.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var i=new a(e);return i.load(t),i})).then((function(t){var i=[n.Promise.resolve(t)],r=t.files;if(e.checkCRC32)for(var s=0;s<r.length;s++)i.push(u(r[s]));return n.Promise.all(i)})).then((function(t){for(var r=t.shift(),n=r.files,s=0;s<n.length;s++){var a=n[s];i.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders})}return r.zipComment.length&&(i.comment=r.zipComment),i}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){"use strict";var r=t("../utils"),n=t("../stream/GenericWorker");function s(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}r.inherits(s,n),s.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},s.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){"use strict";var r=t("readable-stream").Readable;function n(t,e,i){r.call(this,e),this._helper=t;var n=this;t.on("data",(function(t,e){n.push(t)||n._helper.pause(),i&&i(e)})).on("error",(function(t){n.emit("error",t)})).on("end",(function(){n.push(null)}))}t("../utils").inherits(n,r),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,i){"use strict";e.exports={isNode:void 0!==n,newBufferFrom:function(t,e){if(n.from&&n.from!==Uint8Array.from)return n.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new n(t,e)},allocBuffer:function(t){if(n.alloc)return n.alloc(t);var e=new n(t);return e.fill(0),e},isBuffer:function(t){return n.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){"use strict";function r(t,e,i){var r,s=a.getTypeOf(e),h=a.extend(i||{},u);h.date=h.date||new Date,null!==h.compression&&(h.compression=h.compression.toUpperCase()),"string"==typeof h.unixPermissions&&(h.unixPermissions=parseInt(h.unixPermissions,8)),h.unixPermissions&&16384&h.unixPermissions&&(h.dir=!0),h.dosPermissions&&16&h.dosPermissions&&(h.dir=!0),h.dir&&(t=n(t)),h.createFolders&&(r=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""}(t))&&m.call(this,r,!0);var f,y="string"===s&&!1===h.binary&&!1===h.base64;i&&void 0!==i.binary||(h.binary=!y),(e instanceof l&&0===e.uncompressedSize||h.dir||!e||0===e.length)&&(h.base64=!1,h.binary=!0,e="",h.compression="STORE",s="string"),f=e instanceof l||e instanceof o?e:p.isNode&&p.isStream(e)?new d(t,e):a.prepareContent(t,e,h.binary,h.optimizedBinaryString,h.base64);var g=new c(t,f,h);this.files[t]=g}function n(t){return"/"!==t.slice(-1)&&(t+="/"),t}var s=t("./utf8"),a=t("./utils"),o=t("./stream/GenericWorker"),h=t("./stream/StreamHelper"),u=t("./defaults"),l=t("./compressedObject"),c=t("./zipObject"),f=t("./generate"),p=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),m=function(t,e){return e=void 0!==e?e:u.createFolders,t=n(t),this.files[t]||r.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function y(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,r;for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,r))},filter:function(t){var e=[];return this.forEach((function(i,r){t(i,r)&&e.push(r)})),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,r.call(this,t,e,i),this;if(y(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(y(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=m.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<i.length;r++)delete this.files[i[r].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=a.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");a.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var r=i.comment||this.comment||"";e=f.generateWorker(this,i,r)}catch(t){(e=new o("error")).error(t)}return new h(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=g},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){"use strict";var r=t("./DataReader");function n(t){r.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,r),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),s=this.length-4;0<=s;--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.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&i===s[1]&&r===s[2]&&n===s[3]},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},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var r=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=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){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,i){"use strict";var r=t("./Uint8ArrayReader");function n(t){r.call(this,t)}t("../utils").inherits(n,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},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var r=t("./DataReader");function n(t){r.call(this,t)}t("../utils").inherits(n,r),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},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},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var r=t("./ArrayReader");function n(t){r.call(this,t)}t("../utils").inherits(n,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},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var r=t("../utils"),n=t("../support"),s=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=r.getTypeOf(t);return r.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new o(t):n.uint8array?new h(r.transformTo("uint8array",t)):new s(r.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var r=t("./GenericWorker"),n=t("../utils");function s(t){r.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,r),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var r=t("./GenericWorker"),n=t("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,r),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var r=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}r.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var r=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=r.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}r.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function r(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=r},{}],29:[function(t,e,i){"use strict";var r=t("../utils"),s=t("./ConvertWorker"),a=t("./GenericWorker"),o=t("../base64"),h=t("../support"),u=t("../external"),l=null;if(h.nodestream)try{l=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,i){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=i,r.checkSupport(n),this._worker=t.pipe(new s(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return e=this,i=t,new u.Promise((function(t,s){var a=[],h=e._internalType,u=e._outputType,l=e._mimeType;e.on("data",(function(t,e){a.push(t),i&&i(e)})).on("error",(function(t){a=[],s(t)})).on("end",(function(){try{var e=function(t,e,i){switch(t){case"blob":return r.newBlob(r.transformTo("arraybuffer",e),i);case"base64":return o.encode(e);default:return r.transformTo(t,e)}}(u,function(t,e){var i,r=0,s=null,a=0;for(i=0;i<e.length;i++)a+=e[i].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(s=new Uint8Array(a),i=0;i<e.length;i++)s.set(e[i],r),r+=e[i].length;return s;case"nodebuffer":return n.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(h,a),l);t(e)}catch(e){s(e)}a=[]})).resume()}));var e,i},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,(function(t){e.call(i,t.data,t.meta)})):this._worker.on(t,(function(){r.delay(e,arguments,i)})),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,i){"use strict";if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,i.nodebuffer=void 0!==n,i.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)i.blob=!1;else{var r=new ArrayBuffer(0);try{i.blob=0===new Blob([r],{type:"application/zip"}).size}catch(t){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(r),i.blob=0===s.getBlob("application/zip").size}catch(t){i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch(t){i.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){"use strict";for(var r=t("./utils"),n=t("./support"),s=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=new Array(256),h=0;h<256;h++)o[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,i.utf8encode=function(t){return n.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var e,i,r,s,a,o=t.length,h=0;for(s=0;s<o;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=n.uint8array?new Uint8Array(h):new Array(h),s=a=0;a<h;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(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)},i.utf8decode=function(t){return n.nodebuffer?r.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,n,s,a=t.length,h=new Array(2*a);for(e=i=0;e<a;)if((n=t[e++])<128)h[i++]=n;else if(4<(s=o[n]))h[i++]=65533,e+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&e<a;)n=n<<6|63&t[e++],s--;1<s?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)}(t=r.transformTo(n.uint8array?"uint8array":"array",t))},r.inherits(u,a),u.prototype.processChunk=function(t){var e=r.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}(e),h=e;a!==e.length&&(n.uint8array?(h=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(h=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:i.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,r.inherits(l,a),l.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var r=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),a=t("set-immediate-shim"),o=t("./external");function h(t){return t}function u(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(i){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(t),r.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(t,e,i){var r=[],n=0,s=t.length;if(s<=i)return String.fromCharCode.apply(null,t);for(;n<s;)"array"===e||"nodebuffer"===e?r.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,s)))):r.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,s)))),n+=i;return r.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function c(t){var e=65536,r=i.getTypeOf(t),n=!0;if("uint8array"===r?n=l.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=l.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return l.stringifyByChunk(t,r,e)}catch(t){e=Math.floor(e/2)}return l.stringifyByChar(t)}function f(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=c;var p={};p.string={string:h,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return p.string.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:function(t){return u(t,s.allocBuffer(t.length))}},p.array={string:c,array:h,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},p.arraybuffer={string:function(t){return c(new Uint8Array(t))},array:function(t){return f(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:h,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},p.uint8array={string:c,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:h,nodebuffer:function(t){return s.newBufferFrom(t)}},p.nodebuffer={string:c,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return p.nodebuffer.uint8array(t).buffer},uint8array:function(t){return f(t,new Uint8Array(t.length))},nodebuffer:h},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var r=i.getTypeOf(e);return p[r][t](e)},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":r.nodebuffer&&s.isBuffer(t)?"nodebuffer":r.uint8array&&t instanceof Uint8Array?"uint8array":r.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!r[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,r="";for(i=0;i<(t||"").length;i++)r+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return r},i.delay=function(t,e,i){a((function(){t.apply(i||null,e||[])}))},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,s,a,h){return o.Promise.resolve(e).then((function(t){return r.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise((function(e,i){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(t){i(t.target.error)},r.readAsArrayBuffer(t)})):t})).then((function(e){var l,c=i.getTypeOf(e);return c?("arraybuffer"===c?e=i.transformTo("uint8array",e):"string"===c&&(h?e=n.decode(e):s&&!0!==a&&(e=u(l=e,r.uint8array?new Uint8Array(l.length):new Array(l.length)))),e):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(t,e,i){"use strict";var r=t("./reader/readerFor"),n=t("./utils"),s=t("./signature"),a=t("./zipEntry"),o=(t("./utf8"),t("./support"));function h(t){this.files=[],this.loadOptions=t}h.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var r=this.reader.readString(4)===e;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",i=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,r=this.zip64EndOfCentralSize-44;0<r;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var r=e-i;if(0<r)this.isSignature(e,s.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(t){this.reader=r(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var r=t("./reader/readerFor"),n=t("./utils"),s=t("./compressedObject"),a=t("./crc32"),o=t("./utf8"),h=t("./compressions"),u=t("./support");function l(t,e){this.options=t,this.loadOptions=e}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},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 information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in h)if(h.hasOwnProperty(e)&&h[e].magic===t)return h[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(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);var e=t.readInt(2);if(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");t.skip(e),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=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+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),i=t.readInt(2),r=t.readData(i),this.extraFields[e]={id:e,length:i,value:r};t.setIndex(n)},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var s=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=r(t.value);return 1!==e.readInt(1)||a(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=r(t.value);return 1!==e.readInt(1)||a(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){"use strict";function r(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._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var n=t("./stream/StreamHelper"),s=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),h=t("./stream/GenericWorker");r.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(e=e.pipe(new a.Utf8EncodeWorker)),!s&&r&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new h("error")).error(t)}return new n(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof h?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<u.length;c++)r.prototype[u[c]]=l;e.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){"use strict";var i,r,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var s=0,a=new n(l),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var h=new t.MessageChannel;h.port1.onmessage=l,i=function(){h.port2.postMessage(0)}}var u=[];function l(){var t,e;r=!0;for(var i=u.length;i;){for(e=u,u=[],t=-1;++t<i;)e[t]();i=u.length}r=!1}e.exports=function(t){1!==u.push(t)||r||i()}}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){"use strict";var r=t("immediate");function n(){}var s={},a=["REJECTED"],o=["FULFILLED"],h=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function l(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 c(t,e,i){r((function(){var r;try{r=e(i)}catch(r){return s.reject(t,r)}r===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,r)}))}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(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=d((function(){e(n,r)}));"error"===a.status&&r(a.value)}function d(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}(e.exports=u).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}))}))},u.prototype.catch=function(t){return this.then(null,t)},u.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);return this.state!==h?c(i,this.state===o?t:e,this.outcome):this.queue.push(new l(i,t,e)),i},l.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){s.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},s.resolve=function(t,e){var i=d(f,e);if("error"===i.status)return s.reject(t,i.value);var r=i.value;if(r)p(t,r);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t},s.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,r=t.queue.length;++i<r;)t.queue[i].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:s.resolve(new this(n),t)},u.reject=function(t){var e=new this(n);return s.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,r=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,h=-1,u=new this(n);++h<i;)l(t[h],h);return u;function l(t,n){e.resolve(t).then((function(t){a[n]=t,++o!==i||r||(r=!0,s.resolve(u,a))}),(function(t){r||(r=!0,s.reject(u,t))}))}},u.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,i=!1;if(!e)return this.resolve([]);for(var r,a=-1,o=new this(n);++a<e;)r=t[a],this.resolve(r).then((function(t){i||(i=!0,s.resolve(o,t))}),(function(t){i||(i=!0,s.reject(o,t))}));return o}},{immediate:36}],38:[function(t,e,i){"use strict";var r={};(0,t("./lib/utils/common").assign)(r,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){"use strict";var r=t("./zlib/deflate"),n=t("./utils/common"),s=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),h=Object.prototype.toString,u=0,l=-1,c=0,f=8;function p(t){if(!(this instanceof p))return new p(t);this.options=n.assign({level:l,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&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(i!==u)throw new Error(a[i]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?s.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(i=r.deflateSetDictionary(this.strm,d))!==u)throw new Error(a[i]);this._dict_set=!0}}function d(t,e){var i=new p(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}p.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))&&i!==u)return this.onEnd(i),!(this.ended=!0);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((0<o.avail_in||0===o.avail_out)&&1!==i);return 4===a?(i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===u):2!==a||(this.onEnd(u),!(o.avail_out=0))},p.prototype.onData=function(t){this.chunks.push(t)},p.prototype.onEnd=function(t){t===u&&("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},i.Deflate=p,i.deflate=d,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var r=t("./zlib/inflate"),n=t("./utils/common"),s=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&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]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function f(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}c.prototype.push=function(t,e){var i,o,h,u,c,f,p=this.strm,d=this.options.chunkSize,m=this.options.dictionary,y=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?p.input=s.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(d),p.next_out=0,p.avail_out=d),(i=r.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(f="string"==typeof m?s.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,i=r.inflateSetDictionary(this.strm,f)),i===a.Z_BUF_ERROR&&!0===y&&(i=a.Z_OK,y=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&i!==a.Z_STREAM_END&&(0!==p.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(p.output,p.next_out),u=p.next_out-h,c=s.buf2string(p.output,h),p.next_out=u,p.avail_out=d-u,u&&n.arraySet(p.output,p.output,h,u,0),this.onData(c)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(y=!0)}while((0<p.avail_in||0===p.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),!(p.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.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},i.Inflate=c,i.inflate=f,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},i.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,r,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),n);else for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){var e,i,r,n,s,a;for(e=r=0,i=t.length;e<i;e++)r+=t[e].length;for(a=new Uint8Array(r),e=n=0,i=t.length;e<i;e++)s=t[e],a.set(s,n),n+=s.length;return a}},s={arraySet:function(t,e,i,r,n){for(var s=0;s<r;s++)t[n+s]=e[i+s]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,s))},i.setTyped(r)},{}],42:[function(t,e,i){"use strict";var r=t("./common"),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]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function h(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,i.string2buf=function(t){var e,i,n,s,a,o=t.length,h=0;for(s=0;s<o;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=new r.Buf8(h),s=a=0;a<h;s++)55296==(64512&(i=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=t.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),i<128?e[a++]=i:(i<2048?e[a++]=192|i>>>6:(i<65536?e[a++]=224|i>>>12:(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63),e[a++]=128|i>>>6&63),e[a++]=128|63&i);return e},i.buf2binstring=function(t){return h(t,t.length)},i.binstring2buf=function(t){for(var e=new r.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,r,n,s,o=e||t.length,u=new Array(2*o);for(i=r=0;i<o;)if((n=t[i++])<128)u[r++]=n;else if(4<(s=a[n]))u[r++]=65533,i+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&i<o;)n=n<<6|63&t[i++],s--;1<s?u[r++]=65533:n<65536?u[r++]=n:(n-=65536,u[r++]=55296|n>>10&1023,u[r++]=56320|1023&n)}return h(u,r)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";e.exports=function(t,e,i,r){for(var n=65535&t|0,s=t>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3<i?2e3:i;s=s+(n=n+e[r++]|0)|0,--a;);n%=65521,s%=65521}return n|s<<16|0}},{}],44:[function(t,e,i){"use strict";e.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}},{}],45:[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}();e.exports=function(t,e,i,n){var s=r,a=n+i;t^=-1;for(var o=n;o<a;o++)t=t>>>8^s[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,i){"use strict";var r,n=t("../utils/common"),s=t("./trees"),a=t("./adler32"),o=t("./crc32"),h=t("./messages"),u=0,l=0,c=-2,f=2,p=8,d=286,m=30,y=19,g=2*d+1,_=15,v=3,b=258,w=b+v+1,M=42,x=113;function E(t,e){return t.msg=h[e],e}function k(t){return(t<<1)-(4<t?9:0)}function C(t){for(var e=t.length;0<=--e;)t[e]=0}function S(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 A(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,S(t.strm)}function P(t,e){t.pending_buf[t.pending++]=e}function j(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function O(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-w?t.strstart-(t.w_size-w):0,u=t.window,l=t.w_mask,c=t.prev,f=t.strstart+b,p=u[s+a-1],d=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(i=e)+a]===d&&u[i+a-1]===p&&u[i]===u[s]&&u[++i]===u[s+1]){s+=2,i++;do{}while(u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&u[++s]===u[++i]&&s<f);if(r=b-(f-s),s=f-b,a<r){if(t.match_start=e,o<=(a=r))break;p=u[s+a-1],d=u[s+a]}}}while((e=c[e&l])>h&&0!=--n);return a<=t.lookahead?a:t.lookahead}function R(t){var e,i,r,s,h,u,l,c,f,p,d=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-w)){for(n.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=i=t.hash_size;r=t.head[--e],t.head[e]=d<=r?r-d:0,--i;);for(e=i=d;r=t.prev[--e],t.prev[e]=d<=r?r-d:0,--i;);s+=d}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,c=t.strstart+t.lookahead,p=void 0,(f=s)<(p=u.avail_in)&&(p=f),i=0===p?0:(u.avail_in-=p,n.arraySet(l,u.input,u.next_in,p,c),1===u.state.wrap?u.adler=a(u.adler,l,p,c):2===u.state.wrap&&(u.adler=o(u.adler,l,p,c)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=v)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+v-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<v)););}while(t.lookahead<w&&0!==t.strm.avail_in)}function T(t,e){for(var i,r;;){if(t.lookahead<w){if(R(t),t.lookahead<w&&e===u)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=v&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+v-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-w&&(t.match_length=O(t,i)),t.match_length>=v)if(r=s._tr_tally(t,t.strstart-t.match_start,t.match_length-v),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=v){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+v-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(A(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<v-1?t.strstart:v-1,4===e?(A(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(A(t,!1),0===t.strm.avail_out)?1:2}function I(t,e){for(var i,r,n;;){if(t.lookahead<w){if(R(t),t.lookahead<w&&e===u)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=v&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+v-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=v-1,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-w&&(t.match_length=O(t,i),t.match_length<=5&&(1===t.strategy||t.match_length===v&&4096<t.strstart-t.match_start)&&(t.match_length=v-1)),t.prev_length>=v&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-v,r=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+v-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=v-1,t.strstart++,r&&(A(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=s._tr_tally(t,0,t.window[t.strstart-1]))&&A(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<v-1?t.strstart:v-1,4===e?(A(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(A(t,!1),0===t.strm.avail_out)?1:2}function N(t,e,i,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=n}function L(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(2*g),this.dyn_dtree=new n.Buf16(2*(2*m+1)),this.bl_tree=new n.Buf16(2*(2*y+1)),C(this.dyn_ltree),C(this.dyn_dtree),C(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(_+1),this.heap=new n.Buf16(2*d+1),C(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*d+1),C(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function B(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=f,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?M:x,t.adler=2===e.wrap?0:1,e.last_flush=u,s._tr_init(e),l):E(t,c)}function F(t){var e,i=B(t);return i===l&&((e=t.state).window_size=2*e.w_size,C(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=v-1,e.match_available=0,e.ins_h=0),i}function D(t,e,i,r,s,a){if(!t)return c;var o=1;if(-1===e&&(e=6),r<0?(o=0,r=-r):15<r&&(o=2,r-=16),s<1||9<s||i!==p||r<8||15<r||e<0||9<e||a<0||4<a)return E(t,c);8===r&&(r=9);var h=new L;return(t.state=h).strm=t,h.wrap=o,h.gzhead=null,h.w_bits=r,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+v-1)/v),h.window=new n.Buf8(2*h.w_size),h.head=new n.Buf16(h.hash_size),h.prev=new n.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new n.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=a,h.method=i,F(t)}r=[new N(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(R(t),0===t.lookahead&&e===u)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,A(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-w&&(A(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(A(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(A(t,!1),t.strm.avail_out),1)})),new N(4,4,8,4,T),new N(4,5,16,8,T),new N(4,6,32,32,T),new N(4,4,16,16,I),new N(8,16,32,32,I),new N(8,16,128,128,I),new N(8,32,128,256,I),new N(32,128,258,1024,I),new N(32,258,258,4096,I)],i.deflateInit=function(t,e){return D(t,e,p,15,8,0)},i.deflateInit2=D,i.deflateReset=F,i.deflateResetKeep=B,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?c:(t.state.gzhead=e,l):c},i.deflate=function(t,e){var i,n,a,h;if(!t||!t.state||5<e||e<0)return t?E(t,c):c;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return E(t,0===t.avail_out?-5:c);if(n.strm=t,i=n.last_flush,n.last_flush=e,n.status===M)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:2<=n.strategy||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:2<=n.strategy||n.level<2?4:0),P(n,3),n.status=x);else{var f=p+(n.w_bits-8<<4)<<8;f|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(f|=32),f+=31-f%31,n.status=x,j(n,f),0!==n.strstart&&(j(n,t.adler>>>16),j(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)),S(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)),S(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,P(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>a&&(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)),S(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,P(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>a&&(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&&S(t),n.pending+2<=n.pending_buf_size&&(P(n,255&t.adler),P(n,t.adler>>8&255),t.adler=0,n.status=x)):n.status=x),0!==n.pending){if(S(t),0===t.avail_out)return n.last_flush=-1,l}else if(0===t.avail_in&&k(e)<=k(i)&&4!==e)return E(t,-5);if(666===n.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==u&&666!==n.status){var d=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(R(t),0===t.lookahead)){if(e===u)return 1;break}if(t.match_length=0,i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(A(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(A(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(A(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<=b){if(R(t),t.lookahead<=b&&e===u)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=v&&0<t.strstart&&(r=o[n=t.strstart-1])===o[++n]&&r===o[++n]&&r===o[++n]){a=t.strstart+b;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]&&n<a);t.match_length=b-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=v?(i=s._tr_tally(t,1,t.match_length-v),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&&(A(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(A(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(A(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==d&&4!==d||(n.status=666),1===d||3===d)return 0===t.avail_out&&(n.last_flush=-1),l;if(2===d&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(C(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),S(t),0===t.avail_out))return n.last_flush=-1,l}return 4!==e?l: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)):(j(n,t.adler>>>16),j(n,65535&t.adler)),S(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?l:1)},i.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==M&&69!==e&&73!==e&&91!==e&&103!==e&&e!==x&&666!==e?E(t,c):(t.state=null,e===x?E(t,-3):l):c},i.deflateSetDictionary=function(t,e){var i,r,s,o,h,u,f,p,d=e.length;if(!t||!t.state)return c;if(2===(o=(i=t.state).wrap)||1===o&&i.status!==M||i.lookahead)return c;for(1===o&&(t.adler=a(t.adler,e,d,0)),i.wrap=0,d>=i.w_size&&(0===o&&(C(i.head),i.strstart=0,i.block_start=0,i.insert=0),p=new n.Buf8(i.w_size),n.arraySet(p,e,d-i.w_size,i.w_size,0),e=p,d=i.w_size),h=t.avail_in,u=t.next_in,f=t.input,t.avail_in=d,t.next_in=0,t.input=e,R(i);i.lookahead>=v;){for(r=i.strstart,s=i.lookahead-(v-1);i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+v-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,--s;);i.strstart=r,i.lookahead=v-1,R(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=v-1,i.match_available=0,t.next_in=u,t.input=f,t.avail_in=h,i.wrap=o,l},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){"use strict";e.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}},{}],48:[function(t,e,i){"use strict";e.exports=function(t,e){var i,r,n,s,a,o,h,u,l,c,f,p,d,m,y,g,_,v,b,w,M,x,E,k,C;i=t.state,r=t.next_in,k=t.input,n=r+(t.avail_in-5),s=t.next_out,C=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),h=i.dmax,u=i.wsize,l=i.whave,c=i.wnext,f=i.window,p=i.hold,d=i.bits,m=i.lencode,y=i.distcode,g=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;t:do{d<15&&(p+=k[r++]<<d,d+=8,p+=k[r++]<<d,d+=8),v=m[p&g];e:for(;;){if(p>>>=b=v>>>24,d-=b,0==(b=v>>>16&255))C[s++]=65535&v;else{if(!(16&b)){if(0==(64&b)){v=m[(65535&v)+(p&(1<<b)-1)];continue e}if(32&b){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}w=65535&v,(b&=15)&&(d<b&&(p+=k[r++]<<d,d+=8),w+=p&(1<<b)-1,p>>>=b,d-=b),d<15&&(p+=k[r++]<<d,d+=8,p+=k[r++]<<d,d+=8),v=y[p&_];i:for(;;){if(p>>>=b=v>>>24,d-=b,!(16&(b=v>>>16&255))){if(0==(64&b)){v=y[(65535&v)+(p&(1<<b)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(M=65535&v,d<(b&=15)&&(p+=k[r++]<<d,(d+=8)<b&&(p+=k[r++]<<d,d+=8)),h<(M+=p&(1<<b)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=b,d-=b,(b=s-a)<M){if(l<(b=M-b)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(E=f,(x=0)===c){if(x+=u-b,b<w){for(w-=b;C[s++]=f[x++],--b;);x=s-M,E=C}}else if(c<b){if(x+=u+c-b,(b-=c)<w){for(w-=b;C[s++]=f[x++],--b;);if(x=0,c<w){for(w-=b=c;C[s++]=f[x++],--b;);x=s-M,E=C}}}else if(x+=c-b,b<w){for(w-=b;C[s++]=f[x++],--b;);x=s-M,E=C}for(;2<w;)C[s++]=E[x++],C[s++]=E[x++],C[s++]=E[x++],w-=3;w&&(C[s++]=E[x++],1<w&&(C[s++]=E[x++]))}else{for(x=s-M;C[s++]=C[x++],C[s++]=C[x++],C[s++]=C[x++],2<(w-=3););w&&(C[s++]=C[x++],1<w&&(C[s++]=C[x++]))}break}}break}}while(r<n&&s<o);r-=w=d>>3,p&=(1<<(d-=w<<3))-1,t.next_in=r,t.next_out=s,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=s<o?o-s+257:257-(s-o),i.hold=p,i.bits=d}},{}],49:[function(t,e,i){"use strict";var r=t("../utils/common"),n=t("./adler32"),s=t("./crc32"),a=t("./inffast"),o=t("./inftrees"),h=1,u=2,l=0,c=-2,f=1,p=852,d=592;function m(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function y(){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 g(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=f,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(p),e.distcode=e.distdyn=new r.Buf32(d),e.sane=1,e.back=-1,l):c}function _(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,g(t)):c}function v(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||15<e)?c:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,_(t))):c}function b(t,e){var i,r;return t?(r=new y,(t.state=r).window=null,(i=v(t,e))!==l&&(t.state=null),i):c}var w,M,x=!0;function E(t){if(x){var e;for(w=new r.Buf32(512),M=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(h,t.lens,0,288,w,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(u,t.lens,0,32,M,0,t.work,{bits:5}),x=!1}t.lencode=w,t.lenbits=9,t.distcode=M,t.distbits=5}function k(t,e,i,n){var s,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),n>=a.wsize?(r.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n<(s=a.wsize-a.wnext)&&(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<a.wsize&&(a.whave+=s))),0}i.inflateReset=_,i.inflateReset2=v,i.inflateResetKeep=g,i.inflateInit=function(t){return b(t,15)},i.inflateInit2=b,i.inflate=function(t,e){var i,p,d,y,g,_,v,b,w,M,x,C,S,A,P,j,O,R,T,I,N,L,B,F,D=0,z=new r.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return c;12===(i=t.state).mode&&(i.mode=13),g=t.next_out,d=t.output,v=t.avail_out,y=t.next_in,p=t.input,_=t.avail_in,b=i.hold,w=i.bits,M=_,x=v,L=l;t:for(;;)switch(i.mode){case f:if(0===i.wrap){i.mode=13;break}for(;w<16;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(2&i.wrap&&35615===b){z[i.check=0]=255&b,z[1]=b>>>8&255,i.check=s(i.check,z,2,0),w=b=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",i.mode=30;break}if(w-=4,N=8+(15&(b>>>=4)),0===i.wbits)i.wbits=N;else if(N>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<N,t.adler=i.check=1,i.mode=512&b?10:12,w=b=0;break;case 2:for(;w<16;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(i.flags=b,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=b>>8&1),512&i.flags&&(z[0]=255&b,z[1]=b>>>8&255,i.check=s(i.check,z,2,0)),w=b=0,i.mode=3;case 3:for(;w<32;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.head&&(i.head.time=b),512&i.flags&&(z[0]=255&b,z[1]=b>>>8&255,z[2]=b>>>16&255,z[3]=b>>>24&255,i.check=s(i.check,z,4,0)),w=b=0,i.mode=4;case 4:for(;w<16;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.head&&(i.head.xflags=255&b,i.head.os=b>>8),512&i.flags&&(z[0]=255&b,z[1]=b>>>8&255,i.check=s(i.check,z,2,0)),w=b=0,i.mode=5;case 5:if(1024&i.flags){for(;w<16;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.length=b,i.head&&(i.head.extra_len=b),512&i.flags&&(z[0]=255&b,z[1]=b>>>8&255,i.check=s(i.check,z,2,0)),w=b=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(_<(C=i.length)&&(C=_),C&&(i.head&&(N=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,p,y,C,N)),512&i.flags&&(i.check=s(i.check,p,C,y)),_-=C,y+=C,i.length-=C),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===_)break t;for(C=0;N=p[y+C++],i.head&&N&&i.length<65536&&(i.head.name+=String.fromCharCode(N)),N&&C<_;);if(512&i.flags&&(i.check=s(i.check,p,C,y)),_-=C,y+=C,N)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===_)break t;for(C=0;N=p[y+C++],i.head&&N&&i.length<65536&&(i.head.comment+=String.fromCharCode(N)),N&&C<_;);if(512&i.flags&&(i.check=s(i.check,p,C,y)),_-=C,y+=C,N)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;w<16;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(b!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}w=b=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;w<32;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}t.adler=i.check=m(b),w=b=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=g,t.avail_out=v,t.next_in=y,t.avail_in=_,i.hold=b,i.bits=w,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){b>>>=7&w,w-=7&w,i.mode=27;break}for(;w<3;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}switch(i.last=1&b,w-=1,3&(b>>>=1)){case 0:i.mode=14;break;case 1:if(E(i),i.mode=20,6!==e)break;b>>>=2,w-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}b>>>=2,w-=2;break;case 14:for(b>>>=7&w,w-=7&w;w<32;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if((65535&b)!=(b>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&b,w=b=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(C=i.length){if(_<C&&(C=_),v<C&&(C=v),0===C)break t;r.arraySet(d,p,y,C,g),_-=C,y+=C,v-=C,g+=C,i.length-=C;break}i.mode=12;break;case 17:for(;w<14;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(i.nlen=257+(31&b),b>>>=5,w-=5,i.ndist=1+(31&b),b>>>=5,w-=5,i.ncode=4+(15&b),b>>>=4,w-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;w<3;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.lens[U[i.have++]]=7&b,b>>>=3,w-=3}for(;i.have<19;)i.lens[U[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,B={bits:i.lenbits},L=o(0,i.lens,0,19,i.lencode,0,i.work,B),i.lenbits=B.bits,L){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;j=(D=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,O=65535&D,!((P=D>>>24)<=w);){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(O<16)b>>>=P,w-=P,i.lens[i.have++]=O;else{if(16===O){for(F=P+2;w<F;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(b>>>=P,w-=P,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}N=i.lens[i.have-1],C=3+(3&b),b>>>=2,w-=2}else if(17===O){for(F=P+3;w<F;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}w-=P,N=0,C=3+(7&(b>>>=P)),b>>>=3,w-=3}else{for(F=P+7;w<F;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}w-=P,N=0,C=11+(127&(b>>>=P)),b>>>=7,w-=7}if(i.have+C>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;C--;)i.lens[i.have++]=N}}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,B={bits:i.lenbits},L=o(h,i.lens,0,i.nlen,i.lencode,0,i.work,B),i.lenbits=B.bits,L){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,B={bits:i.distbits},L=o(u,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,B),i.distbits=B.bits,L){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(6<=_&&258<=v){t.next_out=g,t.avail_out=v,t.next_in=y,t.avail_in=_,i.hold=b,i.bits=w,a(t,x),g=t.next_out,d=t.output,v=t.avail_out,y=t.next_in,p=t.input,_=t.avail_in,b=i.hold,w=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;j=(D=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,O=65535&D,!((P=D>>>24)<=w);){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(j&&0==(240&j)){for(R=P,T=j,I=O;j=(D=i.lencode[I+((b&(1<<R+T)-1)>>R)])>>>16&255,O=65535&D,!(R+(P=D>>>24)<=w);){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}b>>>=R,w-=R,i.back+=R}if(b>>>=P,w-=P,i.back+=P,i.length=O,0===j){i.mode=26;break}if(32&j){i.back=-1,i.mode=12;break}if(64&j){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&j,i.mode=22;case 22:if(i.extra){for(F=i.extra;w<F;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.length+=b&(1<<i.extra)-1,b>>>=i.extra,w-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;j=(D=i.distcode[b&(1<<i.distbits)-1])>>>16&255,O=65535&D,!((P=D>>>24)<=w);){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(0==(240&j)){for(R=P,T=j,I=O;j=(D=i.distcode[I+((b&(1<<R+T)-1)>>R)])>>>16&255,O=65535&D,!(R+(P=D>>>24)<=w);){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}b>>>=R,w-=R,i.back+=R}if(b>>>=P,w-=P,i.back+=P,64&j){t.msg="invalid distance code",i.mode=30;break}i.offset=O,i.extra=15&j,i.mode=24;case 24:if(i.extra){for(F=i.extra;w<F;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}i.offset+=b&(1<<i.extra)-1,b>>>=i.extra,w-=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===v)break t;if(C=x-v,i.offset>C){if((C=i.offset-C)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}S=C>i.wnext?(C-=i.wnext,i.wsize-C):i.wnext-C,C>i.length&&(C=i.length),A=i.window}else A=d,S=g-i.offset,C=i.length;for(v<C&&(C=v),v-=C,i.length-=C;d[g++]=A[S++],--C;);0===i.length&&(i.mode=21);break;case 26:if(0===v)break t;d[g++]=i.length,v--,i.mode=21;break;case 27:if(i.wrap){for(;w<32;){if(0===_)break t;_--,b|=p[y++]<<w,w+=8}if(x-=v,t.total_out+=x,i.total+=x,x&&(t.adler=i.check=i.flags?s(i.check,d,x,g-x):n(i.check,d,x,g-x)),x=v,(i.flags?b:m(b))!==i.check){t.msg="incorrect data check",i.mode=30;break}w=b=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;w<32;){if(0===_)break t;_--,b+=p[y++]<<w,w+=8}if(b!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}w=b=0}i.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;default:return c}return t.next_out=g,t.avail_out=v,t.next_in=y,t.avail_in=_,i.hold=b,i.bits=w,(i.wsize||x!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&k(t,t.output,t.next_out,x-t.avail_out)?(i.mode=31,-4):(M-=t.avail_in,x-=t.avail_out,t.total_in+=M,t.total_out+=x,i.total+=x,i.wrap&&x&&(t.adler=i.check=i.flags?s(i.check,d,x,t.next_out-x):n(i.check,d,x,t.next_out-x)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==M&&0===x||4===e)&&L===l&&(L=-5),L)},i.inflateEnd=function(t){if(!t||!t.state)return c;var e=t.state;return e.window&&(e.window=null),t.state=null,l},i.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?c:((i.head=e).done=!1,l):c},i.inflateSetDictionary=function(t,e){var i,r=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?c:11===i.mode&&n(1,e,r,0)!==i.check?-3:k(t,e,r,r)?(i.mode=31,-4):(i.havedict=1,l):c},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){"use strict";var r=t("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,h,u,l,c,f){var p,d,m,y,g,_,v,b,w,M=f.bits,x=0,E=0,k=0,C=0,S=0,A=0,P=0,j=0,O=0,R=0,T=null,I=0,N=new r.Buf16(16),L=new r.Buf16(16),B=null,F=0;for(x=0;x<=15;x++)N[x]=0;for(E=0;E<h;E++)N[e[i+E]]++;for(S=M,C=15;1<=C&&0===N[C];C--);if(C<S&&(S=C),0===C)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(k=1;k<C&&0===N[k];k++);for(S<k&&(S=k),x=j=1;x<=15;x++)if(j<<=1,(j-=N[x])<0)return-1;if(0<j&&(0===t||1!==C))return-1;for(L[1]=0,x=1;x<15;x++)L[x+1]=L[x]+N[x];for(E=0;E<h;E++)0!==e[i+E]&&(c[L[e[i+E]]++]=E);if(_=0===t?(T=B=c,19):1===t?(T=n,I-=257,B=s,F-=257,256):(T=a,B=o,-1),x=k,g=l,P=E=R=0,m=-1,y=(O=1<<(A=S))-1,1===t&&852<O||2===t&&592<O)return 1;for(;;){for(v=x-P,w=c[E]<_?(b=0,c[E]):c[E]>_?(b=B[F+c[E]],T[I+c[E]]):(b=96,0),p=1<<x-P,k=d=1<<A;u[g+(R>>P)+(d-=p)]=v<<24|b<<16|w|0,0!==d;);for(p=1<<x-1;R&p;)p>>=1;if(0!==p?(R&=p-1,R+=p):R=0,E++,0==--N[x]){if(x===C)break;x=e[i+c[E]]}if(S<x&&(R&y)!==m){for(0===P&&(P=S),g+=k,j=1<<(A=x-P);A+P<C&&!((j-=N[A+P])<=0);)A++,j<<=1;if(O+=1<<A,1===t&&852<O||2===t&&592<O)return 1;u[m=R&y]=S<<24|A<<16|g-l|0}}return 0!==R&&(u[g+R]=x-P<<24|64<<16|0),f.bits=S,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var r=t("../utils/common");function n(t){for(var e=t.length;0<=--e;)t[e]=0}var s=15,a=16,o=[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],h=[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],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);n(c);var f=new Array(60);n(f);var p=new Array(512);n(p);var d=new Array(256);n(d);var m=new Array(29);n(m);var y,g,_,v=new Array(30);function b(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 w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function M(t){return t<256?p[t]:p[256+(t>>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function E(t,e,i){t.bi_valid>a-i?(t.bi_buf|=e<<t.bi_valid&65535,x(t,t.bi_buf),t.bi_buf=e>>a-t.bi_valid,t.bi_valid+=i-a):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function k(t,e,i){E(t,i[2*e],i[2*e+1])}function C(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function S(t,e,i){var r,n,a=new Array(s+1),o=0;for(r=1;r<=s;r++)a[r]=o=o+i[r-1]<<1;for(n=0;n<=e;n++){var h=t[2*n+1];0!==h&&(t[2*n]=C(a[h]++,h))}}function A(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 P(t){8<t.bi_valid?x(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function j(t,e,i,r){var n=2*e,s=2*i;return t[n]<t[s]||t[n]===t[s]&&r[e]<=r[i]}function O(t,e,i){for(var r=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&j(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!j(e,r,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=r}function R(t,e,i){var r,n,s,a,u=0;if(0!==t.last_lit)for(;r=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],n=t.pending_buf[t.l_buf+u],u++,0===r?k(t,n,e):(k(t,(s=d[n])+256+1,e),0!==(a=o[s])&&E(t,n-=m[s],a),k(t,s=M(--r),i),0!==(a=h[s])&&E(t,r-=v[s],a)),u<t.last_lit;);k(t,256,e)}function T(t,e){var i,r,n,a=e.dyn_tree,o=e.stat_desc.static_tree,h=e.stat_desc.has_stree,u=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<u;i++)0!==a[2*i]?(t.heap[++t.heap_len]=l=i,t.depth[i]=0):a[2*i+1]=0;for(;t.heap_len<2;)a[2*(n=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[n]=0,t.opt_len--,h&&(t.static_len-=o[2*n+1]);for(e.max_code=l,i=t.heap_len>>1;1<=i;i--)O(t,a,i);for(n=u;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],O(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,a[2*n]=a[2*i]+a[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,a[2*i+1]=a[2*r+1]=n,t.heap[1]=n++,O(t,a,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,a,o,h,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,f=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,m=e.stat_desc.max_length,y=0;for(a=0;a<=s;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)m<(a=u[2*u[2*(r=t.heap[i])+1]+1]+1)&&(a=m,y++),u[2*r+1]=a,l<r||(t.bl_count[a]++,o=0,d<=r&&(o=p[r-d]),h=u[2*r],t.opt_len+=h*(a+o),f&&(t.static_len+=h*(c[2*r+1]+o)));if(0!==y){do{for(a=m-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[m]--,y-=2}while(0<y);for(a=m;0!==a;a--)for(r=t.bl_count[a];0!==r;)l<(n=t.heap[--i])||(u[2*n+1]!==a&&(t.opt_len+=(a-u[2*n+1])*u[2*n],u[2*n+1]=a),r--)}}(t,e),S(a,l,t.bl_count)}function I(t,e,i){var r,n,s=-1,a=e[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=a,a=e[2*(r+1)+1],++o<h&&n===a||(o<u?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=n,u=(o=0)===a?(h=138,3):n===a?(h=6,3):(h=7,4))}function N(t,e,i){var r,n,s=-1,a=e[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),r=0;r<=i;r++)if(n=a,a=e[2*(r+1)+1],!(++o<h&&n===a)){if(o<u)for(;k(t,n,t.bl_tree),0!=--o;);else 0!==n?(n!==s&&(k(t,n,t.bl_tree),o--),k(t,16,t.bl_tree),E(t,o-3,2)):o<=10?(k(t,17,t.bl_tree),E(t,o-3,3)):(k(t,18,t.bl_tree),E(t,o-11,7));s=n,u=(o=0)===a?(h=138,3):n===a?(h=6,3):(h=7,4)}}n(v);var L=!1;function B(t,e,i,n){var s,a,o;E(t,0+(n?1:0),3),a=e,o=i,P(s=t),x(s,o),x(s,~o),r.arraySet(s.pending_buf,s.window,a,o,s.pending),s.pending+=o}i._tr_init=function(t){L||(function(){var t,e,i,r,n,a=new Array(s+1);for(r=i=0;r<28;r++)for(m[r]=i,t=0;t<1<<o[r];t++)d[i++]=r;for(d[i-1]=r,r=n=0;r<16;r++)for(v[r]=n,t=0;t<1<<h[r];t++)p[n++]=r;for(n>>=7;r<30;r++)for(v[r]=n<<7,t=0;t<1<<h[r]-7;t++)p[256+n++]=r;for(e=0;e<=s;e++)a[e]=0;for(t=0;t<=143;)c[2*t+1]=8,t++,a[8]++;for(;t<=255;)c[2*t+1]=9,t++,a[9]++;for(;t<=279;)c[2*t+1]=7,t++,a[7]++;for(;t<=287;)c[2*t+1]=8,t++,a[8]++;for(S(c,287,a),t=0;t<30;t++)f[2*t+1]=5,f[2*t]=C(t,5);y=new b(c,o,257,286,s),g=new b(f,h,0,30,s),_=new b(new Array(0),u,0,19,7)}(),L=!0),t.l_desc=new w(t.dyn_ltree,y),t.d_desc=new w(t.dyn_dtree,g),t.bl_desc=new w(t.bl_tree,_),t.bi_buf=0,t.bi_valid=0,A(t)},i._tr_stored_block=B,i._tr_flush_block=function(t,e,i,r){var n,s,a=0;0<t.level?(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)),T(t,t.l_desc),T(t,t.d_desc),a=function(t){var e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*l[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?B(t,e,i,r):4===t.strategy||s===n?(E(t,2+(r?1:0),3),R(t,c,f)):(E(t,4+(r?1:0),3),function(t,e,i,r){var n;for(E(t,e-257,5),E(t,i-1,5),E(t,r-4,4),n=0;n<r;n++)E(t,t.bl_tree[2*l[n]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),R(t,t.dyn_ltree,t.dyn_dtree)),A(t),r&&P(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>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*(d[i]+256+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){var e;E(t,2,3),k(t,256,c),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,i){"use strict";e.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}},{}],54:[function(t,e,i){"use strict";e.exports="function"==typeof s?s:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,t("timers").setImmediate)},{buffer:12,timers:22}],16:[function(t,e,i){"use strict";var r=t("immediate");function n(){}var s={},a=["REJECTED"],o=["FULFILLED"],h=["PENDING"];e.exports=u;function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h;this.queue=[];this.outcome=void 0;t!==n&&p(this,t)}u.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}))}))};u.prototype.catch=function(t){return this.then(null,t)};u.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);if(this.state!==h){c(i,this.state===o?t:e,this.outcome)}else this.queue.push(new l(i,t,e));return i};function l(t,e,i){this.promise=t;if("function"==typeof e){this.onFulfilled=e;this.callFulfilled=this.otherCallFulfilled}if("function"==typeof i){this.onRejected=i;this.callRejected=this.otherCallRejected}}l.prototype.callFulfilled=function(t){s.resolve(this.promise,t)};l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)};l.prototype.callRejected=function(t){s.reject(this.promise,t)};l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)};function c(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)}))}s.resolve=function(t,e){var i=d(f,e);if("error"===i.status)return s.reject(t,i.value);var r=i.value;if(r)p(t,r);else{t.state=o;t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t};s.reject=function(t,e){t.state=a;t.outcome=e;for(var i=-1,r=t.queue.length;++i<r;)t.queue[i].callRejected(e);return t};function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function r(e){if(!i){i=!0;s.reject(t,e)}}function n(e){if(!i){i=!0;s.resolve(t,e)}}var a=d((function(){e(n,r)}));"error"===a.status&&r(a.value)}function d(t,e){var i={};try{i.value=t(e);i.status="success"}catch(t){i.status="error";i.value=t}return i}u.resolve=function(t){if(t instanceof this)return t;return s.resolve(new this(n),t)};u.reject=function(t){var e=new this(n);return s.reject(e,t)};u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,r=!1;if(!i)return this.resolve([]);var a=new Array(i),o=0,h=-1,u=new this(n);for(;++h<i;)l(t[h],h);return u;function l(t,n){e.resolve(t).then((function(t){a[n]=t;if(++o===i&&!r){r=!0;s.resolve(u,a)}}),(function(t){if(!r){r=!0;s.reject(u,t)}}))}};u.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,r=!1;if(!i)return this.resolve([]);var a=-1,o=new this(n);for(;++a<i;)h=t[a],e.resolve(h).then((function(t){if(!r){r=!0;s.resolve(o,t)}}),(function(t){if(!r){r=!0;s.reject(o,t)}}));var h;return o}},{immediate:14}],17:[function(t,e,i){!function(){"object"==typeof e&&e.exports?e.exports=s:this.LRUCache=s;function t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(){return 1}var r=!1;function n(t){if(!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()}Object.defineProperty(s.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0);this._max=t;this._length>this._max&&h(this)},get:function(){return this._max},enumerable:!0});Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t){this._lengthCalculator=i;this._length=this._itemCount;for(var e in this._cache)this._cache[e].length=1}else{this._lengthCalculator=t;this._length=0;for(var e in 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<r;n--)if(this._lruList[n]){i++;var s=this._lruList[n];if(o(this,s)){l(this,s);this._allowStale||(s=void 0)}s&&t.call(e,s.value,s.key,this)}};s.prototype.keys=function(){for(var t=new Array(this._itemCount),e=0,i=this._mru-1;i>=0&&e<this._itemCount;i--)if(this._lruList[i]){var r=this._lruList[i];t[e++]=r.key}return t};s.prototype.values=function(){for(var t=new Array(this._itemCount),e=0,i=this._mru-1;i>=0&&e<this._itemCount;i--)if(this._lruList[i]){var r=this._lruList[i];t[e++]=r.value}return t};s.prototype.reset=function(){if(this._dispose&&this._cache)for(var t in this._cache)this._dispose(t,this._cache[t].value);this._cache=Object.create(null);this._lruList=Object.create(null);this._mru=0;this._lru=0;this._length=0;this._itemCount=0};s.prototype.dump=function(){for(var t=[],e=0,i=this._mru-1;i>=0&&e<this._itemCount;i--)if(this._lruList[i]){var r=this._lruList[i];if(!o(this,r)){++e;t.push({k:r.key,v:r.value,e:r.now+(r.maxAge||0)})}}return t};s.prototype.dumpLru=function(){return this._lruList};s.prototype.set=function(e,i,r){r=r||this._maxAge;n(e);var s=r?Date.now():0,a=this._lengthCalculator(i);if(t(this._cache,e)){if(a>this._max){l(this,this._cache[e]);return!1}this._dispose&&this._dispose(e,this._cache[e].value);this._cache[e].now=s;this._cache[e].maxAge=r;this._cache[e].value=i;this._length+=a-this._cache[e].length;this._cache[e].length=a;this.get(e);this._length>this._max&&h(this);return!0}var o=new c(e,i,this._mru++,a,s,r);if(o.length>this._max){this._dispose&&this._dispose(e,i);return!1}this._length+=o.length;this._lruList[o.lu]=this._cache[e]=o;this._itemCount++;this._length>this._max&&h(this);return!0};s.prototype.has=function(e){n(e);return!!t(this._cache,e)&&!o(this,this._cache[e])};s.prototype.get=function(t){n(t);return a(this,t,!0)};s.prototype.peek=function(t){n(t);return a(this,t,!1)};s.prototype.pop=function(){var t=this._lruList[this._lru];l(this,t);return t||null};s.prototype.del=function(t){n(t);l(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 a(t,e,i){n(e);var r=t._cache[e];if(r){if(o(t,r)){l(t,r);t._allowStale||(r=void 0)}else i&&function(t,e){u(t,e);e.lu=t._mru++;t._lruList[e.lu]=e}(t,r);r&&(r=r.value)}return 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._lru<t._mru&&t._length>t._max;)l(t,t._lruList[t._lru])}function u(t,e){delete t._lruList[e.lu];for(;t._lru<t._mru&&!t._lruList[t._lru];)t._lru++}function l(t,e){if(e){t._dispose&&t._dispose(e.key,e.value);t._length-=e.length;t._itemCount--;delete t._cache[e.key];u(t,e)}}function c(t,e,i,r,n,s){this.key=t;this.value=e;this.lu=i;this.length=r;this.now=n;s&&(this.maxAge=s)}}()},{}],18:[function(t,e,i){var r,n,s=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();function h(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout){r=setTimeout;return setTimeout(t,0)}try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var u,l=[],c=!1,f=-1;function p(){if(c&&u){c=!1;u.length?l=u.concat(l):f=-1;l.length&&d()}}function d(){if(!c){var t=h(p);c=!0;for(var e=l.length;e;){u=l;l=[];for(;++f<e;)u&&u[f].run();f=-1;e=l.length}u=null;c=!1;!function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout){n=clearTimeout;return clearTimeout(t)}try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new m(t,e));1!==l.length||c||h(d)};function m(t,e){this.fun=t;this.array=e}m.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function y(){}s.on=y;s.addListener=y;s.once=y;s.off=y;s.removeListener=y;s.removeAllListeners=y;s.emit=y;s.prependListener=y;s.prependOnceListener=y;s.listeners=function(t){return[]};s.binding=function(t){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(t){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}},{}],19:[function(t,e,i){!function(t,r){"object"==typeof i&&void 0!==e?e.exports=r():t.proj4=r()}(this,(function(){"use strict";var t=1,e=2,i=3,r=4,n=5,s=6378137,a=.0066943799901413165,o=484813681109536e-20,h=Math.PI/2,u=.16666666666666666,l=.04722222222222222,c=.022156084656084655,f=1e-10,p=.017453292519943295,d=57.29577951308232,m=Math.PI/4,y=2*Math.PI,g=3.14159265359,_={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},v={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},b=/[\s_\-\/\(\)]/g;function w(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),n=e.toLowerCase().replace(b,""),s=-1;++s<r.length;)if((i=r[s]).toLowerCase().replace(b,"")===n)return t[i]}var M=function(t){var e,i,r,n={},s=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var i=e.split("=");i.push(!0);t[i[0].toLowerCase()]=i[1];return t}),{}),a={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*p},lat_1:function(t){n.lat1=t*p},lat_2:function(t){n.lat2=t*p},lat_ts:function(t){n.lat_ts=t*p},lon_0:function(t){n.long0=t*p},lon_1:function(t){n.long1=t*p},lon_2:function(t){n.long2=t*p},alpha:function(t){n.alpha=parseFloat(t)*p},gamma:function(t){n.rectified_grid_angle=parseFloat(t)},lonc:function(t){n.longc=t*p},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var e=w(v,t);e&&(n.to_meter=e.to_meter)},from_greenwich:function(t){n.from_greenwich=t*p},pm:function(t){var e=w(_,t);n.from_greenwich=(e||parseFloat(t))*p},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(n.axis=t)},approx:function(){n.approx=!0}};for(e in s){i=s[e];e in a?"function"==typeof(r=a[e])?r(i):n[r]=i:n[e]=i}"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase());return n},x=1,E=/\s/,k=/[A-Za-z]/,C=/[A-Za-z84]/,S=/[,\]]/,A=/[\d\.E\-\+]/;function P(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim();this.level=0;this.place=0;this.root=null;this.stack=[];this.currentObject=null;this.state=x}P.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;E.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case x: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}};P.prototype.afterquote=function(t){if('"'!==t){if(!S.test(t))throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place);this.word=this.word.trim();this.afterItem(t)}else{this.word+='"';this.state=4}};P.prototype.afterItem=function(t){if(","!==t)if("]"!==t);else{this.level--;if(null!==this.word){this.currentObject.push(this.word);this.word=null}this.state=x;this.currentObject=this.stack.pop();this.currentObject||(this.state=-1)}else{null!==this.word&&this.currentObject.push(this.word);this.word=null;this.state=x}};P.prototype.number=function(t){if(A.test(t))this.word+=t;else{if(!S.test(t))throw new Error("havn't handled \""+t+'" in number yet, index '+this.place);this.word=parseFloat(this.word);this.afterItem(t)}};P.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5};P.prototype.keyword=function(t){if(C.test(t))this.word+=t;else if("["!==t){if(!S.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}else{var e=[];e.push(this.word);this.level++;null===this.root?this.root=e:this.currentObject.push(e);this.stack.push(this.currentObject);this.currentObject=e;this.state=x}};P.prototype.neutral=function(t){if(k.test(t)){this.word=t;this.state=2}else if('"'!==t)if(A.test(t)){this.word=t;this.state=3}else{if(!S.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)}else{this.word="";this.state=4}};P.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function j(t,e,i){if(Array.isArray(e)){i.unshift(e);e=null}var r=e?{}:t,n=i.reduce((function(t,e){O(e,t);return t}),r);e&&(t[e]=n)}function O(t,e){if(Array.isArray(t)){var i=t.shift();"PARAMETER"===i&&(i=t.shift());if(1!==t.length)if(t.length)if("TOWGS84"!==i)if("AXIS"!==i){Array.isArray(i)||(e[i]={});var r;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[i]={name:t[0].toLowerCase(),convert:t[1]};3===t.length&&O(t[2],e[i]);return;case"SPHEROID":case"ELLIPSOID":e[i]={name:t[0],a:t[1],rf:t[2]};4===t.length&&O(t[3],e[i]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":t[0]=["name",t[0]];j(e,i,t);return;default:r=-1;for(;++r<t.length;)if(!Array.isArray(t[r]))return O(t,e[i]);return j(e,i,t)}}else{i in e||(e[i]=[]);e[i].push(t)}else e[i]=t;else e[i]=!0;else{if(Array.isArray(t[0])){e[i]={};O(t[0],e[i]);return}e[i]=t[0]}}else e[t]=!0}var R=.017453292519943295;function T(t){return t*R}var I=function(t){var e=new P(t).output(),i=e.shift(),r=e.shift();e.unshift(["name",r]);e.unshift(["type",i]);var n={};O(e,n);!function(t){if("GEOGCS"===t.type)t.projName="longlat";else if("LOCAL_CS"===t.type){t.projName="identity";t.local=!0}else"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION;if(t.AXIS){for(var e="",i=0,r=t.AXIS.length;i<r;++i){var n=[t.AXIS[i][0].toLowerCase(),t.AXIS[i][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?e+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?e+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?e+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(e+="w")}2===e.length&&(e+="u");3===e.length&&(t.axis=e)}if(t.UNIT){t.units=t.UNIT.name.toLowerCase();"metre"===t.units&&(t.units="meter");t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert)}var s=t.GEOGCS;"GEOGCS"===t.type&&(s=t);if(s){s.DATUM?t.datumCode=s.DATUM.name.toLowerCase():t.datumCode=s.name.toLowerCase();"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2));"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49");if("wgs_1984"===t.datumCode||"world_geodetic_system_1984"===t.datumCode){"Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0);t.datumCode="wgs84"}"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6));"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8));~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72");if(s.DATUM&&s.DATUM.SPHEROID){t.ellps=s.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk");"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl");t.a=s.DATUM.SPHEROID.a;t.rf=parseFloat(s.DATUM.SPHEROID.rf,10)}s.DATUM&&s.DATUM.TOWGS84&&(t.datum_params=s.DATUM.TOWGS84);~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36");~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52");(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65");"ch1903+"===t.datumCode&&(t.datumCode="ch1903");~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")}t.b&&!isFinite(t.b)&&(t.b=t.a);function a(e){return e*(t.to_meter||1)}[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",T],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",T],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",T],["lat0","latitude_of_origin",T],["lat0","standard_parallel_1",T],["lat1","standard_parallel_1",T],["lat2","standard_parallel_2",T],["azimuth","Azimuth"],["alpha","azimuth",T],["srsCode","name"]].forEach((function(e){return function(t,e){var i=e[0],r=e[1];if(!(i in t)&&r in t){t[i]=t[r];3===e.length&&(t[i]=e[2](t[i]))}}(t,e)}));t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc);if(!t.lat_ts&&t.lat1&&("Stereographic_South_Pole"===t.projName||"Polar Stereographic (variant B)"===t.projName)){t.lat0=T(t.lat1>0?90:-90);t.lat_ts=t.lat1}}(n);return n};function N(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?N[t]=M(arguments[1]):N[t]=I(arguments[1]):N[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?N.apply(e,t):N(t)}));if("string"==typeof t){if(t in N)return N[t]}else"EPSG"in t?N["EPSG:"+t.EPSG]=t:"ESRI"in t?N["ESRI:"+t.ESRI]=t:"IAU2000"in t?N["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"]}(N);var L=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var B=["3857","900913","3785","102113"];function F(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in N}(t))return N[t];if(function(t){return L.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=I(t);if(function(t){var e=w(t,"authority");if(e){var i=w(e,"epsg");return i&&B.indexOf(i)>-1}}(e))return N["EPSG:3857"];var i=function(t){var e=w(t,"extension");if(e)return w(e,"proj4")}(e);return i?M(i):e}return function(t){return"+"===t[0]}(t)?M(t):void 0}var D=function(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t},z=function(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)},U=function(t){return t<0?-1:1},q=function(t){return Math.abs(t)<=g?t:t-U(t)*y},G=function(t,e,i){var r=t*i,n=.5*t;r=Math.pow((1-r)/(1+r),n);return Math.tan(.5*(h-e))/r},W=function(t,e){for(var i,r,n=.5*t,s=h-2*Math.atan(e),a=0;a<=15;a++){i=t*Math.sin(s);s+=r=h-2*Math.atan(e*Math.pow((1-i)/(1+i),n))-s;if(Math.abs(r)<=1e-10)return s}return-9999};function H(t){return t}var Q=[{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=z(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,n=t.y;if(n*d>90&&n*d<-90&&r*d>180&&r*d<-180)return null;if(Math.abs(Math.abs(n)-h)<=f)return null;if(this.sphere){e=this.x0+this.a*this.k0*q(r-this.long0);i=this.y0+this.a*this.k0*Math.log(Math.tan(m+.5*n))}else{var s=Math.sin(n),a=G(this.e,n,s);e=this.x0+this.a*this.k0*q(r-this.long0);i=this.y0-this.a*this.k0*Math.log(a)}t.x=e;t.y=i;return t},inverse:function(t){var e,i,r=t.x-this.x0,n=t.y-this.y0;if(this.sphere)i=h-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(i=W(this.e,s)))return null}e=q(this.long0+r/(this.a*this.k0));t.x=e;t.y=i;return t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:H,inverse:H,names:["longlat","identity"]}],X={},V=[];function Z(t,e){var i=V.length;if(!t.names){console.log(e);return!0}V[i]=t;t.names.forEach((function(t){X[t.toLowerCase()]=i}));return this}var J={start:function(){Q.forEach(Z)},add:Z,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==X[e]&&V[X[e]]?V[X[e]]:void 0}},Y={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"}},K=Y.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Y.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var $={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var tt={};function et(t){if(0===t.length)return null;var e="@"===t[0];e&&(t=t.slice(1));return"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:tt[t]||null,isNull:!1}}function it(t){return t/3600*Math.PI/180}function rt(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function nt(t){return t.map((function(t){return[it(t.longitudeShift),it(t.latitudeShift)]}))}function st(t,e,i){return{name:rt(t,e+8,e+16).trim(),parent:rt(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 at(t,e,i,r){for(var n=e+176,s=[],a=0;a<i.gridNodeCount;a++){var o={latitudeShift:t.getFloat32(n+16*a,r),longitudeShift:t.getFloat32(n+16*a+4,r),latitudeAccuracy:t.getFloat32(n+16*a+8,r),longitudeAccuracy:t.getFloat32(n+16*a+12,r)};s.push(o)}return s}function ot(s,a){if(!(this instanceof ot))return new ot(s);a=a||function(t){if(t)throw t};var h=F(s);if("object"==typeof h){var p=ot.projections.get(h.projName);if(p){if(h.datumCode&&"none"!==h.datumCode){var d=w($,h.datumCode);if(d){h.datum_params=h.datum_params||(d.towgs84?d.towgs84.split(","):null);h.ellps=d.ellipse;h.datumName=d.datumName?d.datumName:h.datumCode}}h.k0=h.k0||1;h.axis=h.axis||"enu";h.ellps=h.ellps||"wgs84";h.lat1=h.lat1||h.lat0;var m=function(t,e,i,r,n){if(!t){var s=w(Y,r);s||(s=K);t=s.a;e=s.b;i=s.rf}i&&!e&&(e=(1-1/i)*t);if(0===i||Math.abs(t-e)<f){n=!0;e=t}return{a:t,b:e,rf:i,sphere:n}}(h.a,h.b,h.rf,h.ellps,h.sphere),y=function(t,e,i,r){var n=t*t,s=e*e,a=(n-s)/n,o=0;if(r){n=(t*=1-a*(u+a*(l+a*c)))*t;a=0}else o=Math.sqrt(a);return{es:a,e:o,ep2:(n-s)/s}}(m.a,m.b,m.rf,h.R_A),g=function(t){return void 0===t?null:t.split(",").map(et)}(h.nadgrids),_=h.datum||function(s,a,h,u,l,c,f){var p={};p.datum_type=void 0===s||"none"===s?n:r;if(a){p.datum_params=a.map(parseFloat);0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=t);if(p.datum_params.length>3&&(0!==p.datum_params[3]||0!==p.datum_params[4]||0!==p.datum_params[5]||0!==p.datum_params[6])){p.datum_type=e;p.datum_params[3]*=o;p.datum_params[4]*=o;p.datum_params[5]*=o;p.datum_params[6]=p.datum_params[6]/1e6+1}}if(f){p.datum_type=i;p.grids=f}p.a=h;p.b=u;p.es=l;p.ep2=c;return p}(h.datumCode,h.datum_params,m.a,m.b,y.es,y.ep2,g);D(this,h);D(this,p);this.a=m.a;this.b=m.b;this.rf=m.rf;this.sphere=m.sphere;this.es=y.es;this.e=y.e;this.ep2=y.ep2;this.datum=_;this.init();a(null,this)}else a(s)}else a(s)}ot.projections=J;ot.projections.start();function ht(t,e,i){var r,n,s,a,o=t.x,u=t.y,l=t.z?t.z:0;if(u<-h&&u>-1.001*h)u=-h;else if(u>h&&u<1.001*h)u=h;else{if(u<-h)return{x:-1/0,y:-1/0,z:t.z};if(u>h)return{x:1/0,y:1/0,z:t.z}}o>Math.PI&&(o-=2*Math.PI);n=Math.sin(u);a=Math.cos(u);s=n*n;return{x:((r=i/Math.sqrt(1-e*s))+l)*a*Math.cos(o),y:(r+l)*a*Math.sin(o),z:(r*(1-e)+l)*n}}function ut(t,e,i,r){var n,s,a,o,u,l,c,f,p,d,m,y,g,_,v,b=1e-12,w=t.x,M=t.y,x=t.z?t.z:0;n=Math.sqrt(w*w+M*M);s=Math.sqrt(w*w+M*M+x*x);if(n/i<b){_=0;if(s/i<b){h;v=-r;return{x:t.x,y:t.y,z:t.z}}}else _=Math.atan2(M,w);a=x/s;f=(o=n/s)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*o*o));p=a*u;g=0;do{g++;l=e*(c=i/Math.sqrt(1-e*p*p))/(c+(v=n*f+x*p-c*(1-e*p*p)));y=(m=a*(u=1/Math.sqrt(1-l*(2-l)*o*o)))*f-(d=o*(1-l)*u)*p;f=d;p=m}while(y*y>1e-24&&g<30);return{x:_,y:Math.atan(m/Math.abs(d)),z:v}}function lt(i){return i===t||i===e}var ct=function(r,o,h){if(function(i,r){return i.datum_type===r.datum_type&&!(i.a!==r.a||Math.abs(i.es-r.es)>5e-11)&&(i.datum_type===t?i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]:i.datum_type!==e||i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]&&i.datum_params[3]===r.datum_params[3]&&i.datum_params[4]===r.datum_params[4]&&i.datum_params[5]===r.datum_params[5]&&i.datum_params[6]===r.datum_params[6])}(r,o))return h;if(r.datum_type===n||o.datum_type===n)return h;var u=r.a,l=r.es;if(r.datum_type===i){if(0!==ft(r,!1,h))return;u=s;l=a}var c=o.a,f=o.b,p=o.es;if(o.datum_type===i){c=s;f=6356752.314;p=a}if(l===p&&u===c&&!lt(r.datum_type)&&!lt(o.datum_type))return h;h=ht(h,l,u);lt(r.datum_type)&&(h=function(i,r,n){if(r===t)return{x:i.x+n[0],y:i.y+n[1],z:i.z+n[2]};if(r===e){var s=n[0],a=n[1],o=n[2],h=n[3],u=n[4],l=n[5],c=n[6];return{x:c*(i.x-l*i.y+u*i.z)+s,y:c*(l*i.x+i.y-h*i.z)+a,z:c*(-u*i.x+h*i.y+i.z)+o}}}(h,r.datum_type,r.datum_params));lt(o.datum_type)&&(h=function(i,r,n){if(r===t)return{x:i.x-n[0],y:i.y-n[1],z:i.z-n[2]};if(r===e){var s=n[0],a=n[1],o=n[2],h=n[3],u=n[4],l=n[5],c=n[6],f=(i.x-s)/c,p=(i.y-a)/c,d=(i.z-o)/c;return{x:f+l*p-u*d,y:-l*f+p+h*d,z:u*f-h*p+d}}}(h,o.datum_type,o.datum_params));h=ut(h,p,c,f);if(o.datum_type===i){if(0!==ft(o,!0,h))return}return h};function ft(t,e,i){if(null===t.grids||0===t.grids.length){console.log("Grid shift grids not found");return-1}for(var r={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},s=[],a=0;a<t.grids.length;a++){var o=t.grids[a];s.push(o.name);if(o.isNull){n=r;break}if(null!==o.grid){var h=o.grid.subgrids[0],u=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,l=h.ll[0]-u,c=h.ll[1]-u,f=h.ll[0]+(h.lim[0]-1)*h.del[0]+u,p=h.ll[1]+(h.lim[1]-1)*h.del[1]+u;if(!(c>r.y||l>r.x||p<r.y||f<r.x)){n=pt(r,e,h);if(!isNaN(n.x))break}}else if(o.mandatory){console.log("Unable to find mandatory grid '"+o.name+"'");return-1}}if(isNaN(n.x)){console.log("Failed to find a grid shift table for location '"+-r.x*d+" "+r.y*d+" tried: '"+s+"'");return-1}i.x=-n.x;i.y=n.y;return 0}function pt(t,e,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var n={x:t.x,y:t.y};n.x-=i.ll[0];n.y-=i.ll[1];n.x=q(n.x-Math.PI)+Math.PI;var s=dt(n,i);if(e){if(isNaN(s.x))return r;s.x=n.x-s.x;s.y=n.y-s.y;var a,o,h=9;do{o=dt(s,i);if(isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:n.x-(o.x+s.x),y:n.y-(o.y+s.y)};s.x+=a.x;s.y+=a.y}while(h--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(h<0){console.log("Inverse grid shift iterator failed to converge.");return r}r.x=q(s.x+i.ll[0]);r.y=s.y+i.ll[1]}else if(!isNaN(s.x)){r.x=t.x+s.x;r.y=t.y+s.y}return r}function dt(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 u=e.cvs[i][0],l=e.cvs[i][1];i++;var c=e.cvs[i][0],f=e.cvs[i][1];i+=e.lim[0];var p=e.cvs[i][0],d=e.cvs[i][1];i--;var m=e.cvs[i][0],y=e.cvs[i][1],g=a*o,_=a*(1-o),v=(1-a)*(1-o),b=(1-a)*o;h.x=v*u+_*c+b*m+g*p;h.y=v*l+_*f+b*y+g*d;return h}var mt=function(t,e,i){var r,n,s,a=i.x,o=i.y,h=i.z||0,u={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==i.z){if(0===s){r=a;n=-1!=="ew".indexOf(t.axis[s])?"x":"y"}else if(1===s){r=o;n=-1!=="ns".indexOf(t.axis[s])?"y":"x"}else{r=h;n="z"}switch(t.axis[s]){case"e":case"n":u[n]=r;break;case"w":case"s":u[n]=-r;break;case"u":void 0!==i[n]&&(u.z=r);break;case"d":void 0!==i[n]&&(u.z=-r);break;default:return null}}return u},yt=function(t){var e={x:t[0],y:t[1]};t.length>2&&(e.z=t[2]);t.length>3&&(e.m=t[3]);return e},gt=function(t){_t(t.x);_t(t.y)};function _t(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 vt(i,r,n){var s;Array.isArray(n)&&(n=yt(n));gt(n);if(i.datum&&r.datum&&function(i,r){return(i.datum.datum_type===t||i.datum.datum_type===e)&&"WGS84"!==r.datumCode||(r.datum.datum_type===t||r.datum.datum_type===e)&&"WGS84"!==i.datumCode}(i,r)){n=vt(i,s=new ot("WGS84"),n);i=s}"enu"!==i.axis&&(n=mt(i,!1,n));if("longlat"===i.projName)n={x:n.x*p,y:n.y*p,z:n.z||0};else{i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0});if(!(n=i.inverse(n)))return}i.from_greenwich&&(n.x+=i.from_greenwich);if(n=ct(i.datum,r.datum,n)){r.from_greenwich&&(n={x:n.x-r.from_greenwich,y:n.y,z:n.z||0});if("longlat"===r.projName)n={x:n.x*d,y:n.y*d,z:n.z||0};else{n=r.forward(n);r.to_meter&&(n={x:n.x/r.to_meter,y:n.y/r.to_meter,z:n.z||0})}return"enu"!==r.axis?mt(r,!0,n):n}}var bt=ot("WGS84");function wt(t,e,i){var r,n,s;if(Array.isArray(i)){r=vt(t,e,i)||{x:NaN,y:NaN};return i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(i.splice(3)):[r.x,r.y,i[2]].concat(i.splice(3)):[r.x,r.y].concat(i.splice(2)):[r.x,r.y]}n=vt(t,e,i);if(2===(s=Object.keys(i)).length)return n;s.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;n[r]=i[r]}));return n}function Mt(t){return t instanceof ot?t:t.oProj?t.oProj:ot(t)}function xt(t,e,i){t=Mt(t);var r,n=!1;if(void 0===e){e=t;t=bt;n=!0}else if(void 0!==e.x||Array.isArray(e)){i=e;e=t;t=bt;n=!0}e=Mt(e);if(i)return wt(t,e,i);r={forward:function(i){return wt(t,e,i)},inverse:function(i){return wt(e,t,i)}};n&&(r.oProj=e);return r}var Et=6,kt="AJSAJS",Ct="AFAFAF",St=65,At=73,Pt=79,jt=86,Ot=90,Rt={forward:Tt,inverse:function(t){var e=Bt(zt(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:It};function Tt(t,e){e=e||5;return function(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(n=t.easting,s=t.northing,a=t.zoneNumber,o=Dt(a),h=Math.floor(n/1e5),u=Math.floor(s/1e5)%20,function(t,e,i){var r=i-1,n=kt.charCodeAt(r),s=Ct.charCodeAt(r),a=n+t-1,o=s+e,h=!1;if(a>Ot){a=a-Ot+St-1;h=!0}(a===At||n<At&&a>At||(a>At||n<At)&&h)&&a++;(a===Pt||n<Pt&&a>Pt||(a>Pt||n<Pt)&&h)&&++a===At&&a++;a>Ot&&(a=a-Ot+St-1);if(o>jt){o=o-jt+St-1;h=!0}else h=!1;(o===At||s<At&&o>At||(o>At||s<At)&&h)&&o++;(o===Pt||s<Pt&&o>Pt||(o>Pt||s<Pt)&&h)&&++o===At&&o++;o>jt&&(o=o-jt+St-1);return String.fromCharCode(a)+String.fromCharCode(o)}(h,u,o))+i.substr(i.length-5,e)+r.substr(r.length-5,e);var n,s,a,o,h,u}(function(t){var e,i,r,n,s,a,o,h,u=t.lat,l=t.lon,c=6378137,f=.00669438,p=.9996,d=Nt(u),m=Nt(l);h=Math.floor((l+180)/6)+1;180===l&&(h=60);u>=56&&u<64&&l>=3&&l<12&&(h=32);u>=72&&u<84&&(l>=0&&l<9?h=31:l>=9&&l<21?h=33:l>=21&&l<33?h=35:l>=33&&l<42&&(h=37));o=Nt(6*(h-1)-180+3);e=f/(1-f);i=c/Math.sqrt(1-f*Math.sin(d)*Math.sin(d));r=Math.tan(d)*Math.tan(d);n=e*Math.cos(d)*Math.cos(d);s=Math.cos(d)*(m-o);a=c*((1-f/4-3*f*f/64-5*f*f*f/256)*d-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*d)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*d)-35*f*f*f/3072*Math.sin(6*d));var y=p*i*(s+(1-r+n)*s*s*s/6+(5-18*r+r*r+72*n-58*e)*s*s*s*s*s/120)+5e5,g=p*(a+i*Math.tan(d)*(s*s/2+(5-r+9*n+4*n*n)*s*s*s*s/24+(61-58*r+r*r+600*n-330*e)*s*s*s*s*s*s/720));u<0&&(g+=1e7);return{northing:Math.round(g),easting:Math.round(y),zoneNumber:h,zoneLetter:Ft(u)}}({lat:t[1],lon:t[0]}),e)}function It(t){var e=Bt(zt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Nt(t){return t*(Math.PI/180)}function Lt(t){return t/Math.PI*180}function Bt(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,u,l,c,f,p,d=.9996,m=6378137,y=.00669438,g=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=i-5e5,v=e;r<"N"&&(v-=1e7);c=6*(n-1)-180+3;s=.006739496752268451;p=(f=v/d/6367449.145945056)+(3*g/2-27*g*g*g/32)*Math.sin(2*f)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*f)+151*g*g*g/96*Math.sin(6*f);a=m/Math.sqrt(1-y*Math.sin(p)*Math.sin(p));o=Math.tan(p)*Math.tan(p);h=s*Math.cos(p)*Math.cos(p);u=.99330562*m/Math.pow(1-y*Math.sin(p)*Math.sin(p),1.5);l=_/(a*d);var b=p-a*Math.tan(p)/u*(l*l/2-(5+3*o+10*h-4*h*h-9*s)*l*l*l*l/24+(61+90*o+298*h+45*o*o-1.6983531815716497-3*h*h)*l*l*l*l*l*l/720);b=Lt(b);var w,M=(l-(1+2*o+h)*l*l*l/6+(5-2*h+28*o-3*h*h+8*s+24*o*o)*l*l*l*l*l/120)/Math.cos(p);M=c+Lt(M);if(t.accuracy){var x=Bt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:x.lat,right:x.lon,bottom:b,left:M}}else w={lat:b,lon:M};return w}function Ft(t){var e="Z";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");return e}function Dt(t){var e=t%Et;0===e&&(e=Et);return e}function zt(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=Dt(a),u=function(t,e){var i=kt.charCodeAt(e-1),r=1e5,n=!1;for(;i!==t.charCodeAt(0);){++i===At&&i++;i===Pt&&i++;if(i>Ot){if(n)throw"Bad character: "+t;i=St;n=!0}r+=1e5}return r}(r.charAt(0),h),l=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var i=Ct.charCodeAt(e-1),r=0,n=!1;for(;i!==t.charCodeAt(0);){++i===At&&i++;i===Pt&&i++;if(i>jt){if(n)throw"Bad character: "+t;i=St;n=!0}r+=1e5}return r}(r.charAt(1),h);l<Ut(o);)l+=2e6;var c=i-s;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,m=c/2,y=0,g=0;if(m>0){f=1e5/Math.pow(10,m);p=t.substring(s,s+m);y=parseFloat(p)*f;d=t.substring(s+m);g=parseFloat(d)*f}return{easting:y+u,northing:g+l,zoneLetter:o,zoneNumber:a,accuracy:f}}function Ut(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 qt(t,e,i){if(!(this instanceof qt))return new qt(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")}qt.fromMGRS=function(t){return new qt(It(t))};qt.prototype.toMGRS=function(t){return Tt([this.x,this.y],t)};var Gt=.046875,Wt=.01953125,Ht=.01068115234375,Qt=function(t){var e=[];e[0]=1-t*(.25+t*(Gt+t*(Wt+t*Ht)));e[1]=t*(.75-t*(Gt+t*(Wt+t*Ht)));var i=t*t;e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t));i*=t;e[3]=i*(.3645833333333333-.005696614583333333*t);e[4]=i*t*.3076171875;return e},Xt=function(t,e,i,r){i*=e;e*=e;return r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Vt=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;n-=o=(Xt(n,a,Math.cos(n),i)-t)*(o*Math.sqrt(o))*r;if(Math.abs(o)<f)return n}return n};var Zt={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;if(this.es){this.en=Qt(this.es);this.ml0=Xt(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=q(n-this.long0),o=Math.sin(s),h=Math.cos(s);if(this.es){var u=h*a,l=Math.pow(u,2),c=this.ep2*Math.pow(h,2),p=Math.pow(c,2),d=Math.abs(h)>f?Math.tan(s):0,m=Math.pow(d,2),y=Math.pow(m,2);e=1-this.es*Math.pow(o,2);u/=Math.sqrt(e);var g=Xt(s,o,h,this.en);i=this.a*(this.k0*u*(1+l/6*(1-m+c+l/20*(5-18*m+y+14*c-58*m*c+l/42*(61+179*y-y*m-479*m)))))+this.x0;r=this.a*(this.k0*(g-this.ml0+o*a*u/2*(1+l/12*(5-m+9*c+4*p+l/30*(61+y-58*m+270*c-330*m*c+l/56*(1385+543*y-y*m-3111*m))))))+this.y0}else{var _=h*Math.sin(a);if(Math.abs(Math.abs(_)-1)<f)return 93;i=.5*this.a*this.k0*Math.log((1+_)/(1-_))+this.x0;r=h*Math.cos(a)/Math.sqrt(1-Math.pow(_,2));if((_=Math.abs(r))>=1){if(_-1>f)return 93;r=0}else r=Math.acos(r);s<0&&(r=-r);r=this.a*this.k0*(r-this.lat0)+this.y0}t.x=i;t.y=r;return t},inverse:function(t){var e,i,r,n,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es){e=this.ml0+a/this.k0;i=Vt(e,this.es,this.en);if(Math.abs(i)<h){var o=Math.sin(i),u=Math.cos(i),l=Math.abs(u)>f?Math.tan(i):0,c=this.ep2*Math.pow(u,2),p=Math.pow(c,2),d=Math.pow(l,2),m=Math.pow(d,2);e=1-this.es*Math.pow(o,2);var y=s*Math.sqrt(e)/this.k0,g=Math.pow(y,2);r=i-(e*=l)*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*c*d+c-4*p-g/30*(61+90*d-252*c*d+45*m+46*c-g/56*(1385+3633*d+4095*m+1574*m*d))));n=q(this.long0+y*(1-g/6*(1+2*d+c-g/20*(5+28*d+24*m+8*c*d+6*c-g/42*(61+662*d+1320*m+720*m*d))))/u)}else{r=h*U(a);n=0}}else{var _=Math.exp(s/this.k0),v=.5*(_-1/_),b=this.lat0+a/this.k0,w=Math.cos(b);e=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(v,2)));r=Math.asin(e);a<0&&(r=-r);n=0===v&&0===w?0:q(Math.atan2(v,w)+this.long0)}t.x=n;t.y=r;return t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Jt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Yt=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))},Kt=function(t){var e=Math.abs(t);e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Yt(1,e)+1)));return t<0?-e:e},$t=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)},te=function(t,e,i){for(var r,n,s=Math.sin(e),a=Math.cos(e),o=Jt(i),h=function(t){var e=Math.exp(t);return(e+1/e)/2}(i),u=2*a*h,l=-2*s*o,c=t.length-1,f=t[c],p=0,d=0,m=0;--c>=0;){r=d;n=p;f=u*(d=f)-r-l*(p=m)+t[c];m=l*d-n+u*p}return[(u=s*h)*f-(l=a*o)*m,u*m+l*f]};var ee={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.');if(this.approx){Zt.init.apply(this);this.forward=Zt.forward;this.inverse=Zt.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=$t(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=q(t.x-this.long0),i=t.y;i=$t(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,Yt(r,n*a));e=Kt(Math.tan(e));var o,h,u=te(this.gtu,2*i,2*e);i+=u[0];e+=u[1];if(Math.abs(e)<=2.623395162778){o=this.a*(this.Qn*e)+this.x0;h=this.a*(this.Qn*i+this.Zb)+this.y0}else{o=1/0;h=1/0}t.x=o;t.y=h;return t},inverse:function(t){var e,i,r=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn;r/=this.Qn;if(Math.abs(r)<=2.623395162778){var s=te(this.utg,2*n,2*r);n+=s[0];r+=s[1];r=Math.atan(Jt(r));var a=Math.sin(n),o=Math.cos(n),h=Math.sin(r),u=Math.cos(r);n=Math.atan2(a*u,Yt(h,u*o));r=Math.atan2(h,u*o);e=q(r+this.long0);i=$t(this.cgb,n)}else{e=1/0;i=1/0}t.x=e;t.y=i;return t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var ie={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(q(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)*p;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;ee.init.apply(this);this.forward=ee.forward;this.inverse=ee.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},re=function(t,e){return Math.pow((1-t)/(1+t),e)};var ne={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+m)/(Math.pow(Math.tan(.5*this.lat0+m),this.C)*re(this.e*t,this.ratexp))},forward:function(t){var e=t.x,i=t.y;t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+m),this.C)*re(this.e*Math.sin(i),this.ratexp))-h;t.x=this.C*e;return t},inverse:function(t){for(var e=t.x/this.C,i=t.y,r=Math.pow(Math.tan(.5*i+m)/this.K,1/this.C),n=20;n>0;--n){i=2*Math.atan(r*re(this.e*Math.sin(t.y),-.5*this.e))-h;if(Math.abs(i-t.y)<1e-14)break;t.y=i}if(!n)return null;t.x=e;t.y=i;return t},names:["gauss"]};var se={init:function(){ne.init.apply(this);if(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;t.x=q(t.x-this.long0);ne.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;return t},inverse:function(t){var e,i,r,n,s;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(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}t.x=r;t.y=n;ne.inverse.apply(this,[t]);t.x=q(t.x+this.long0);return t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var ae={init:function(){this.coslat0=Math.cos(this.lat0);this.sinlat0=Math.sin(this.lat0);if(this.sphere)1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=f&&(this.k0=.5*(1+U(this.lat0)*Math.sin(this.lat_ts)));else{Math.abs(this.coslat0)<=f&&(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)<=f&&(this.k0=.5*this.cons*z(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/G(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts)));this.ms1=z(this.e,this.sinlat0,this.coslat0);this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-h;this.cosX0=Math.cos(this.X0);this.sinX0=Math.sin(this.X0)}},forward:function(t){var e,i,r,n,s,a,o=t.x,u=t.y,l=Math.sin(u),c=Math.cos(u),p=q(o-this.long0);if(Math.abs(Math.abs(o-this.long0)-Math.PI)<=f&&Math.abs(u+this.lat0)<=f){t.x=NaN;t.y=NaN;return t}if(this.sphere){e=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(p));t.x=this.a*e*c*Math.sin(p)+this.x0;t.y=this.a*e*(this.coslat0*l-this.sinlat0*c*Math.cos(p))+this.y0;return t}i=2*Math.atan(this.ssfn_(u,l,this.e))-h;n=Math.cos(i);r=Math.sin(i);if(Math.abs(this.coslat0)<=f){s=G(this.e,u*this.con,this.con*l);a=2*this.a*this.k0*s/this.cons;t.x=this.x0+a*Math.sin(o-this.long0);t.y=this.y0-this.con*a*Math.cos(o-this.long0);return t}if(Math.abs(this.sinlat0)<f){e=2*this.a*this.k0/(1+n*Math.cos(p));t.y=e*r}else{e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(p)));t.y=e*(this.cosX0*r-this.sinX0*n*Math.cos(p))+this.y0}t.x=e*n*Math.sin(p)+this.x0;return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e,i,r,n,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));e=this.long0;i=this.lat0;if(a<=f){t.x=e;t.y=i;return t}i=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/a);e=Math.abs(this.coslat0)<f?this.lat0>0?q(this.long0+Math.atan2(t.x,-1*t.y)):q(this.long0+Math.atan2(t.x,t.y)):q(this.long0+Math.atan2(t.x*Math.sin(o),a*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o)));t.x=e;t.y=i;return t}if(Math.abs(this.coslat0)<=f){if(a<=f){i=this.lat0;e=this.long0;t.x=e;t.y=i;return t}t.x*=this.con;t.y*=this.con;r=a*this.cons/(2*this.a*this.k0);i=this.con*W(this.e,r);e=this.con*q(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else{n=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1));e=this.long0;if(a<=f)s=this.X0;else{s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/a);e=q(this.long0+Math.atan2(t.x*Math.sin(n),a*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))}i=-1*W(this.e,Math.tan(.5*(h+s)))}t.x=e;t.y=i;return t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,i){e*=i;return Math.tan(.5*(h+t))*Math.pow((1-e)/(1+e),.5*i)}};var oe={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));t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0;t.x=this.R*a+this.x0;return 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,u=s,l=-1e3,c=0;Math.abs(u-l)>1e-7;){if(++c>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(u))/2));l=u;u=2*Math.atan(Math.exp(h))-Math.PI/2}t.x=o;t.y=u;return t},names:["somerc"]},he=1e-7;var ue={init:function(){var t,e,i,r,n,s,a,o,u,l,c,d,g,_=0,v=0,b=0,w=0,M=0,x=0,E=0;this.no_off=(g="object"==typeof(d=this).PROJECTION?Object.keys(d.PROJECTION)[0]:d.PROJECTION,"no_uoff"in d||"no_off"in d||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g));this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var C=!1;"rectified_grid_angle"in this&&(C=!0);k&&(E=this.alpha);C&&(_=this.rectified_grid_angle*p);if(k||C)v=this.longc;else{b=this.long1;M=this.lat1;w=this.long2;x=this.lat2;if(Math.abs(M-x)<=he||(t=Math.abs(M))<=he||Math.abs(t-h)<=he||Math.abs(Math.abs(this.lat0)-h)<=he||Math.abs(Math.abs(x)-h)<=he)throw new Error}var S=1-this.es;e=Math.sqrt(S);if(Math.abs(this.lat0)>f){o=Math.sin(this.lat0);i=Math.cos(this.lat0);t=1-this.es*o*o;this.B=i*i;this.B=Math.sqrt(1+this.es*this.B*this.B/S);this.A=this.B*this.k0*e/t;if((n=(r=this.B*e/(i*Math.sqrt(t)))*r-1)<=0)n=0;else{n=Math.sqrt(n);this.lat0<0&&(n=-n)}this.E=n+=r;this.E*=Math.pow(G(this.e,this.lat0,o),this.B)}else{this.B=1/e;this.A=this.k0;this.E=r=n=1}if(k||C){if(k){c=Math.asin(Math.sin(E)/r);C||(_=E)}else{c=_;E=Math.asin(r*Math.sin(c))}this.lam0=v-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B}else{s=Math.pow(G(this.e,M,Math.sin(M)),this.B);a=Math.pow(G(this.e,x,Math.sin(x)),this.B);n=this.E/s;u=(a-s)/(a+s);l=((l=this.E*this.E)-a*s)/(l+a*s);(t=b-w)<-Math.pi?w-=y:t>Math.pi&&(w+=y);this.lam0=q(.5*(b+w)-Math.atan(l*Math.tan(.5*this.B*(b-w))/u)/this.B);c=Math.atan(2*Math.sin(this.B*q(b-this.lam0))/(n-1/n));_=E=Math.asin(r*Math.sin(c))}this.singam=Math.sin(c);this.cosgam=Math.cos(c);this.sinrot=Math.sin(_);this.cosrot=Math.cos(_);this.rB=1/this.B;this.ArB=this.A*this.rB;this.BrA=1/this.ArB;if(this.no_off)this.u_0=0;else{this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(E)));this.lat0<0&&(this.u_0=-this.u_0)}n=.5*c;this.v_pole_n=this.ArB*Math.log(Math.tan(m-n));this.v_pole_s=this.ArB*Math.log(Math.tan(m+n))},forward:function(t){var e,i,r,n,s,a,o,u,l={};t.x=t.x-this.lam0;if(Math.abs(Math.abs(t.y)-h)>f){e=.5*((s=this.E/Math.pow(G(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/s));i=.5*(s+a);n=Math.sin(this.B*t.x);r=(e*this.singam-n*this.cosgam)/i;if(Math.abs(Math.abs(r)-1)<f)throw new Error;u=.5*this.ArB*Math.log((1-r)/(1+r));a=Math.cos(this.B*t.x);o=Math.abs(a)<he?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+n*this.singam,a)}else{u=t.y>0?this.v_pole_n:this.v_pole_s;o=this.ArB*t.y}if(this.no_rot){l.x=o;l.y=u}else{o-=this.u_0;l.x=u*this.cosrot+o*this.sinrot;l.y=o*this.cosrot-u*this.sinrot}l.x=this.a*l.x+this.x0;l.y=this.a*l.y+this.y0;return l},inverse:function(t){var e,i,r,n,s,a,o,u={};t.x=(t.x-this.x0)*(1/this.a);t.y=(t.y-this.y0)*(1/this.a);if(this.no_rot){i=t.y;e=t.x}else{i=t.x*this.cosrot-t.y*this.sinrot;e=t.y*this.cosrot+t.x*this.sinrot+this.u_0}n=.5*((r=Math.exp(-this.BrA*i))-1/r);s=.5*(r+1/r);o=((a=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s;if(Math.abs(Math.abs(o)-1)<f){u.x=0;u.y=o<0?-h:h}else{u.y=this.E/Math.sqrt((1+o)/(1-o));u.y=W(this.e,Math.pow(u.y,1/this.B));if(u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(n*this.cosgam-a*this.singam,Math.cos(this.BrA*e))}u.x+=this.lam0;return u},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 le={init:function(){this.lat2||(this.lat2=this.lat1);this.k0||(this.k0=1);this.x0=this.x0||0;this.y0=this.y0||0;if(!(Math.abs(this.lat1+this.lat2)<f)){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=z(this.e,e,i),n=G(this.e,this.lat1,e),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=z(this.e,s,a),h=G(this.e,this.lat2,s),u=G(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>f?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(u,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)<=f&&(i=U(i)*(h-2*f));var r,n,s=Math.abs(Math.abs(i)-h);if(s>f){r=G(this.e,i,Math.sin(i));n=this.a*this.f0*Math.pow(r,this.ns)}else{if((s=i*this.ns)<=0)return null;n=0}var a=this.ns*q(e-this.long0);t.x=this.k0*(n*Math.sin(a))+this.x0;t.y=this.k0*(this.rh-n*Math.cos(a))+this.y0;return t},inverse:function(t){var e,i,r,n,s,a=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;if(this.ns>0){e=Math.sqrt(a*a+o*o);i=1}else{e=-Math.sqrt(a*a+o*o);i=-1}var u=0;0!==e&&(u=Math.atan2(i*a,i*o));if(0!==e||this.ns>0){i=1/this.ns;r=Math.pow(e/(this.a*this.f0),i);if(-9999===(n=W(this.e,r)))return null}else n=-h;s=q(u/this.ns+this.long0);t.x=s;t.y=n;return t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]};var ce={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,u=t.y,l=q(h-this.long0);e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2);i=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45);r=-l*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;if(!this.czech){t.y*=-1;t.x*=-1}return t},inverse:function(t){var e,i,r,n,s,a,o,h=t.x;t.x=t.y;t.y=h;if(!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 u=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;u+=1}while(0===o&&u<15);return u>=15?null:t},names:["Krovak","krovak"]},fe=function(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},pe=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},de=function(t){return.375*t*(1+.25*t*(1+.46875*t))},me=function(t){return.05859375*t*t*(1+.75*t)},ye=function(t){return t*t*t*(35/3072)},ge=function(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)},_e=function(t){return Math.abs(t)<h?t:t-U(t)*Math.PI},ve=function(t,e,i,r,n){var s,a;s=t/e;for(var o=0;o<15;o++){s+=a=(t-(e*s-i*Math.sin(2*s)+r*Math.sin(4*s)-n*Math.sin(6*s)))/(e-2*i*Math.cos(2*s)+4*r*Math.cos(4*s)-6*n*Math.cos(6*s));if(Math.abs(a)<=1e-10)return s}return NaN};var be={init:function(){if(!this.sphere){this.e0=pe(this.es);this.e1=de(this.es);this.e2=me(this.es);this.e3=ye(this.es);this.ml0=this.a*fe(this.e0,this.e1,this.e2,this.e3,this.lat0)}},forward:function(t){var e,i,r=t.x,n=t.y;r=q(r-this.long0);if(this.sphere){e=this.a*Math.asin(Math.cos(n)*Math.sin(r));i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0)}else{var s=Math.sin(n),a=Math.cos(n),o=ge(this.a,this.e,s),h=Math.tan(n)*Math.tan(n),u=r*Math.cos(n),l=u*u,c=this.es*a*a/(1-this.es);e=o*u*(1-l*h*(1/6-(8-h+8*c)*l/120));i=this.a*fe(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*s/a*l*(.5+(5-h+6*c)*l/24)}t.x=e+this.x0;t.y=i+this.y0;return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e,i,r=t.x/this.a,n=t.y/this.a;if(this.sphere){var s=n+this.lat0;e=Math.asin(Math.sin(s)*Math.cos(r));i=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=this.ml0/this.a+n,o=ve(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-h)<=f){t.x=this.long0;t.y=h;n<0&&(t.y*=-1);return t}var u=ge(this.a,this.e,Math.sin(o)),l=u*u*u/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),p=r*this.a/u,d=p*p;e=o-u*Math.tan(o)/l*p*p*(.5-(1+3*c)*p*p/24);i=p*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(o)}t.x=q(i+this.long0);t.y=_e(e);return t},names:["Cassini","Cassini_Soldner","cass"]},we=function(t,e){var i;return t>1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e};var Me=.3333333333333333,xe=.17222222222222222,Ee=.10257936507936508,ke=.06388888888888888,Ce=.0664021164021164,Se=.016415012942191543;var Ae={init:function(){var t=Math.abs(this.lat0);Math.abs(t-h)<f?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<f?this.mode=this.EQUIT:this.mode=this.OBLIQ;if(this.es>0){var e;this.qp=we(this.e,1);this.mmf=.5/(1-this.es);this.apa=function(t){var e,i=[];i[0]=t*Me;e=t*t;i[0]+=e*xe;i[1]=e*ke;e*=t;i[0]+=e*Ee;i[1]+=e*Ce;i[2]=e*Se;return i}(this.es);switch(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);e=Math.sin(this.lat0);this.sinb1=we(this.e,e)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd}}else if(this.mode===this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}},forward:function(t){var e,i,r,n,s,a,o,u,l,c,p=t.x,d=t.y;p=q(p-this.long0);if(this.sphere){s=Math.sin(d);c=Math.cos(d);r=Math.cos(p);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*s+this.cosph0*c*r)<=f)return null;e=(i=Math.sqrt(2/i))*c*Math.sin(p);i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){this.mode===this.N_POLE&&(r=-r);if(Math.abs(d+this.lat0)<f)return null;i=m-.5*d;e=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(p);i*=r}}else{o=0;u=0;l=0;r=Math.cos(p);n=Math.sin(p);s=Math.sin(d);a=we(this.e,s);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){o=a/this.qp;u=Math.sqrt(1-o*o)}switch(this.mode){case this.OBLIQ:l=1+this.sinb1*o+this.cosb1*u*r;break;case this.EQUIT:l=1+u*r;break;case this.N_POLE:l=h+d;a=this.qp-a;break;case this.S_POLE:l=d-h;a=this.qp+a}if(Math.abs(l)<f)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l);i=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*o-this.sinb1*u*r):(l=Math.sqrt(2/(1+u*r)))*o*this.ymf;e=this.xmf*l*u*n;break;case this.N_POLE:case this.S_POLE:if(a>=0){e=(l=Math.sqrt(a))*n;i=r*(this.mode===this.S_POLE?l:-l)}else e=i=0}}t.x=this.a*e+this.x0;t.y=this.a*i+this.y0;return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e,i,r,n,s,a,o,u,l,c,p=t.x/this.a,d=t.y/this.a;if(this.sphere){var m,y=0,g=0;if((i=.5*(m=Math.sqrt(p*p+d*d)))>1)return null;i=2*Math.asin(i);if(this.mode===this.OBLIQ||this.mode===this.EQUIT){g=Math.sin(i);y=Math.cos(i)}switch(this.mode){case this.EQUIT:i=Math.abs(m)<=f?0:Math.asin(d*g/m);p*=g;d=y*m;break;case this.OBLIQ:i=Math.abs(m)<=f?this.lat0:Math.asin(y*this.sinph0+d*g*this.cosph0/m);p*=g*this.cosph0;d=(y-Math.sin(i)*this.sinph0)*m;break;case this.N_POLE:d=-d;i=h-i;break;case this.S_POLE:i-=h}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,d):0}else{o=0;if(this.mode===this.OBLIQ||this.mode===this.EQUIT){p/=this.dd;d*=this.dd;if((a=Math.sqrt(p*p+d*d))<f){t.x=this.long0;t.y=this.lat0;return t}n=2*Math.asin(.5*a/this.rq);r=Math.cos(n);p*=n=Math.sin(n);if(this.mode===this.OBLIQ){o=r*this.sinb1+d*n*this.cosb1/a;s=this.qp*o;d=a*this.cosb1*r-d*this.sinb1*n}else{o=d*n/a;s=this.qp*o;d=a*r}}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){this.mode===this.N_POLE&&(d=-d);if(!(s=p*p+d*d)){t.x=this.long0;t.y=this.lat0;return t}o=1-s/this.qp;this.mode===this.S_POLE&&(o=-o)}e=Math.atan2(p,d);i=(u=Math.asin(o),l=this.apa,c=u+u,u+l[0]*Math.sin(c)+l[1]*Math.sin(c+c)+l[2]*Math.sin(c+c+c))}t.x=q(this.long0+e);t.y=i;return t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Pe=function(t){Math.abs(t)>1&&(t=t>1?1:-1);return Math.asin(t)};var je={init:function(){if(!(Math.abs(this.lat1+this.lat2)<f)){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=z(this.e3,this.sin_po,this.cos_po);this.qs1=we(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=z(this.e3,this.sin_po,this.cos_po);this.qs2=we(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=we(this.e3,this.sin_po,this.cos_po);Math.abs(this.lat1-this.lat2)>f?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=we(this.e3,this.sin_phi,this.cos_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*q(e-this.long0),a=n*Math.sin(s)+this.x0,o=this.rh-n*Math.cos(s)+this.y0;t.x=a;t.y=o;return t},inverse:function(t){var e,i,r,n,s,a;t.x-=this.x0;t.y=this.rh-t.y+this.y0;if(this.ns0>=0){e=Math.sqrt(t.x*t.x+t.y*t.y);r=1}else{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;if(this.sphere)a=Math.asin((this.c-r*r)/(2*this.ns0));else{i=(this.c-r*r)/this.ns0;a=this.phi1z(this.e3,i)}s=q(n/this.ns0+this.long0);t.x=s;t.y=a;return t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,r,n,s,a=Pe(.5*e);if(t<f)return a;for(var o=t*t,h=1;h<=25;h++){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)));if(Math.abs(s)<=1e-7)return a}return null}};var Oe={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,u=t.y;r=q(h-this.long0);e=Math.sin(u);i=Math.cos(u);n=Math.cos(r);1;if((s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=f){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}else{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;return t},inverse:function(t){var e,i,r,n,s,a;t.x=(t.x-this.x0)/this.a;t.y=(t.y-this.y0)/this.a;t.x/=this.k0;t.y/=this.k0;if(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=Pe(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=q(this.long0+s)}else{a=this.phic0;s=0}t.x=s;t.y=a;return t},names:["gnom"]};var Re={init:function(){this.sphere||(this.k0=z(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=q(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=we(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s;i=this.y0+this.a*a*.5/this.k0}t.x=e;t.y=i;return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e,i;if(this.sphere){e=q(this.long0+t.x/this.a/Math.cos(this.lat_ts));i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))}else{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*h:h;for(var r,n,s,a,o=Math.asin(.5*e),u=0;u<30;u++){n=Math.sin(o);s=Math.cos(o);a=t*n;o+=r=Math.pow(1-a*a,2)/(2*s)*(e/(1-t*t)-n/(1-a*a)+.5/t*Math.log((1-a)/(1+a)));if(Math.abs(r)<=1e-10)return o}return NaN}(this.e,2*t.y*this.k0/this.a);e=q(this.long0+t.x/(this.a*this.k0))}t.x=e;t.y=i;return t},names:["cea"]};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||"Equidistant Cylindrical (Plate Carre)";this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,r=q(e-this.long0),n=_e(i-this.lat0);t.x=this.x0+this.a*r*this.rc;t.y=this.y0+this.a*n;return t},inverse:function(t){var e=t.x,i=t.y;t.x=q(this.long0+(e-this.x0)/(this.a*this.rc));t.y=_e(this.lat0+(i-this.y0)/this.a);return t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var Ie={init:function(){this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=pe(this.es);this.e1=de(this.es);this.e2=me(this.es);this.e3=ye(this.es);this.ml0=this.a*fe(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,r,n=t.x,s=t.y,a=q(n-this.long0);r=a*Math.sin(s);if(this.sphere)if(Math.abs(s)<=f){e=this.a*a;i=-1*this.a*this.lat0}else{e=this.a*Math.sin(r)/Math.tan(s);i=this.a*(_e(s-this.lat0)+(1-Math.cos(r))/Math.tan(s))}else if(Math.abs(s)<=f){e=this.a*a;i=-1*this.ml0}else{var o=ge(this.a,this.e,Math.sin(s))/Math.tan(s);e=o*Math.sin(r);i=this.a*fe(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*(1-Math.cos(r))}t.x=e+this.x0;t.y=i+this.y0;return t},inverse:function(t){var e,i,r,n,s,a,o,h,u;r=t.x-this.x0;n=t.y-this.y0;if(this.sphere)if(Math.abs(n+this.a*this.lat0)<=f){e=q(r/this.a+this.long0);i=0}else{a=this.lat0+n/this.a;o=r*r/this.a/this.a+a*a;h=a;var l;for(s=20;s;--s){h+=u=-1*(a*(h*(l=Math.tan(h))+1)-h-.5*(h*h+o)*l)/((h-a)/l-1);if(Math.abs(u)<=f){i=h;break}}e=q(this.long0+Math.asin(r*Math.tan(h)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=f){i=0;e=q(this.long0+r/this.a)}else{a=(this.ml0+n)/this.a;o=r*r/this.a/this.a+a*a;h=a;var c,p,d,m,y;for(s=20;s;--s){y=this.e*Math.sin(h);c=Math.sqrt(1-y*y)*Math.tan(h);p=this.a*fe(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-=u=(a*(c*(m=p/this.a)+1)-m-.5*c*(m*m+o))/(this.es*Math.sin(2*h)*(m*m+o-2*a*m)/(4*c)+(a-m)*(c*d-2/Math.sin(2*h))-d);if(Math.abs(u)<=f){i=h;break}}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i);e=q(this.long0+Math.asin(r*c/this.a)/Math.sin(i))}t.x=e;t.y=i;return t},names:["Polyconic","poly"]};var Ne={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,r=t.y-this.lat0,n=i-this.long0,s=r/o*1e-5,a=n,h=1,u=0;for(e=1;e<=10;e++){h*=s;u+=this.A[e]*h}var l,c=u,f=a,p=1,d=0,m=0,y=0;for(e=1;e<=6;e++){l=d*c+p*f;p=p*c-d*f;d=l;m=m+this.B_re[e]*p-this.B_im[e]*d;y=y+this.B_im[e]*p+this.B_re[e]*d}t.x=y*this.a+this.x0;t.y=m*this.a+this.y0;return t},inverse:function(t){var e,i,r=t.x,n=t.y,s=r-this.x0,a=(n-this.y0)/this.a,h=s/this.a,u=1,l=0,c=0,f=0;for(e=1;e<=6;e++){i=l*a+u*h;u=u*a-l*h;l=i;c=c+this.C_re[e]*u-this.C_im[e]*l;f=f+this.C_im[e]*u+this.C_re[e]*l}for(var p=0;p<this.iterations;p++){var d,m=c,y=f,g=a,_=h;for(e=2;e<=6;e++){d=y*c+m*f;m=m*c-y*f;y=d;g+=(e-1)*(this.B_re[e]*m-this.B_im[e]*y);_+=(e-1)*(this.B_im[e]*m+this.B_re[e]*y)}m=1;y=0;var v=this.B_re[1],b=this.B_im[1];for(e=2;e<=6;e++){d=y*c+m*f;m=m*c-y*f;y=d;v+=e*(this.B_re[e]*m-this.B_im[e]*y);b+=e*(this.B_im[e]*m+this.B_re[e]*y)}var w=v*v+b*b;c=(g*v+_*b)/w;f=(_*v-g*b)/w}var M=c,x=f,E=1,k=0;for(e=1;e<=9;e++){E*=M;k+=this.D[e]*E}var C=this.lat0+k*o*1e5,S=this.long0+x;t.x=S;t.y=C;return t},names:["New_Zealand_Map_Grid","nzmg"]};var Le={init:function(){},forward:function(t){var e=t.x,i=t.y,r=q(e-this.long0),n=this.x0+this.a*r,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;t.x=n;t.y=s;return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e=q(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);t.x=e;t.y=i;return t},names:["Miller_Cylindrical","mill"]};var Be={init:function(){if(this.sphere){this.n=1;this.m=0;this.es=0;this.C_y=Math.sqrt((this.m+1)/this.n);this.C_x=this.C_y/(this.m+1)}else this.en=Qt(this.es)},forward:function(t){var e,i,r=t.x,n=t.y;r=q(r-this.long0);if(this.sphere){if(this.m)for(var s=this.n*Math.sin(n),a=20;a;--a){var o=(this.m*n+Math.sin(n)-s)/(this.m+Math.cos(n));n-=o;if(Math.abs(o)<f)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;e=this.a*this.C_x*r*(this.m+Math.cos(n));i=this.a*this.C_y*n}else{var h=Math.sin(n),u=Math.cos(n);i=this.a*Xt(n,h,u,this.en);e=this.a*r*u/Math.sqrt(1-this.es*h*h)}t.x=e;t.y=i;return t},inverse:function(t){var e,i,r,n;t.x-=this.x0;r=t.x/this.a;t.y-=this.y0;e=t.y/this.a;if(this.sphere){e/=this.C_y;r/=this.C_x*(this.m+Math.cos(e));this.m?e=Pe((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=Pe(Math.sin(e)/this.n));r=q(r+this.long0);e=_e(e)}else{e=Vt(t.y/this.a,this.es,this.en);if((n=Math.abs(e))<h){n=Math.sin(e);i=this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(e));r=q(i)}else n-f<h&&(r=this.long0)}t.x=r;t.y=e;return t},names:["Sinusoidal","sinu"]};var Fe={init:function(){},forward:function(t){for(var e=t.x,i=t.y,r=q(e-this.long0),n=i,s=Math.PI*Math.sin(i);;){var a=-(n+Math.sin(n)-s)/(1+Math.cos(n));n+=a;if(Math.abs(a)<f)break}n/=2;Math.PI/2-Math.abs(i)<f&&(r=0);var o=.900316316158*this.a*r*Math.cos(n)+this.x0,h=1.4142135623731*this.a*Math.sin(n)+this.y0;t.x=o;t.y=h;return t},inverse:function(t){var e,i;t.x-=this.x0;t.y-=this.y0;i=t.y/(1.4142135623731*this.a);Math.abs(i)>.999999999999&&(i=.999999999999);e=Math.asin(i);var r=q(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);t.x=r;t.y=n;return t},names:["Mollweide","moll"]};var De={init:function(){if(!(Math.abs(this.lat1+this.lat2)<f)){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=pe(this.es);this.e1=de(this.es);this.e2=me(this.es);this.e3=ye(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=z(this.e,this.sinphi,this.cosphi);this.ml1=fe(this.e0,this.e1,this.e2,this.e3,this.lat1);if(Math.abs(this.lat1-this.lat2)<f)this.ns=this.sinphi;else{this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=z(this.e,this.sinphi,this.cosphi);this.ml2=fe(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=fe(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=fe(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-n)}var s=this.ns*q(i-this.long0),a=this.x0+e*Math.sin(s),o=this.y0+this.rh-e*Math.cos(s);t.x=a;t.y=o;return t},inverse:function(t){t.x-=this.x0;t.y=this.rh-t.y+this.y0;var e,i,r,n;if(this.ns>=0){i=Math.sqrt(t.x*t.x+t.y*t.y);e=1}else{i=-Math.sqrt(t.x*t.x+t.y*t.y);e=-1}var s=0;0!==i&&(s=Math.atan2(e*t.x,e*t.y));if(this.sphere){n=q(this.long0+s/this.ns);r=_e(this.g-i/this.a);t.x=n;t.y=r;return t}var a=this.g-i/this.a;r=ve(a,this.e0,this.e1,this.e2,this.e3);n=q(this.long0+s/this.ns);t.x=n;t.y=r;return t},names:["Equidistant_Conic","eqdc"]};var ze={init:function(){this.R=this.a},forward:function(t){var e,i,r=t.x,n=t.y,s=q(r-this.long0);if(Math.abs(n)<=f){e=this.x0+this.R*s;i=this.y0}var a=Pe(2*Math.abs(n/Math.PI));if(Math.abs(s)<=f||Math.abs(Math.abs(n)-h)<=f){e=this.x0;i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a)}var o=.5*Math.abs(Math.PI/s-s/Math.PI),u=o*o,l=Math.sin(a),c=Math.cos(a),p=c/(l+c-1),d=p*p,m=p*(2/l-1),y=m*m,g=Math.PI*this.R*(o*(p-y)+Math.sqrt(u*(p-y)*(p-y)-(y+u)*(d-y)))/(y+u);s<0&&(g=-g);e=this.x0+g;var _=u+p;g=Math.PI*this.R*(m*_-o*Math.sqrt((y+u)*(u+1)-_*_))/(y+u);i=n>=0?this.y0+g:this.y0-g;t.x=e;t.y=i;return t},inverse:function(t){var e,i,r,n,s,a,o,h,u,l,c,p;t.x-=this.x0;t.y-=this.y0;c=Math.PI*this.R;s=(r=t.x/c)*r+(n=t.y/c)*n;c=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)/(u=(a-o*o/3/h)/h)/(l=2*Math.sqrt(-u/3));Math.abs(c)>1&&(c=c>=0?1:-1);p=Math.acos(c)/3;i=t.y>=0?(-l*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI:-(-l*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI;e=Math.abs(r)<f?this.long0:q(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(r*r-n*n)+s*s))/2/r);t.x=e;t.y=i;return t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var Ue={init:function(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,i,r,n,s,a,o,u,l,c,p,d,m,y,g,_,v,b,w,M,x,E,k=t.x,C=t.y,S=Math.sin(t.y),A=Math.cos(t.y),P=q(k-this.long0);if(this.sphere){if(Math.abs(this.sin_p12-1)<=f){t.x=this.x0+this.a*(h-C)*Math.sin(P);t.y=this.y0-this.a*(h-C)*Math.cos(P);return t}if(Math.abs(this.sin_p12+1)<=f){t.x=this.x0+this.a*(h+C)*Math.sin(P);t.y=this.y0+this.a*(h+C)*Math.cos(P);return t}b=this.sin_p12*S+this.cos_p12*A*Math.cos(P);v=(_=Math.acos(b))?_/Math.sin(_):1;t.x=this.x0+this.a*v*A*Math.sin(P);t.y=this.y0+this.a*v*(this.cos_p12*S-this.sin_p12*A*Math.cos(P));return t}e=pe(this.es);i=de(this.es);r=me(this.es);n=ye(this.es);if(Math.abs(this.sin_p12-1)<=f){s=this.a*fe(e,i,r,n,h);a=this.a*fe(e,i,r,n,C);t.x=this.x0+(s-a)*Math.sin(P);t.y=this.y0-(s-a)*Math.cos(P);return t}if(Math.abs(this.sin_p12+1)<=f){s=this.a*fe(e,i,r,n,h);a=this.a*fe(e,i,r,n,C);t.x=this.x0+(s+a)*Math.sin(P);t.y=this.y0+(s+a)*Math.cos(P);return t}o=S/A;u=ge(this.a,this.e,this.sin_p12);l=ge(this.a,this.e,S);c=Math.atan((1-this.es)*o+this.es*u*this.sin_p12/(l*A));w=0===(p=Math.atan2(Math.sin(P),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(P)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(p)-Math.PI)<=f?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(P)*Math.cos(c)/Math.sin(p));d=this.e*this.sin_p12/Math.sqrt(1-this.es);_=u*w*(1-(M=w*w)*(g=(m=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es))*m)*(1-g)/6+(x=M*w)/8*(y=d*m)*(1-2*g)+(E=x*w)/120*(g*(4-7*g)-3*d*d*(1-7*g))-E*w/48*y);t.x=this.x0+_*Math.sin(p);t.y=this.y0+_*Math.cos(p);return t},inverse:function(t){t.x-=this.x0;t.y-=this.y0;var e,i,r,n,s,a,o,u,l,c,p,d,m,y,g,_,v,b,w,M,x,E,k;if(this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*h*this.a)return;i=e/this.a;r=Math.sin(i);n=Math.cos(i);s=this.long0;if(Math.abs(e)<=f)a=this.lat0;else{a=Pe(n*this.sin_p12+t.y*r*this.cos_p12/e);o=Math.abs(this.lat0)-h;s=Math.abs(o)<=f?this.lat0>=0?q(this.long0+Math.atan2(t.x,-t.y)):q(this.long0-Math.atan2(-t.x,t.y)):q(this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))}t.x=s;t.y=a;return t}u=pe(this.es);l=de(this.es);c=me(this.es);p=ye(this.es);if(Math.abs(this.sin_p12-1)<=f){d=this.a*fe(u,l,c,p,h);e=Math.sqrt(t.x*t.x+t.y*t.y);a=ve((d-e)/this.a,u,l,c,p);s=q(this.long0+Math.atan2(t.x,-1*t.y));t.x=s;t.y=a;return t}if(Math.abs(this.sin_p12+1)<=f){d=this.a*fe(u,l,c,p,h);e=Math.sqrt(t.x*t.x+t.y*t.y);a=ve((e-d)/this.a,u,l,c,p);s=q(this.long0+Math.atan2(t.x,t.y));t.x=s;t.y=a;return t}e=Math.sqrt(t.x*t.x+t.y*t.y);g=Math.atan2(t.x,t.y);m=ge(this.a,this.e,this.sin_p12);_=Math.cos(g);b=-(v=this.e*this.cos_p12*_)*v/(1-this.es);w=3*this.es*(1-b)*this.sin_p12*this.cos_p12*_/(1-this.es);E=1-b*(x=(M=e/m)-b*(1+b)*Math.pow(M,3)/6-w*(1+3*b)*Math.pow(M,4)/24)*x/2-M*x*x*x/6;y=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*_);s=q(this.long0+Math.asin(Math.sin(g)*Math.sin(x)/Math.cos(y)));k=Math.sin(y);a=Math.atan2((k-this.es*E*this.sin_p12)*Math.tan(y),k*(1-this.es));t.x=s;t.y=a;return t},names:["Azimuthal_Equidistant","aeqd"]};var qe={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,u=t.y;r=q(h-this.long0);e=Math.sin(u);i=Math.cos(u);n=Math.cos(r);1;if((s=this.sin_p14*e+this.cos_p14*i*n)>0||Math.abs(s)<=f){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;return t},inverse:function(t){var e,i,r,n,s,a,o;t.x-=this.x0;t.y-=this.y0;e=Math.sqrt(t.x*t.x+t.y*t.y);i=Pe(e/this.a);r=Math.sin(i);n=Math.cos(i);a=this.long0;if(Math.abs(e)<=f){o=this.lat0;t.x=a;t.y=o;return t}o=Pe(n*this.sin_p14+t.y*r*this.cos_p14/e);s=Math.abs(this.lat0)-h;if(Math.abs(s)<=f){a=this.lat0>=0?q(this.long0+Math.atan2(t.x,-t.y)):q(this.long0-Math.atan2(-t.x,t.y));t.x=a;t.y=o;return t}a=q(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r));t.x=a;t.y=o;return t},names:["ortho"]},Ge=1,We=2,He=3,Qe=4,Xe=5,Ve=6,Ze={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Je(t,e,i,r){var n;if(t<f){r.value=Ze.AREA_0;n=0}else{n=Math.atan2(e,i);if(Math.abs(n)<=m)r.value=Ze.AREA_0;else if(n>m&&n<=h+m){r.value=Ze.AREA_1;n-=h}else if(n>h+m||n<=-(h+m)){r.value=Ze.AREA_2;n=n>=0?n-g:n+g}else{r.value=Ze.AREA_3;n+=h}}return n}function Ye(t,e){var i=t+e;i<-g?i+=y:i>+g&&(i-=y);return i}var Ke={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>=h-m/2?this.face=Xe:this.lat0<=-(h-m/2)?this.face=Ve:Math.abs(this.long0)<=m?this.face=Ge:Math.abs(this.long0)<=h+m?this.face=this.long0>0?We:Qe:this.face=He;if(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,n,s,a,o={x:0,y:0},u={value:0};t.x-=this.long0;e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y;i=t.x;if(this.face===Xe){n=h-e;if(i>=m&&i<=h+m){u.value=Ze.AREA_0;r=i-h}else if(i>h+m||i<=-(h+m)){u.value=Ze.AREA_1;r=i>0?i-g:i+g}else if(i>-(h+m)&&i<=-m){u.value=Ze.AREA_2;r=i+h}else{u.value=Ze.AREA_3;r=i}}else if(this.face===Ve){n=h+e;if(i>=m&&i<=h+m){u.value=Ze.AREA_0;r=-i+h}else if(i<m&&i>=-m){u.value=Ze.AREA_1;r=-i}else if(i<-m&&i>=-(h+m)){u.value=Ze.AREA_2;r=-i-h}else{u.value=Ze.AREA_3;r=i>0?-i+g:-i-g}}else{var l,c,f,p,d,y;this.face===We?i=Ye(i,+h):this.face===He?i=Ye(i,+g):this.face===Qe&&(i=Ye(i,-h));p=Math.sin(e);d=Math.cos(e);y=Math.sin(i);l=d*Math.cos(i);c=d*y;f=p;if(this.face===Ge)r=Je(n=Math.acos(l),f,c,u);else if(this.face===We)r=Je(n=Math.acos(c),f,-l,u);else if(this.face===He)r=Je(n=Math.acos(-l),f,-c,u);else if(this.face===Qe)r=Je(n=Math.acos(-c),f,l,u);else{n=r=0;u.value=Ze.AREA_0}}a=Math.atan(12/g*(r+Math.acos(Math.sin(r)*Math.cos(m))-h));s=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r)))));u.value===Ze.AREA_1?a+=h:u.value===Ze.AREA_2?a+=g:u.value===Ze.AREA_3&&(a+=1.5*g);o.x=s*Math.cos(a);o.y=s*Math.sin(a);o.x=o.x*this.a+this.x0;o.y=o.y*this.a+this.y0;t.x=o.x;t.y=o.y;return t},inverse:function(t){var e,i,r,n,s,a,o,u,l,c={lam:0,phi:0},f={value:0};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);if(t.x>=0&&t.x>=Math.abs(t.y))f.value=Ze.AREA_0;else if(t.y>=0&&t.y>=Math.abs(t.x)){f.value=Ze.AREA_1;e-=h}else if(t.x<0&&-t.x>=Math.abs(t.y)){f.value=Ze.AREA_2;e=e<0?e+g:e-g}else{f.value=Ze.AREA_3;e+=h}l=g/12*Math.tan(e);s=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2));a=Math.atan(s);(o=1-(r=Math.cos(e))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?o=-1:o>1&&(o=1);if(this.face===Xe){u=Math.acos(o);c.phi=h-u;f.value===Ze.AREA_0?c.lam=a+h:f.value===Ze.AREA_1?c.lam=a<0?a+g:a-g:f.value===Ze.AREA_2?c.lam=a-h:c.lam=a}else if(this.face===Ve){u=Math.acos(o);c.phi=u-h;f.value===Ze.AREA_0?c.lam=-a+h:f.value===Ze.AREA_1?c.lam=-a:f.value===Ze.AREA_2?c.lam=-a-h:c.lam=a<0?-a-g:-a+g}else{var p,d,m;l=(p=o)*p;d=(l+=(m=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*m)>=1?0:Math.sqrt(1-l);if(f.value===Ze.AREA_1){l=d;d=-m;m=l}else if(f.value===Ze.AREA_2){d=-d;m=-m}else if(f.value===Ze.AREA_3){l=d;d=m;m=-l}if(this.face===We){l=p;p=-d;d=l}else if(this.face===He){p=-p;d=-d}else if(this.face===Qe){l=p;p=d;d=-l}c.phi=Math.acos(-m)-h;c.lam=Math.atan2(d,p);this.face===We?c.lam=Ye(c.lam,-h):this.face===He?c.lam=Ye(c.lam,-g):this.face===Qe&&(c.lam=Ye(c.lam,+h))}if(0!==this.es){var y,_,v;y=c.phi<0?1:0;_=Math.tan(c.phi);v=this.b/Math.sqrt(_*_+this.one_minus_f_squared);c.phi=Math.atan(Math.sqrt(this.a*this.a-v*v)/(this.one_minus_f*v));y&&(c.phi=-c.phi)}c.lam+=this.long0;t.x=c.lam;t.y=c.phi;return t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},$e=[[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]],ti=[[-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]],ei=.8487,ii=1.3523,ri=d/5,ni=1/ri,si=18,ai=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var oi={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=q(t.x-this.long0),i=Math.abs(t.y),r=Math.floor(i*ri);r<0?r=0:r>=si&&(r=17);var n={x:ai($e[r],i=d*(i-ni*r))*e,y:ai(ti[r],i)};t.y<0&&(n.y=-n.y);n.x=n.x*this.a*ei+this.x0;n.y=n.y*this.a*ii+this.y0;return n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*ei),y:Math.abs(t.y-this.y0)/(this.a*ii)};if(e.y>=1){e.x/=$e[18][0];e.y=t.y<0?-h:h}else{var i=Math.floor(e.y*si);i<0?i=0:i>=si&&(i=17);for(;;)if(ti[i][0]>e.y)--i;else{if(!(ti[i+1][0]<=e.y))break;++i}var r=ti[i],n=5*(e.y-r[0])/(ti[i+1][0]-r[0]);n=function(t,e,i,r){for(var n=e;r;--r){var s=t(n);n-=s;if(Math.abs(s)<i)break}return n}((function(t){return(ai(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)}),n,f,100);e.x/=ai($e[i],n);e.y=(5*i+n)*p;t.y<0&&(e.y=-e.y)}e.x=q(e.x+this.long0);return e},names:["Robinson","robin"]};var hi={init:function(){this.name="geocent"},forward:function(t){return ht(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},ui=0,li=1,ci=2,fi=3,pi={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var di={init:function(){Object.keys(pi).forEach(function(t){if(void 0===this[t])this[t]=pi[t].def;else{if(pi[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);pi[t].num&&(this[t]=parseFloat(this[t]))}pi[t].degrees&&(this[t]=this[t]*p)}.bind(this));if(Math.abs(Math.abs(this.lat0)-h)<f)this.mode=this.lat0<0?li:ui;else if(Math.abs(this.lat0)<f)this.mode=ci;else{this.mode=fi;this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}this.pn1=this.h/this.a;if(this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1;this.rp=1/this.p;this.h1=1/this.pn1;this.pfact=(this.p+1)*this.h1;this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e);this.sg=Math.sin(e);this.cw=Math.cos(t);this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,i,r,n,s=Math.sin(t.y),a=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case fi:i=this.sinph0*s+this.cosph0*a*o;break;case ci:i=a*o;break;case li:i=-s;break;case ui:i=s}e=(i=this.pn1/(this.p-i))*a*Math.sin(t.x);switch(this.mode){case fi:i*=this.cosph0*s-this.sinph0*a*o;break;case ci:i*=s;break;case ui:i*=-a*o;break;case li:i*=a*o}n=1/((r=i*this.cg+e*this.sg)*this.sw*this.h1+this.cw);e=(e*this.cg-i*this.sg)*this.cw*n;i=r*n;t.x=e*this.a;t.y=i*this.a;return t},inverse:function(t){t.x/=this.a;t.y/=this.a;var e,i,r,n={x:t.x,y:t.y};r=1/(this.pn1-t.y*this.sw);e=this.pn1*t.x*r;i=this.pn1*t.y*this.cw*r;t.x=e*this.cg+i*this.sg;t.y=i*this.cg-e*this.sg;var s=Yt(t.x,t.y);if(Math.abs(s)<f){n.x=0;n.y=t.y}else{var a,o;o=1-s*s*this.pfact;o=(this.p-Math.sqrt(o))/(this.pn1/s+s/this.pn1);a=Math.sqrt(1-o*o);switch(this.mode){case fi:n.y=Math.asin(a*this.sinph0+t.y*o*this.cosph0/s);t.y=(a-this.sinph0*Math.sin(n.y))*s;t.x*=o*this.cosph0;break;case ci:n.y=Math.asin(t.y*o/s);t.y=a*s;t.x*=o;break;case ui:n.y=Math.asin(a);t.y=-t.y;break;case li:n.y=-Math.asin(a)}n.x=Math.atan2(t.x,t.y)}t.x=n.x+this.long0;t.y=n.y;return t},names:["Tilted_Perspective","tpers"]};xt.defaultDatum="WGS84";xt.Proj=ot;xt.WGS84=new xt.Proj("WGS84");xt.Point=qt;xt.toPoint=yt;xt.defs=N;xt.nadgrid=function(t,e){var i=new DataView(e),r=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0);11!==e&&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:rt(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=function(t,e,i){for(var r=176,n=[],s=0;s<e.nSubgrids;s++){var a=st(t,r,i),o=at(t,r,a,i),h=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),u=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);n.push({ll:[it(a.lowerLongitude),it(a.lowerLatitude)],del:[it(a.longitudeInterval),it(a.latitudeInterval)],lim:[h,u],count:a.gridNodeCount,cvs:nt(o)})}return n}(i,n,r),a={header:n,subgrids:s};tt[t]=a;return a};xt.transform=vt;xt.mgrs=Rt;xt.version="2.7.4";!function(t){t.Proj.projections.add(Zt);t.Proj.projections.add(ee);t.Proj.projections.add(ie);t.Proj.projections.add(se);t.Proj.projections.add(ae);t.Proj.projections.add(oe);t.Proj.projections.add(ue);t.Proj.projections.add(le);t.Proj.projections.add(ce);t.Proj.projections.add(be);t.Proj.projections.add(Ae);t.Proj.projections.add(je);t.Proj.projections.add(Oe);t.Proj.projections.add(Re);t.Proj.projections.add(Te);t.Proj.projections.add(Ie);t.Proj.projections.add(Ne);t.Proj.projections.add(Le);t.Proj.projections.add(Be);t.Proj.projections.add(Fe);t.Proj.projections.add(De);t.Proj.projections.add(ze);t.Proj.projections.add(Ue);t.Proj.projections.add(qe);t.Proj.projections.add(Ke);t.Proj.projections.add(oi);t.Proj.projections.add(hi);t.Proj.projections.add(di)}(xt);return xt}))},{}],20:[function(t,e,i){var r=t("buffer"),n=r.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow)e.exports=r;else{s(r,i);i.Buffer=a}function a(t,e,i){return n(t,e,i)}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);void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0);return 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)}},{buffer:12}],21:[function(t,e,i){"use strict";var r=t("safe-buffer").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}};i.StringDecoder=s;function s(t){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);var e;switch(this.encoding){case"utf16le":this.text=h;this.end=u;e=4;break;case"utf8":this.fillLast=o;e=4;break;case"base64":this.text=l;this.end=c;e=3;break;default:this.write=f;this.end=p;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=r.allocUnsafe(e)}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<t.length?e?e+this.text(t,i):this.text(t,i):e||""};s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e};s.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var n=a(e[r]);if(n>=0){n>0&&(t.lastNeed=n-1);return n}if(--r<i||-2===n)return 0;n=a(e[r]);if(n>=0){n>0&&(t.lastNeed=n-2);return n}if(--r<i||-2===n)return 0;n=a(e[r]);if(n>=0){n>0&&(2===n?n=0:t.lastNeed=n-3);return n}return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);t.copy(this.lastChar,0,r);return t.toString("utf8",e,r)};s.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};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])){t.lastNeed=0;return"<22>"}if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1])){t.lastNeed=1;return"<22>"}if(t.lastNeed>2&&e.length>2&&128!=(192&e[2])){t.lastNeed=2;return"<22>"}}}(this,t);if(void 0!==i)return i;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);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){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return i.slice(0,-1)}}return i}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function u(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 l(t,e){var i=(t.length-e)%3;if(0===i)return t.toString("base64",e);this.lastNeed=3-i;this.lastTotal=3;if(1===i)this.lastChar[0]=t[t.length-1];else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-i)}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}},{"safe-buffer":20}],22:[function(t,e,i){(function(e,r){(function(){var n=t("process/browser.js").nextTick,s=Function.prototype.apply,a=Array.prototype.slice,o={},h=0;i.setTimeout=function(){return new u(s.call(setTimeout,window,arguments),clearTimeout)};i.setInterval=function(){return new u(s.call(setInterval,window,arguments),clearInterval)};i.clearTimeout=i.clearInterval=function(t){t.close()};function u(t,e){this._id=t;this._clearFn=e}u.prototype.unref=u.prototype.ref=function(){};u.prototype.close=function(){this._clearFn.call(window,this._id)};i.enroll=function(t,e){clearTimeout(t._idleTimeoutId);t._idleTimeout=e};i.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};i._unrefActive=i.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))};i.setImmediate="function"==typeof e?e:function(t){var e=h++,r=!(arguments.length<2)&&a.call(arguments,1);o[e]=!0;n((function(){if(o[e]){r?t.apply(null,r):t.call(null);i.clearImmediate(e)}}));return e};i.clearImmediate="function"==typeof r?r:function(t){delete o[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":18,timers:22}],23:[function(t,e,i){(function(i){(function(){"use strict";let r=t("proj4");r.default&&(r=r.default);const n=t("./unzip"),s=t("./binaryajax"),a=t("./parseShp"),o=t("parsedbf"),h=t("lie"),u=t("lru-cache"),l=t("buffer").Buffer,c=i.URL,f=new u({max:20});function p(t){if(!t)throw new Error("forgot to pass buffer");return l.isBuffer(t)?t:t instanceof i.ArrayBuffer?l.from(t):t.buffer instanceof i.ArrayBuffer?1===t.BYTES_PER_ELEMENT?l.from(t):l.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){"string"==typeof t&&f.set(t,e);return e}))}d.combine=function(t){const e={type:"FeatureCollection",features:[]};let i=0;const r=t[0].length;for(;i<r;){e.features.push({type:"Feature",geometry:t[0][i],properties:t[1][i]});i++}return e};d.parseZip=async function(t,e){let i;t=p(t);const s=await n(t),h=[];e=e||[];for(i in s)if(-1===i.indexOf("__MACOSX"))if("shp"===i.slice(-3).toLowerCase()){h.push(i.slice(0,-4));s[i.slice(0,-3)+i.slice(-3).toLowerCase()]=s[i]}else"prj"===i.slice(-3).toLowerCase()?s[i.slice(0,-3)+i.slice(-3).toLowerCase()]=r(s[i]):"json"===i.slice(-4).toLowerCase()||e.indexOf(i.split(".").pop())>-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");const u=h.map((function(t){let i,r;const n=t.lastIndexOf(".");if(n>-1&&t.slice(n).indexOf("json")>-1){i=JSON.parse(s[t]);i.fileName=t.slice(0,n)}else if(e.indexOf(t.slice(n+1))>-1){i=s[t];i.fileName=t}else{s[t+".dbf"]&&(r=o(s[t+".dbf"],s[t+".cpg"]));i=d.combine([a(s[t+".shp"],s[t+".prj"]),r]);i.fileName=t}return i}));return 1===u.length?u[0]:u};const m=async t=>{const e=await h.all([s(t,"shp"),s(t,"prj")]);let i=!1;try{e[1]&&(i=r(e[1]))}catch(t){i=!1}return a(e[0],i)},y=async t=>{const[e,i]=await h.all([s(t,"dbf"),s(t,"cpg")]);return o(e,i)};d.getShapefile=async function(t,e){if("string"!=typeof t)return d.parseZip(t);if(((t,e)=>new c(t).pathname.slice(-4).toLowerCase()===e)(t,".zip"))return async function(t,e){const i=await s(t);return d.parseZip(i,e)}(t,e);const i=await h.all([m(t),y(t)]);return d.combine(i)};d.parseShp=function(t,e){t=p(t);l.isBuffer(e)&&(e=e.toString());if("string"==typeof e)try{e=r(e)}catch(t){e=!1}return a(t,e)};d.parseDbf=function(t,e){t=p(t);return o(t,e)};e.exports=d}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./binaryajax":6,"./parseShp":8,"./unzip":9,buffer:12,lie:16,"lru-cache":17,parsedbf:2,proj4:19}]},{},[23])(23)}));class MWM_Settings_Importer{constructor(){this.geojsondocumentToImport=!1;this.gljsdocumentToImport=!1;this.importInstallationFile=!1;this.featuresImported=0;this.upgradeMessage="";this.initializedInputs=[];this.jsonImport={categories:[],point:[],line:[],polygon:[]};this.postsImported=0;this.fetchedFields={};this.currentFile=!1;this.currentCSVImport=[];this.currentImportCategory=!1}setUpgradeMessage(t){this.upgradeMessage=window.mapster_settings.strings["Upgrade Message 1"]}async doGeoJSONImport(){if(this.geojsondocumentToImport)try{const t=await this.doGeoJSONImportPost(this.geojsondocumentToImport,this.jsonImport,this.currentImportCategory,this.featuresImported);this.displayAfterImport(t.count)}catch(t){jQuery(".mapster-import-error").html(window.mapster_settings.strings.Error+this.upgradeMessage)}else window.alert(window.mapster_settings.strings["Please Upload"])}async geoJSONUploaded(t){let e=this;jQuery("#geojson-import-data-summary h4 span").html(t.target.files[0].type);if(t.target.files[0].name.indexOf(".json")>-1||t.target.files[0].name.indexOf(".geojson")>-1){const i=await new Response(t.target.files[0]).json();e.importGeoJSON(i)}else if(t.target.files[0].name.indexOf(".kml")>-1){const t=new FileReader;t.readAsText(event.target.files[0]);t.onload=async()=>{const i=toGeoJSON.kml((new DOMParser).parseFromString(t.result,"text/xml"));e.importGeoJSON(i)}}else if(t.target.files[0].name.indexOf(".gpx")>-1){const t=new FileReader;t.readAsText(event.target.files[0]);t.onload=async()=>{const i=toGeoJSON.gpx((new DOMParser).parseFromString(t.result,"text/xml"));e.importGeoJSON(i)}}else{const t=new FileReader;t.readAsArrayBuffer(event.target.files[0]);t.onload=async()=>{const i=await shp(t.result);e.importGeoJSON(i)}}}importGeoJSON(t){if(t){this.showDataAboutImport(t);this.geojsondocumentToImport=t}else window.alert(window.mapster_settings.strings["Please Upload"])}isGoodProjection(t){let e=!0;t.filter((t=>this.centerProjection(turf.center(t).geometry.coordinates))).length>0&&(e=!1);return e}centerProjection(t){return t[0]<-180||t[0]>180||t[1]<-90||t[1]>90}tryReprojection(t){let e=JSON.parse(JSON.stringify(t));e.features.forEach((t=>{t.geometry.coordinates=this.recursiveReproject(t.geometry.coordinates)}));var i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e)),r=document.createElement("a");r.setAttribute("href",i);r.setAttribute("download","mapster-reprojection.json");r.click()}recursiveReproject(t){if(isNaN(t[0])){t.forEach(((e,i)=>{t[i]=recursiveReproject(e)}));return t}{const e=""!==jQuery("#mapster-from-projection").val()?jQuery("#mapster-from-projection").val():"EPSG:3857";return proj4(e,"EPSG:4326",t)}}showDataAboutImport(t){if(t.type){jQuery(".mapster-import-options").fadeIn();jQuery("#geojson-import-button").fadeIn();jQuery("#geojson-import-data-summary").fadeIn();this.currentFile=t;this.advancedOptions();const e=[...new Set(t.features.map((t=>t.geometry.type)))];jQuery("#geojson-import-data-summary table tbody").html("");if(!this.isGoodProjection(t.features)){jQuery("#mapster-projection-warning").fadeIn();jQuery(document).on("click","#mapster-try-reproject",(()=>{this.tryReprojection(t)}))}e.forEach((e=>{const i=t.features.filter((t=>t.geometry.type===e));let r={};i.forEach((t=>{for(let e in t.properties)r[e]=typeof t.properties[e]}));const n=i.every((t=>this.hasProperties(t,r))),s=i.every((t=>this.hasRightType(t,r)));jQuery("#geojson-import-data-summary table tbody").append(`\n <tr>\n <td>${e}</td>\n <td>${i.length}</td>\n <td><a href="#" data-index="feature-${Math.floor(Math.random()*i.length)}" class="mapster-example-feature-${e}">${window.mapster_settings.strings["Example Feature"]}</a></td>\n <td>${n&&s?`\n <span class="tooltip dashicons dashicons-yes-alt">\n <span class="tooltiptext">${window.mapster_settings.strings["Looks Good"]}</span>\n </span>`:`\n ${n?"":`<span class="tooltip dashicons dashicons-warning">\n <span class="tooltiptext">${window.mapster_settings.strings["Missing Properties"]}</span>\n </span>`}\n ${s?"":`<span class="tooltip dashicons dashicons-warning">\n <span class="tooltiptext">${window.mapster_settings.strings["Inconsistent Data"]}</span>\n </span>`}\n `}\n </td>\n </tr>\n `);jQuery(document).on("click",`.mapster-example-feature-${e}`,(function(){let t=jQuery(this).data("index").replace("feature-","");alert(JSON.stringify(i[t],null,2))}))}))}}advancedOptions(t){}hasProperties(t,e){let i=!0;for(let r in e)t.properties[r]||(i=!1);return i}hasRightType(t,e){let i=!0;for(let r in e)t.properties[r]&&typeof t.properties[r]!==e[r]&&(i=!1);return i}doGeoJSONImportPost(t,e,i,r){jQuery(".mapster-map-loader").show();return fetch(window.mapster_settings.rest_url+"mapster-wp-maps/import-geojson",{headers:{"X-WP-Nonce":window.mapster_settings.nonce,"Content-Type":"application/json"},method:"POST",body:JSON.stringify({file:t,import_json:e,category:i,features_imported:r})}).then((t=>t.json()))}displayAfterImport(t){jQuery(".mapster-map-loader").hide();this.featuresImported=this.featuresImported+t;jQuery(".geojson-import-result span").html(this.featuresImported);jQuery(".geojson-import-result").fadeIn();jQuery(".geojson-import-progress").val(this.featuresImported/this.geojsondocumentToImport.features.length*100);jQuery(".mapster-import-error").html(window.mapster_settings.strings["Seem Wrong"]+this.upgradeMessage)}async glJSgeoJSONUploaded(t){const e=await new Response(t.target.files[0]).json();this.importGLJSGeoJSON(e)}importGLJSGeoJSON(t){t?this.gljsdocumentToImport=t:window.alert(window.mapster_settings.strings["Please Upload"])}doGLJSImport(){let t=this;this.gljsdocumentToImport?fetch(window.mapster_settings.rest_url+"mapster-wp-maps/import-gl-js",{headers:{"X-WP-Nonce":window.mapster_settings.nonce,"Content-Type":"application/json"},method:"POST",body:JSON.stringify({file:t.gljsdocumentToImport,category:jQuery("#gl-js-import-category").val()})}).then((t=>t.json())).then((t=>{jQuery("#gl-js-import-result span").html(t.count);jQuery("#gl-js-import-result").fadeIn()})):window.alert(window.mapster_settings.strings["Please Upload"])}createNewTileset(){}selectExistingTileset(){}updateTileset(){}exportMapster(){}uploadMapster(t){}importMapster(){}verifyCSV(){}doCSVImport(){}init(){let t=this;t.setUpgradeMessage();jQuery(document).on("change","#geojson-import-file",(function(e){t.geoJSONUploaded(e)}));jQuery(document).on("change","#gl-js-import-file",(function(e){t.glJSgeoJSONUploaded(e)}));jQuery(document).on("change","#geojson-import-category",(function(e){t.currentImportCategory=jQuery("#geojson-import-category").val()}));jQuery(document).on("change","#csv-import-category",(function(e){t.currentImportCategory=jQuery("#csv-import-category").val()}));jQuery(document).on("click","#geojson-import-button",(function(){t.doGeoJSONImport()}));jQuery(document).on("click","#gl-js-import-button",(function(){t.doGLJSImport()}));jQuery(document).on("click","#export-mapster-installation",(function(){t.exportMapster()}));jQuery(document).on("change","#upload-mapster-installation",(function(e){t.uploadMapster(e)}));jQuery(document).on("click","#import-mapster-installation",(function(){t.importMapster()}));jQuery(document).on("click","#existing-tileset-source",(function(){t.selectExistingTileset()}));jQuery(document).on("click","#new-tileset-source",(function(){t.createNewTileset()}));jQuery(document).on("click","#update-tileset-source-button",(function(){t.updateTileset()}));jQuery(document).on("click","#mapster-csv-verify",(function(){t.verifyCSV()}));jQuery(document).on("click","#mapster-csv-import",(function(){t.doCSVImport()}));jQuery(document).on("click",".nav-tab",(function(){jQuery(this).siblings().each((function(){jQuery(this).removeClass("nav-tab-active")}));jQuery(this).addClass("nav-tab-active");jQuery(this).parent().siblings().each((function(){jQuery(this).hasClass("nav-box")&&jQuery(this).removeClass("nav-box-active")}));jQuery("#"+jQuery(this).attr("id")+"-options").addClass("nav-box-active")}))}}