geotiff
Version:
GeoTIFF image decoding in JavaScript
1 lines • 212 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GeoTIFF=t():e.GeoTIFF=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=62)}([function(e,t,n){var r=n(39)("wks"),i=n(24),o=n(1).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(116),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){var r=n(13);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(5),i=n(48),o=n(36),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(21)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(6),i=n(22);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(69),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(31),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){var r=n(1),i=n(2),o=n(16),a=n(8),s=function(e,t,n){var u,f,c,l=e&s.F,h=e&s.G,d=e&s.S,p=e&s.P,v=e&s.B,m=e&s.W,y=h?i:i[t]||(i[t]={}),b=y.prototype,g=h?r:d?r[t]:(r[t]||{}).prototype;h&&(n=t);for(u in n)(f=!l&&g&&void 0!==g[u])&&u in y||(c=f?g[u]:n[u],y[u]=h&&"function"!=typeof g[u]?n[u]:v&&f?o(c,r):m&&g[u]==c?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):p&&"function"==typeof c?o(Function.call,c):c,p&&((y.virtual||(y.virtual={}))[u]=c,e&s.R&&b&&!b[u]&&a(b,u,c)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(87),o=r(i),a=n(91),s=r(a),u=n(31),f=r(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,f.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,n){var r=n(34);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(4),s=r(a),u=n(125),f=function(){function e(){(0,o.default)(this,e)}return(0,s.default)(e,[{key:"decode",value:function(e,t){var n=this.decodeBlock(t),r=e.Predictor||1;if(1!==r){var i=!e.StripOffsets,o=i?e.TileWidth:e.ImageWidth,a=i?e.TileLength:e.RowsPerStrip;return(0,u.applyPredictor)(n,r,o,a,e.BitsPerSample)}return n}}]),e}();t.default=f},function(e,t,n){"use strict";var r=n(66)(!0);n(47)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(50),i=n(40);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(6).f,i=n(9),o=n(0)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){n(74);for(var r=n(1),i=n(8),o=n(14),a=n(0)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=s[u],c=r[f],l=c&&c.prototype;l&&!l[a]&&i(l,a,f),o[f]=o.Array}},function(e,t,n){e.exports=n(94)},function(e,t,n){"use strict";t.__esModule=!0;var r=n(103),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){return function(){var t=e.apply(this,arguments);return new i.default(function(e,n){function r(o,a){try{var s=t[o](a),u=s.value}catch(e){return void n(e)}if(!s.done)return i.default.resolve(u).then(function(e){r("next",e)},function(e){r("throw",e)});e(u)}return r("next")})}}},function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(n,n+r),i);for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(r)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(64),o=r(i),a=n(77),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(13),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(5),i=n(68),o=n(40),a=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(35)("iframe"),r=o.length;for(t.style.display="none",n(52).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(39)("keys"),i=n(24);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(1),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){t.f=n(0)},function(e,t,n){var r=n(1),i=n(2),o=n(20),a=n(41),s=n(6).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(97),o=r(i),a=n(100),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(17),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){"use strict";var r=n(20),i=n(12),o=n(49),a=n(8),s=n(9),u=n(14),f=n(67),c=n(25),l=n(72),h=n(0)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,v,m,y,b){f(n,t,v);var g,w,_,x=function(e){if(!d&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",E="values"==m,S=!1,O=e.prototype,T=O[h]||O["@@iterator"]||m&&O[m],A=T||x(m),P=m?E?x("entries"):A:void 0,N="Array"==t?O.entries||T:T;if(N&&(_=l(N.call(new e)))!==Object.prototype&&(c(_,k,!0),r||s(_,h)||a(_,h,p)),E&&T&&"values"!==T.name&&(S=!0,A=function(){return T.call(this)}),r&&!b||!d&&!S&&O[h]||a(O,h,A),u[t]=A,u[k]=p,m)if(g={values:E?A:x("values"),keys:y?A:x("keys"),entries:P},b)for(w in g)w in O||o(O,w,g[w]);else i(i.P+i.F*(d||S),t,g);return g}},function(e,t,n){e.exports=!n(7)&&!n(21)(function(){return 7!=Object.defineProperty(n(35)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){e.exports=n(8)},function(e,t,n){var r=n(9),i=n(10),o=n(70)(!1),a=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,f=[];for(n in s)n!=a&&r(s,n)&&f.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(f,n)||f.push(n));return f}},function(e,t,n){var r=n(32),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){e.exports=n(1).document&&document.documentElement},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(50),i=n(40).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(43),i=n(22),o=n(10),a=n(36),s=n(9),u=n(48),f=Object.getOwnPropertyDescriptor;t.f=n(7)?f:function(e,t){if(e=o(e),t=a(t,!0),u)try{return f(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){var r=n(46),i=n(0)("iterator"),o=n(14);e.exports=n(2).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r,i,o,a=n(16),s=n(111),u=n(52),f=n(35),c=n(1),l=c.process,h=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,v=0,m={},y=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},b=function(e){y.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return m[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete m[e]},"process"==n(17)(l)?r=function(e){l.nextTick(a(y,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r="onreadystatechange"in f("script")?function(e){u.appendChild(f("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.fieldTagNames={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams"},i=t.fieldTags={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=parseInt(o,10));var a=(t.arrayFields=[i.BitsPerSample,i.ExtraSamples,i.SampleFormat,i.StripByteCounts,i.StripOffsets,i.StripRowCounts,i.TileByteCounts,i.TileOffsets],t.fieldTypeNames={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",16:"LONG8",17:"SLONG8",18:"IFD8"}),s=t.fieldTypes={};for(var u in a)a.hasOwnProperty(u)&&(s[a[u]]=parseInt(u,10));var f=(t.photometricInterpretations={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},t.geoKeyNames={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"}),c=t.geoKeys={};for(var l in f)f.hasOwnProperty(l)&&(c[f[l]]=parseInt(l,10));t.parseXml=void 0;"undefined"==typeof window?t.parseXml=function(e){return(new(0,n(119).DOMParser)).parseFromString(e,"text/xml")}:void 0!==window.DOMParser?t.parseXml=function(e){return(new window.DOMParser).parseFromString(e,"text/xml")}:void 0!==window.ActiveXObject&&new window.ActiveXObject("Microsoft.XMLDOM")&&(t.parseXml=function(e){var t=new window.ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t})},function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t){function n(){}var i=e.prototype;if(Object.create){var o=Object.create(t.prototype);i.__proto__=o}i instanceof t||(n.prototype=t.prototype,n=new n,r(i,n),e.prototype=i=n),i.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),i.constructor=e)}function o(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,re[e]),this.message=re[e],Error.captureStackTrace&&Error.captureStackTrace(this,o);return n.code=e,t&&(this.message=this.message+": "+t),n}function a(){}function s(e,t){this._node=e,this._refresh=t,u(this)}function u(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);B(e,"length",n.length),r(n,e),e._inc=t}}function f(){}function c(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,r){if(r?t[c(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&g(i,e,r),b(i,e,n))}}function h(e,t,n){var r=c(t,n);if(!(r>=0))throw o(ie,new Error);for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(g(a,e,n),n.ownerElement=null)}}function d(e){if(this._features={},e)for(var t in e)this._features=e[t]}function p(){}function v(e){return"<"==e&&"<"||">"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function m(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(m(e,t))return!0}while(e=e.nextSibling)}function y(){}function b(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function g(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function w(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function _(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,w(e.ownerDocument,e),t}function x(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===ee){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,null==n?e.lastChild=o:n.previousSibling=o;do{i.parentNode=e}while(i!==o&&(i=i.nextSibling));return w(e.ownerDocument||e,e),t.nodeType==ee&&(t.firstChild=t.lastChild=null),t}function k(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,w(e.ownerDocument,e,t),t}function E(){this._nsMap={}}function S(){}function O(){}function T(){}function A(){}function P(){}function N(){}function I(){}function M(){}function C(){}function D(){}function j(){}function R(){}function F(e,t,n,r){switch(e.nodeType){case K:var i=e.attributes,o=i.length,a=e.firstChild,s=e.tagName;r=Z===e.namespaceURI||r,t.push("<",s),n&&t.sort.apply(i,n);for(var u=0;u<o;u++)F(i.item(u),t,n,r);if(a||r&&!/^(?:meta|link|img|br|hr|input|button)$/i.test(s)){if(t.push(">"),r&&/^script$/i.test(s))a&&t.push(a.data);else for(;a;)F(a,t,n,r),a=a.nextSibling;t.push("</",s,">")}else t.push("/>");return;case J:case ee:for(var a=e.firstChild;a;)F(a,t,n,r),a=a.nextSibling;return;case H:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,v),'"');case q:return t.push(e.data.replace(/[<&]/g,v));case W:return t.push("<![CDATA[",e.data,"]]>");case $:return t.push("\x3c!--",e.data,"--\x3e");case Q:var f=e.publicId,c=e.systemId;if(t.push("<!DOCTYPE ",e.name),f)t.push(' PUBLIC "',f),c&&"."!=c&&t.push('" "',c),t.push('">');else if(c&&"."!=c)t.push(' SYSTEM "',c,'">');else{var l=e.internalSubset;l&&t.push(" [",l,"]"),t.push(">")}return;case X:return t.push("<?",e.target," ",e.data,"?>");case V:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function U(e,t,n){var r;switch(t.nodeType){case K:r=t.cloneNode(!1),r.ownerDocument=e;case ee:break;case H:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(U(e,i,n)),i=i.nextSibling;return r}function L(e,t,n){var r=new t.constructor;for(var i in t){var o=t[i];"object"!=typeof o&&o!=r[i]&&(r[i]=o)}switch(t.childNodes&&(r.childNodes=new a),r.ownerDocument=e,r.nodeType){case K:var s=t.attributes,u=r.attributes=new f,c=s.length;u._ownerElement=r;for(var l=0;l<c;l++)r.setAttributeNode(L(e,s.item(l),!0));break;case H:n=!0}if(n)for(var h=t.firstChild;h;)r.appendChild(L(e,h,n)),h=h.nextSibling;return r}function B(e,t,n){e[t]=n}function G(e){switch(e.nodeType){case 1:case 11:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(G(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}var Z="http://www.w3.org/1999/xhtml",z={},K=z.ELEMENT_NODE=1,H=z.ATTRIBUTE_NODE=2,q=z.TEXT_NODE=3,W=z.CDATA_SECTION_NODE=4,V=z.ENTITY_REFERENCE_NODE=5,Y=z.ENTITY_NODE=6,X=z.PROCESSING_INSTRUCTION_NODE=7,$=z.COMMENT_NODE=8,J=z.DOCUMENT_NODE=9,Q=z.DOCUMENT_TYPE_NODE=10,ee=z.DOCUMENT_FRAGMENT_NODE=11,te=z.NOTATION_NODE=12,ne={},re={},ie=(ne.INDEX_SIZE_ERR=(re[1]="Index size error",1),ne.DOMSTRING_SIZE_ERR=(re[2]="DOMString size error",2),ne.HIERARCHY_REQUEST_ERR=(re[3]="Hierarchy request error",3),ne.WRONG_DOCUMENT_ERR=(re[4]="Wrong document",4),ne.INVALID_CHARACTER_ERR=(re[5]="Invalid character",5),ne.NO_DATA_ALLOWED_ERR=(re[6]="No data allowed",6),ne.NO_MODIFICATION_ALLOWED_ERR=(re[7]="No modification allowed",7),ne.NOT_FOUND_ERR=(re[8]="Not found",8)),oe=(ne.NOT_SUPPORTED_ERR=(re[9]="Not supported",9),ne.INUSE_ATTRIBUTE_ERR=(re[10]="Attribute in use",10));ne.INVALID_STATE_ERR=(re[11]="Invalid state",11),ne.SYNTAX_ERR=(re[12]="Syntax error",12),ne.INVALID_MODIFICATION_ERR=(re[13]="Invalid modification",13),ne.NAMESPACE_ERR=(re[14]="Invalid namespace",14),ne.INVALID_ACCESS_ERR=(re[15]="Invalid access",15);o.prototype=Error.prototype,r(ne,o),a.prototype={length:0,item:function(e){return this[e]||null},toString:function(){for(var e=[],t=0;t<this.length;t++)F(this[t],e);return e.join("")}},s.prototype.item=function(e){return u(this),this[e]},i(s,a),f.prototype={length:0,item:a.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new o(oe);var n=this.getNamedItem(e.nodeName);return l(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new o(oe);return t=this.getNamedItemNS(e.namespaceURI,e.localName),l(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return h(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return h(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},d.prototype={hasFeature:function(e,t){var n=this._features[e.toLowerCase()];return!(!n||t&&!(t in n))},createDocument:function(e,t,n){var r=new y;if(r.implementation=this,r.childNodes=new a,r.doctype=n,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new N;return r.name=e,r.nodeName=e,r.publicId=t,r.systemId=n,r}},p.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return x(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return _(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return L(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==q&&e.nodeType==q?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},r(z,p),r(z,p.prototype),y.prototype={nodeName:"#document",nodeType:J,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==ee){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&1==e.nodeType&&(this.documentElement=e),x(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),_(this,e)},importNode:function(e,t){return U(this,e,t)},getElementById:function(e){var t=null;return m(this.documentElement,function(n){if(1==n.nodeType&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new E;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new a,(t.attributes=new f)._ownerElement=t,t},createDocumentFragment:function(){var e=new D;return e.ownerDocument=this,e.childNodes=new a,e},createTextNode:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new P;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new j;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new S;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new C;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new E,r=t.split(":"),i=n.attributes=new f;return n.childNodes=new a,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new S,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},i(y,p),E.prototype={nodeType:K,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===ee?this.insertBefore(e,null):k(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s(this,function(t){var n=[];return m(t,function(r){r===t||r.nodeType!=K||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new s(this,function(n){var r=[];return m(n,function(i){i===n||i.nodeType!==K||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}},y.prototype.getElementsByTagName=E.prototype.getElementsByTagName,y.prototype.getElementsByTagNameNS=E.prototype.getElementsByTagNameNS,i(E,p),S.prototype.nodeType=H,i(S,p),O.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(re[3])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},i(O,p),T.prototype={nodeName:"#text",nodeType:q,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},i(T,O),A.prototype={nodeName:"#comment",nodeType:$},i(A,O),P.prototype={nodeName:"#cdata-section",nodeType:W},i(P,O),N.prototype.nodeType=Q,i(N,p),I.prototype.nodeType=te,i(I,p),M.prototype.nodeType=Y,i(M,p),C.prototype.nodeType=V,i(C,p),D.prototype.nodeName="#document-fragment",D.prototype.nodeType=ee,i(D,p),j.prototype.nodeType=X,i(j,p),R.prototype.serializeToString=function(e,t){return e.toString(t)},p.prototype.toString=function(e){var t=[];return F(this,t,e),t.join("")};try{Object.defineProperty&&(Object.defineProperty(s.prototype,"length",{get:function(){return u(this),this.$$length}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return G(this)},set:function(e){switch(this.nodeType){case 1:case 11:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=value,this.nodeValue=e}}}),B=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=d,t.XMLSerializer=R},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&f.isObject(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function o(e){return f.isString(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}var u=n(146),f=n(148);t.parse=i,t.resolve=a,t.resolveObject=s,t.format=o,t.Url=r;var c=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),v=["'"].concat(p),m=["%","/","?",";","#"].concat(v),y=["/","?","#"],b=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=n(149);r.prototype.parse=function(e,t,n){if(!f.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",o=e.split(i),a=/\\/g;o[0]=o[0].replace(a,"/"),e=o.join(i);var s=e;if(s=s.trim(),!n&&1===e.split("#").length){var l=h.exec(s);if(l)return this.path=s,this.href=s,this.pathname=l[1],l[2]?(this.search=l[2],this.query=t?k.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var d=c.exec(s);if(d){d=d[0];var p=d.toLowerCase();this.protocol=p,s=s.substr(d.length)}if(n||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===s.substr(0,2);!E||d&&_[d]||(s=s.substr(2),this.slashes=!0)}if(!_[d]&&(E||d&&!x[d])){for(var S=-1,O=0;O<y.length;O++){var T=s.indexOf(y[O]);-1!==T&&(-1===S||T<S)&&(S=T)}var A,P;P=-1===S?s.lastIndexOf("@"):s.lastIndexOf("@",S),-1!==P&&(A=s.slice(0,P),s=s.slice(P+1),this.auth=decodeURIComponent(A)),S=-1;for(var O=0;O<m.length;O++){var T=s.indexOf(m[O]);-1!==T&&(-1===S||T<S)&&(S=T)}-1===S&&(S=s.length),this.host=s.slice(0,S),s=s.slice(S),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var I=this.hostname.split(/\./),O=0,M=I.length;O<M;O++){var C=I[O];if(C&&!C.match(b)){for(var D="",j=0,R=C.length;j<R;j++)C.charCodeAt(j)>127?D+="x":D+=C[j];if(!D.match(b)){var F=I.slice(0,O),U=I.slice(O+1),L=C.match(g);L&&(F.push(L[1]),U.unshift(L[2])),U.length&&(s="/"+U.join(".")+s),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=u.toASCII(this.hostname));var B=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+B,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!w[p])for(var O=0,M=v.length;O<M;O++){var Z=v[O];if(-1!==s.indexOf(Z)){var z=encodeURIComponent(Z);z===Z&&(z=escape(Z)),s=s.split(Z).join(z)}}var K=s.indexOf("#");-1!==K&&(this.hash=s.substr(K),s=s.slice(0,K));var H=s.indexOf("?");if(-1!==H?(this.search=s.substr(H),this.query=s.substr(H+1),t&&(this.query=k.parse(this.query)),s=s.slice(0,H)):t&&(this.search="",this.query={}),s&&(this.pathname=s),x[p]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var B=this.pathname||"",q=this.search||"";this.path=B+q}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&f.isObject(this.query)&&Object.keys(this.query).length&&(o=k.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||x[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+n+a+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(f.isString(e)){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return x[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!x[e.protocol]){for(var l=Object.keys(e),h=0;h<l.length;h++){var d=l[h];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||_[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var v=n.pathname||"",m=n.search||"";n.path=v+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),g=b||y||n.host&&e.pathname,w=g,k=n.pathname&&n.pathname.split("/")||[],p=e.pathname&&e.pathname.split("/")||[],E=n.protocol&&!x[n.protocol];if(E&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),g=g&&(""===p[0]||""===k[0])),b)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),n.search=e.search,n.query=e.query;else if(!f.isNullOrUndefined(e.search)){if(E){n.hostname=n.host=k.shift();var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return n.search=e.search,n.query=e.query,f.isNull(n.pathname)&&f.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=k.slice(-1)[0],T=(n.host||e.host||k.length>1)&&("."===O||".."===O)||""===O,A=0,P=k.length;P>=0;P--)O=k[P],"."===O?k.splice(P,1):".."===O?(k.splice(P,1),A++):A&&(k.splice(P,1),A--);if(!g&&!w)for(;A--;A)k.unshift("..");!g||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),T&&"/"!==k.join("/").substr(-1)&&k.push("");var N=""===k[0]||k[0]&&"/"===k[0].charAt(0);if(E){n.hostname=n.host=N?"":k.length?k.shift():"";var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return g=g||n.host&&k.length,g&&!N&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),f.isNull(n.pathname)&&f.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(63);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){switch(e){case _.fieldTypes.BYTE:case _.fieldTypes.ASCII:case _.fieldTypes.SBYTE:case _.fieldTypes.UNDEFINED:return 1;case _.fieldTypes.SHORT:case _.fieldTypes.SSHORT:return 2;case _.fieldTypes.LONG:case _.fieldTypes.SLONG:case _.fieldTypes.FLOAT:return 4;case _.fieldTypes.RATIONAL:case _.fieldTypes.SRATIONAL:case _.fieldTypes.DOUBLE:case _.fieldTypes.LONG8:case _.fieldTypes.SLONG8:case _.fieldTypes.IFD8:return 8;default:throw new RangeError("Invalid field type: "+e)}}function o(e){var t=e.GeoKeyDirectory;if(!t)return null;for(var n={},r=4;r<=4*t[3];r+=4){var i=_.geoKeyNames[t[r]],o=t[r+1]?_.fieldTagNames[t[r+1]]:null,a=t[r+2],s=t[r+3],u=null;if(o){if(void 0===(u=e[o])||null===u)throw new Error("Could not get value of geoKey '"+i+"'.");"string"==typeof u?u=u.substring(s,s+a-1):u.subarray&&(u=u.subarray(s,s+a-1))}else u=s;n[i]=u}return n}function a(e,t,n,r){var o=null,a=null,s=i(t);switch(t){case _.fieldTypes.BYTE:case _.fieldTypes.ASCII:case _.fieldTypes.UNDEFINED:o=new Uint8Array(n),a=e.readUint8;break;case _.fieldTypes.SBYTE:o=new Int8Array(n),a=e.readInt8;break;case _.fieldTypes.SHORT:o=new Uint16Array(n),a=e.readUint16;break;case _.fieldTypes.SSHORT:o=new Int16Array(n),a=e.readInt16;break;case _.fieldTypes.LONG:o=new Uint32Array(n),a=e.readUint32;break;case _.fieldTypes.SLONG:o=new Int32Array(n),a=e.readInt32;break;case _.fieldTypes.LONG8:case _.fieldTypes.IFD8:o=new Array(n),a=e.readUint64;break;case _.fieldTypes.SLONG8:o=new Array(n),a=e.readInt64;break;case _.fieldTypes.RATIONAL:o=new Uint32Array(2*n),a=e.readUint32;break;case _.fieldTypes.SRATIONAL:o=new Int32Array(2*n),a=e.readInt32;break;case _.fieldTypes.FLOAT:o=new Float32Array(n),a=e.readFloat32;break;case _.fieldTypes.DOUBLE:o=new Float64Array(n),a=e.readFloat64;break;default:throw new RangeError("Invalid field type: "+t)}if(t!==_.fieldTypes.RATIONAL&&t!==_.fieldTypes.SRATIONAL)for(var u=0;u<n;++u)o[u]=a.call(e,r+u*s);else for(var f=0;f<n;f+=2)o[f]=a.call(e,r+f*s),o[f+1]=a.call(e,r+(f*s+4));return t===_.fieldTypes.ASCII?String.fromCharCode.apply(null,o):o}Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.fromUrls=t.fromBlob=t.fromFile=t.fromArrayBuffer=t.fromUrl=t.MultiGeoTIFF=t.GeoTIFF=void 0;var s=n(11),u=r(s),f=n(15),c=r(f),l=n(27),h=r(l),d=n(45),p=r(d),v=n(28),m=r(v),y=n(3),b=r(y),g=n(4),w=r(g),_=(t.fromUrl=function(){var e=(0,m.default)(h.default.mark(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.fromSource((0,A.makeRemoteSource)(t,n)));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.fromArrayBuffer=function(){var e=(0,m.default)(h.default.mark(function e(t){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.fromSource((0,A.makeBufferSource)(t)));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.fromFile=function(){var e=(0,m.default)(h.default.mark(function e(t){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.fromSource((0,A.makeFileSource)(t)));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.fromBlob=function(){var e=(0,m.default)(h.default.mark(function e(t){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.fromSource((0,A.makeFileReaderSource)(t)));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.fromUrls=function(){var e=(0,m.default)(h.default.mark(function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.fromSource((0,A.makeRemoteSource)(t,o));case 2:return n=e.sent,e.next=5,Promise.all(i.map(function(e){return M.fromSource((0,A.makeRemoteSource)(e,o))}));case 5:return r=e.sent,e.abrupt("return",new C(n,r));case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),n(59)),x=n(121),k=r(x),E=n(142),S=r(E),O=n(143),T=r(O),A=n(144),P=n(152),N=r(P),I=function(){function e(){(0,b.default)(this,e)}return(0,w.default)(e,[{key:"readRasters",value:function(){function e(){return t.apply(this,arguments)}var t=(0,m.default)(h.default.mark(function e(){var t,n,r,i,o,a,s,u,f,c,l,d,v,m,y,b,g,w,_,x,k,E,S,O,T,A,P,N,I,M,C,D,j,R,F,U,L,B,G=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=G.window,n=G.width,r=G.height,i=G.resX,o=G.resY,a=G.bbox,e.next=4,this.getImage();case 4:return s=e.sent,u=s,e.next=8,this.getImageCount();case 8:if(f=e.sent,c=s.getBoundingBox(),!t||!a){e.next=12;break}throw new Error('Both "bbox" and "window" passed.');case 12:if(!n&&!r){e.next=23;break}if(t&&(l=s.getOrigin(),d=(0,p.default)(l,2),v=d[0],m=d[1],y=s.getResolution(),b=(0,p.default)(y,2),g=b[0],w=b[1],a=[v+t[0]*g,m+t[1]*w,v+t[2]*g,m+t[3]*w]),_=a||c,!n){e.next=19;break}if(!i){e.next=18;break}throw new Error("Both width and resX passed");case 18:i=(_[2]-_[0])/n;case 19:if(!r){e.next=23;break}if(!o){e.next=22;break}throw new Error("Both width and resY passed");case 22:o=(_[3]-_[1])/r;case 23:if(!i&&!o){e.next=47;break}x=[],k=0;case 26:if(!(k<f)){e.next=35;break}return e.next=29,this.getImage(k);case 29:E=e.sent,S=E.fileDirectory,O=S.SubfileType,T=S.NewSubfileType,(0===k||2===O||1&T)&&x.push(E);case 32:++k,e.next=26;break;case 35:x.sort(function(e,t){return e.getWidth()-t.getWidth()}),A=0;case 37:if(!(A<x.length)){e.next=47;break}if(P=x[A],N=(c[2]-c[0])/P.getWidth(),I=(c[3]-c[1])/P.getHeight(),u=P,!(i&&i>N||o&&o>I)){e.next=44;break}return e.abrupt("break",47);case 44:++A,e.next=37;break;case 47:return M=t,a&&(C=s.getOrigin(),D=(0,p.default)(C,2),j=D[0],R=D[1],F=u.getResolution(s),U=(0,p.default)(F,2),L=U[0],B=U[1],M=[Math.round((a[0]-j)/L),Math.round((a[1]-R)/B),Math.round((a[2]-j)/L),Math.round((a[3]-R)/B)],M=[Math.min(M[0],M[2]),Math.min(M[1],M[3]),Math.max(M[0],M[2]),Math.max(M[1],M[3])]),e.abrupt("return",u.readRasters(Object.assign({},G,{window:M})));case 50:case"end":return e.stop()}},e,this)}));return e}()}]),e}(),M=function(e){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,b.default)(this,t);var a=(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.source=e,a.littleEndian=n,a.bigTiff=r,a.firstIFDOffset=i,a.cache=o.cache||!1,a.fileDirectories=null,a.fileDirectoriesParsing=null,a}return(0,c.default)(t,e),(0,w.default)(t,[{key:"getSlice",value:function(){function e(e,n){return t.apply(this,arguments)}var t=(0,m.default)(h.default.mark(function e(t,n){var r;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.bigTiff?4048:1024,e.t0=T.default,e.next=4,this.source.fetch(t,void 0!==n?n:r);case 4:return e.t1=e.sent,e.t2=t,e.t3=this.littleEndian,e.t4=this.bigTiff,e.abrupt("return",new e.t0(e.t1,e.t2,e.t3,e.t4));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"parseFileDirectories",value:function(){function e(){return t.apply(this,arguments)}var t=(0,m.default)(h.default.mark(function e(){var t,n,r,s,u,f,c,l,d,p,v,m,y,b,g,w,x,k,E,S;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.firstIFDOffset,n=this.bigTiff?8:2,r=this.bigTiff?20:12,s=[];case 4:if(0===t){e.next=48;break}return e.next=7,this.getSlice(t);case 7:if(u=e.sent,f=this.bigTiff?u.readUint64(t):u.readUint16(t),c=f*r+(this.bigTiff?16:6),u.covers(t,c)){e.next=14;break}return e.next=13,this.getSlice(t,c);case 13:u=e.sent;case 14:l={},d=t+(this.bigTiff?8:2),p=0;case 17:if(!(p<f)){e.next=44;break}if(v=u.readUint16(d),m=u.readUint16(d+2),y=this.bigTiff?u.readUint64(d+4):u.readUint32(d+4),b=void 0,g=void 0,w=i(m),x=d+(this.bigTiff?12:8),!(w*y<=(this.bigTiff?8:4))){e.next=29;break}b=a(u,m,y,x),e.next=39;break;case 29:if(k=u.readOffset(x),E=i(m)*y,!u.covers(k,E)){e.next=35;break}b=a(u,m,y,k),e.next=39;break;case 35:return e.next=37,this.getSlice(k,E);case 37:S=e.sent,b=a(S,m,y,k);case 39:g=1===y&&-1===_.arrayFields.indexOf(v)&&m!==_.fieldTypes.RATIONAL&&m!==_.fieldTypes.SRATIONAL?b[0]:b,l[_.fieldTagNames[v]]=g;case 41:d+=r,++p,e.next=17;break;case 44:s.push([l,o(l)]),t=u.readOffset(t+n+r*f),e.next=4;break;case 48:return e.abrupt("return",s);case 49:case"end":return e.stop()}},e,this)}));return e}()},{key:"getImage",value:function(){function e(){return t.apply(this,arguments)}var t=(0,m.default)(h.default.mark(function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.fileDirectories){e.next=5;break}return this.fileDirectoriesParsing||(this.fileDirectoriesParsing=this.parseFileDirectories()),e.next=4,this.fileDirectoriesParsing;case 4:this.fileDirectories=e.sent;case 5:if(t=this.fileDirectories[n]){e.next=8;break}throw new RangeError("Invalid image index");case 8:return e.abrupt("return",new k.default(t[0],t[1],this.dataView,this.littleEndian,this.cache,this.source));case 9:case"end":return e.stop()}},e,this)}));return e}()},{key:"getImageCount",value:function(){function e(){return t.apply(this,arguments)}var t=(0,m.default)(h.default.mark(function e(){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.fileDirectories){e.next=5;break}return this.fileDirectoriesParsing||(this.fileDirectoriesParsing=this.parseFileDirectories()),e.next=4,this.fileDi