@loaders.gl/geotiff 4.0.0-alpha.4 → 4.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/bundle.d.ts +2 -0
  2. package/dist/bundle.d.ts.map +1 -0
  3. package/dist/bundle.js +28 -2
  4. package/dist/es5/bundle.js +9 -0
  5. package/dist/es5/bundle.js.map +1 -0
  6. package/dist/es5/index.js +21 -0
  7. package/dist/es5/index.js.map +1 -0
  8. package/dist/es5/lib/load-geotiff.js +76 -0
  9. package/dist/es5/lib/load-geotiff.js.map +1 -0
  10. package/dist/es5/lib/ome/load-ome-tiff.js +66 -0
  11. package/dist/es5/lib/ome/load-ome-tiff.js.map +1 -0
  12. package/dist/es5/lib/ome/ome-indexers.js +140 -0
  13. package/dist/es5/lib/ome/ome-indexers.js.map +1 -0
  14. package/dist/es5/lib/ome/ome-utils.js +74 -0
  15. package/dist/es5/lib/ome/ome-utils.js.map +1 -0
  16. package/dist/es5/lib/ome/omexml.js +68 -0
  17. package/dist/es5/lib/ome/omexml.js.map +1 -0
  18. package/dist/es5/lib/ome/utils.js +26 -0
  19. package/dist/es5/lib/ome/utils.js.map +1 -0
  20. package/dist/es5/lib/tiff-pixel-source.js +163 -0
  21. package/dist/es5/lib/tiff-pixel-source.js.map +1 -0
  22. package/dist/es5/lib/utils/Pool.js +136 -0
  23. package/dist/es5/lib/utils/Pool.js.map +1 -0
  24. package/dist/es5/lib/utils/proxies.js +65 -0
  25. package/dist/es5/lib/utils/proxies.js.map +1 -0
  26. package/dist/es5/lib/utils/tiff-utils.js +43 -0
  27. package/dist/es5/lib/utils/tiff-utils.js.map +1 -0
  28. package/dist/es5/types.js +2 -0
  29. package/dist/es5/types.js.map +1 -0
  30. package/dist/es5/typings/geotiff.js +2 -0
  31. package/dist/es5/typings/geotiff.js.map +1 -0
  32. package/dist/esm/bundle.js +4 -0
  33. package/dist/esm/bundle.js.map +1 -0
  34. package/dist/esm/index.js +3 -0
  35. package/dist/esm/index.js.map +1 -0
  36. package/dist/esm/lib/load-geotiff.js +28 -0
  37. package/dist/esm/lib/load-geotiff.js.map +1 -0
  38. package/dist/esm/lib/ome/load-ome-tiff.js +47 -0
  39. package/dist/esm/lib/ome/load-ome-tiff.js.map +1 -0
  40. package/dist/esm/lib/ome/ome-indexers.js +120 -0
  41. package/dist/esm/lib/ome/ome-indexers.js.map +1 -0
  42. package/dist/esm/lib/ome/ome-utils.js +66 -0
  43. package/dist/esm/lib/ome/ome-utils.js.map +1 -0
  44. package/dist/esm/lib/ome/omexml.js +64 -0
  45. package/dist/esm/lib/ome/omexml.js.map +1 -0
  46. package/dist/esm/lib/ome/utils.js +17 -0
  47. package/dist/esm/lib/ome/utils.js.map +1 -0
  48. package/dist/esm/lib/tiff-pixel-source.js +92 -0
  49. package/dist/esm/lib/tiff-pixel-source.js.map +1 -0
  50. package/dist/esm/lib/utils/Pool.js +61 -0
  51. package/dist/esm/lib/utils/Pool.js.map +1 -0
  52. package/dist/esm/lib/utils/decoder.worker.ts.disabled +21 -0
  53. package/dist/esm/lib/utils/proxies.js +54 -0
  54. package/dist/esm/lib/utils/proxies.js.map +1 -0
  55. package/dist/esm/lib/utils/tiff-utils.js +27 -0
  56. package/dist/esm/lib/utils/tiff-utils.js.map +1 -0
  57. package/dist/esm/types.js +2 -0
  58. package/dist/esm/types.js.map +1 -0
  59. package/dist/esm/typings/geotiff.js +2 -0
  60. package/dist/esm/typings/geotiff.js.map +1 -0
  61. package/dist/index.d.ts +3 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +10 -3
  64. package/dist/lib/load-geotiff.d.ts +28 -0
  65. package/dist/lib/load-geotiff.d.ts.map +1 -0
  66. package/dist/lib/load-geotiff.js +56 -31
  67. package/dist/lib/ome/load-ome-tiff.d.ts +50 -0
  68. package/dist/lib/ome/load-ome-tiff.d.ts.map +1 -0
  69. package/dist/lib/ome/load-ome-tiff.js +45 -50
  70. package/dist/lib/ome/ome-indexers.d.ts +11 -0
  71. package/dist/lib/ome/ome-indexers.d.ts.map +1 -0
  72. package/dist/lib/ome/ome-indexers.js +104 -112
  73. package/dist/lib/ome/ome-utils.d.ts +28 -0
  74. package/dist/lib/ome/ome-utils.d.ts.map +1 -0
  75. package/dist/lib/ome/ome-utils.js +59 -69
  76. package/dist/lib/ome/omexml.d.ts +49 -0
  77. package/dist/lib/ome/omexml.d.ts.map +1 -0
  78. package/dist/lib/ome/omexml.js +60 -60
  79. package/dist/lib/ome/utils.d.ts +5 -0
  80. package/dist/lib/ome/utils.d.ts.map +1 -0
  81. package/dist/lib/ome/utils.js +27 -18
  82. package/dist/lib/tiff-pixel-source.d.ts +18 -0
  83. package/dist/lib/tiff-pixel-source.d.ts.map +1 -0
  84. package/dist/lib/tiff-pixel-source.js +59 -106
  85. package/dist/lib/utils/Pool.d.ts +29 -0
  86. package/dist/lib/utils/Pool.d.ts.map +1 -0
  87. package/dist/lib/utils/Pool.js +78 -72
  88. package/dist/lib/utils/proxies.d.ts +6 -0
  89. package/dist/lib/utils/proxies.d.ts.map +1 -0
  90. package/dist/lib/utils/proxies.js +79 -56
  91. package/dist/lib/utils/tiff-utils.d.ts +10 -0
  92. package/dist/lib/utils/tiff-utils.d.ts.map +1 -0
  93. package/dist/lib/utils/tiff-utils.js +40 -24
  94. package/dist/types.d.ts +47 -0
  95. package/dist/types.d.ts.map +1 -0
  96. package/dist/types.js +2 -2
  97. package/dist/typings/geotiff.d.ts +60 -0
  98. package/dist/typings/geotiff.d.ts.map +1 -0
  99. package/dist/typings/geotiff.js +1 -2
  100. package/package.json +7 -7
  101. package/dist/bundle.js.map +0 -1
  102. package/dist/dist.min.js +0 -13
  103. package/dist/dist.min.js.map +0 -1
  104. package/dist/index.js.map +0 -1
  105. package/dist/lib/load-geotiff.js.map +0 -1
  106. package/dist/lib/ome/load-ome-tiff.js.map +0 -1
  107. package/dist/lib/ome/ome-indexers.js.map +0 -1
  108. package/dist/lib/ome/ome-utils.js.map +0 -1
  109. package/dist/lib/ome/omexml.js.map +0 -1
  110. package/dist/lib/ome/utils.js.map +0 -1
  111. package/dist/lib/tiff-pixel-source.js.map +0 -1
  112. package/dist/lib/utils/Pool.js.map +0 -1
  113. package/dist/lib/utils/proxies.js.map +0 -1
  114. package/dist/lib/utils/tiff-utils.js.map +0 -1
  115. package/dist/types.js.map +0 -1
  116. package/dist/typings/geotiff.js.map +0 -1
  117. /package/dist/{lib → es5/lib}/utils/decoder.worker.ts.disabled +0 -0
package/dist/dist.min.js DELETED
@@ -1,13 +0,0 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=37)}([function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return s})),r.d(e,"e",(function(){return a}));const n=Symbol("thread.errors"),i=Symbol("thread.events"),o=Symbol("thread.terminate"),s=Symbol("thread.transferable"),a=Symbol("thread.worker")},function(t,e,r){"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e){const n=Object.keys(e),i=n.length;for(let o=0;o<i;o++)t[n[o]]="strict"===r?[e[n[o]]]:e[n[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.buildOptions=function(t,e,r){var n={};if(!t)return e;for(let i=0;i<r.length;i++)void 0!==t[r[i]]?n[r[i]]=t[r[i]]:n[r[i]]=e[r[i]];return n},e.isTagNameInArrayMode=function(t,e,r){return!1!==e&&(e instanceof RegExp?e.test(t):"function"==typeof e?!!e(t,r):"strict"===e)},e.isName=function(t){const e=o.exec(t);return!(null==e)},e.getAllMatches=function(t,e){const r=[];let n=e.exec(t);for(;n;){const i=[],o=n.length;for(let t=0;t<o;t++)i.push(n[t]);r.push(i),n=e.exec(t)}return r},e.nameRegexp=i},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,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)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var l,u=[],h=!1,c=-1;function f(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&d())}function d(){if(!h){var t=a(f);h=!0;for(var e=u.length;e;){for(l=u,u=[];++c<e;)l&&l[c].run();c=-1,e=u.length}l=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||h||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){(function(n){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=r(66)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(2))},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return s}));const n={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:"$$error",message:t.message,name:t.name,stack:t.stack})};let i={deserialize(t){return(e=t)&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker?n.deserialize(t):t;var e},serialize:t=>t instanceof Error?n.serialize(t):t};function o(t){return i.deserialize(t)}function s(t){return i.serialize(t)}},function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,s,a,l;if("string"==typeof e&&function(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be",s=t,a=" argument",(void 0===l||l>s.length)&&(l=s.length),s.substring(l-a.length,l)===a)i="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return i+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=r(19),o=r(24);r(7)(u,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var l=s[a];u.prototype[l]||(u.prototype[l]=o.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,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)}})}).call(this,r(2))},function(t,e,r){"use strict";var n,i;r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),function(t){t.cancel="cancel",t.run="run"}(n||(n={})),function(t){t.error="error",t.init="init",t.result="result",t.running="running",t.uncaughtError="uncaughtError"}(i||(i={}))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";const n=()=>"function"==typeof Symbol,i=t=>n()&&Boolean(Symbol[t]),o=t=>i(t)?Symbol[t]:"@@"+t;i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const s=o("iterator"),a=o("observable"),l=o("species");function u(t,e){const r=t[e];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(t){let e=t.constructor;return void 0!==e&&(e=e[l],null===e&&(e=void 0)),void 0!==e?e:w}function c(t){c.log?c.log(t):setTimeout(()=>{throw t},0)}function f(t){Promise.resolve().then(()=>{try{t()}catch(t){c(t)}})}function d(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if("function"==typeof e)e();else{const t=u(e,"unsubscribe");t&&t.call(e)}}catch(t){c(t)}}function p(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function g(t,e,r){t._state="running";const n=t._observer;try{const i=n?u(n,e):void 0;switch(e){case"next":i&&i.call(n,r);break;case"error":if(p(t),!i)throw r;i.call(n,r);break;case"complete":p(t),i&&i.call(n)}}catch(t){c(t)}"closed"===t._state?d(t):"running"===t._state&&(t._state="ready")}function m(t,e,r){if("closed"!==t._state)return"buffering"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:r})):"ready"!==t._state?(t._state="buffering",t._queue=[{type:e,value:r}],void f(()=>function(t){const e=t._queue;if(e){t._queue=void 0,t._state="ready";for(const r of e)if(g(t,r.type,r.value),"closed"===t._state)break}}(t))):void g(t,e,r)}class b{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";const r=new y(this);try{this._cleanup=e.call(void 0,r)}catch(t){r.error(t)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(p(this),d(this))}}class y{constructor(t){this._subscription=t}get closed(){return"closed"===this._subscription._state}next(t){m(this._subscription,"next",t)}error(t){m(this._subscription,"error",t)}complete(){m(this._subscription,"complete")}}class w{constructor(t){if(!(this instanceof w))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}subscribe(t,e,r){return"object"==typeof t&&null!==t||(t={next:t,error:e,complete:r}),new b(t,this._subscriber)}pipe(t,...e){let r=this;for(const n of[t,...e])r=n(r);return r}tap(t,e,r){const n="object"!=typeof t||null===t?{next:t,error:e,complete:r}:t;return new w(t=>this.subscribe({next(e){n.next&&n.next(e),t.next(e)},error(e){n.error&&n.error(e),t.error(e)},complete(){n.complete&&n.complete(),t.complete()},start(t){n.start&&n.start(t)}}))}forEach(t){return new Promise((e,r)=>{if("function"!=typeof t)return void r(new TypeError(t+" is not a function"));function n(){i.unsubscribe(),e(void 0)}const i=this.subscribe({next(e){try{t(e,n)}catch(t){r(t),i.unsubscribe()}},error(t){r(t)},complete(){e(void 0)}})})}map(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(h(this))(e=>this.subscribe({next(r){let n=r;try{n=t(r)}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}}))}filter(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return new(h(this))(e=>this.subscribe({next(r){try{if(!t(r))return}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}}))}reduce(t,e){if("function"!=typeof t)throw new TypeError(t+" is not a function");const r=h(this),n=arguments.length>1;let i=!1,o=e;return new r(e=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=t(o,r)}catch(t){return e.error(t)}else o=r},error(t){e.error(t)},complete(){if(!i&&!n)return e.error(new TypeError("Cannot reduce an empty sequence"));e.next(o),e.complete()}}))}concat(...t){const e=h(this);return new e(r=>{let n,i=0;return function o(s){n=s.subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){i===t.length?(n=void 0,r.complete()):o(e.from(t[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=h(this);return new e(r=>{const n=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return r.error(t)}else s=i;const a=e.from(s).subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){const t=n.indexOf(a);t>=0&&n.splice(t,1),o()}});n.push(a)},error(t){r.error(t)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(t=>t.unsubscribe()),i.unsubscribe()}})}[(Symbol.observable,a)](){return this}static from(t){const e="function"==typeof this?this:w;if(null==t)throw new TypeError(t+" is not an object");const r=u(t,a);if(r){const n=r.call(t);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(t){return t instanceof w}(n)&&n.constructor===e?n:new e(t=>n.subscribe(t))}if(i("iterator")){const r=u(t,s);if(r)return new e(e=>{f(()=>{if(!e.closed){for(const n of r.call(t))if(e.next(n),e.closed)return;e.complete()}})})}if(Array.isArray(t))return new e(e=>{f(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}static of(...t){return new("function"==typeof this?this:w)(e=>{f(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})})}static get[l](){return this}}n()&&Object.defineProperty(w,Symbol("extensions"),{value:{symbol:a,hostReportError:c},configurable:!0});e.a=w},function(t,e,r){"use strict";var n;r.d(e,"a",(function(){return n})),function(t){t.internalError="internalError",t.message="message",t.termination="termination"}(n||(n={}))},function(t,e,r){"use strict";(function(t){
2
- /*!
3
- * The buffer module from node.js, for the browser.
4
- *
5
- * @author Feross Aboukhadijeh <http://feross.org>
6
- * @license MIT
7
- */
8
- var n=r(44),i=r(45),o=r(46);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,r);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,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=f(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(l.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(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(h(e),t=a(t,e<0?0:0|d(e)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function f(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(l.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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var c=!0,f=0;f<l;f++)if(u(t,o+f)!==u(e,f)){c=!1;break}if(c)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function v(t,e,r,n){return G(B(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return _(t,e,r,n)}function E(t,e,r,n){return G(z(e),t,r,n)}function x(t,e,r,n){return G(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,l,u=t[i],h=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)>127&&(h=l);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.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=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,r){return u(null,t,e,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,r){return function(t,e,r,n){return h(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},l.allocUnsafe=function(t){return c(null,t)},l.allocUnsafeSlow=function(t){return c(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},l.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}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=l.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},l.byteLength=p,l.prototype._isBuffer=!0,l.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},l.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},l.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},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,r,n,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),c=0;c<a;++c)if(u[c]!==h[c]){o=u[c],s=h[c];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},l.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U(t[o]);return i}function O(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=l.prototype;else{var i=e-t;r=new l(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},l.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},l.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},l.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);D(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);D(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},l.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=l.isBuffer(t)?t:B(new l(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(10))},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,i),i+=o.length;return s}},s={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(n)},function(t,e,r){"use strict";const n=r(1),i=r(1).buildOptions,o=r(77);"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,n.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const s={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};e.defaultOptions=s;const a=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];function l(t,e,r){return e&&(r.trimValues&&(e=e.trim()),e=h(e=r.tagValueProcessor(e,t),r.parseNodeValue,r.parseTrueNumberOnly)),e}function u(t,e){if(e.ignoreNameSpace){const e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}function h(t,e,r){if(e&&"string"==typeof t){let e;return""===t.trim()||isNaN(t)?e="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?e=Number.parseInt(t,16):-1!==t.indexOf(".")?(e=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):e=Number.parseInt(t,10),r&&(e=String(e)===t?e:t)),e}return n.isExist(t)?t:""}e.props=a;const c=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function f(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");const r=n.getAllMatches(t,c),i=r.length,o={};for(let t=0;t<i;t++){const n=u(r[t][1],e);n.length&&(void 0!==r[t][4]?(e.trimValues&&(r[t][4]=r[t][4].trim()),r[t][4]=e.attrValueProcessor(r[t][4],n),o[e.attributeNamePrefix+n]=h(r[t][4],e.parseAttributeValue,e.parseTrueNumberOnly)):e.allowBooleanAttributes&&(o[e.attributeNamePrefix+n]=!0))}if(!Object.keys(o).length)return;if(e.attrNodeName){const t={};return t[e.attrNodeName]=o,t}return o}}function d(t,e){let r,n="";for(let i=e;i<t.length;i++){let e=t[i];if(r)e===r&&(r="");else if('"'===e||"'"===e)r=e;else{if(">"===e)return{data:n,index:i};"\t"===e&&(e=" ")}n+=e}}function p(t,e,r,n){const i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}e.getTraversalObj=function(t,e){t=t.replace(/\r\n?/g,"\n"),e=i(e,s,a);const r=new o("!xml");let u=r,h="";for(let r=0;r<t.length;r++){if("<"===t[r])if("/"===t[r+1]){const i=p(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,i).trim();if(e.ignoreNameSpace){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}u&&(u.val?u.val=n.getValue(u.val)+""+l(o,h,e):u.val=l(o,h,e)),e.stopNodes.length&&e.stopNodes.includes(u.tagname)&&(u.child=[],null==u.attrsMap&&(u.attrsMap={}),u.val=t.substr(u.startIndex+1,r-u.startIndex-1)),u=u.parent,h="",r=i}else if("?"===t[r+1])r=p(t,"?>",r,"Pi Tag is not closed.");else if("!--"===t.substr(r+1,3))r=p(t,"--\x3e",r,"Comment is not closed.");else if("!D"===t.substr(r+1,2)){const e=p(t,">",r,"DOCTYPE is not closed.");r=t.substring(r,e).indexOf("[")>=0?t.indexOf("]>",r)+1:e}else if("!["===t.substr(r+1,2)){const i=p(t,"]]>",r,"CDATA is not closed.")-2,s=t.substring(r+9,i);if(h&&(u.val=n.getValue(u.val)+""+l(u.tagname,h,e),h=""),e.cdataTagName){const t=new o(e.cdataTagName,u,s);u.addChild(t),u.val=n.getValue(u.val)+e.cdataPositionChar,s&&(t.val=s)}else u.val=(u.val||"")+(s||"");r=i+2}else{const i=d(t,r+1);let s=i.data;const a=i.index,c=s.indexOf(" ");let p=s,g=!0;if(-1!==c&&(p=s.substr(0,c).replace(/\s\s*$/,""),s=s.substr(c+1)),e.ignoreNameSpace){const t=p.indexOf(":");-1!==t&&(p=p.substr(t+1),g=p!==i.data.substr(t+1))}if(u&&h&&"!xml"!==u.tagname&&(u.val=n.getValue(u.val)+""+l(u.tagname,h,e)),s.length>0&&s.lastIndexOf("/")===s.length-1){"/"===p[p.length-1]?(p=p.substr(0,p.length-1),s=p):s=s.substr(0,s.length-1);const t=new o(p,u,"");p!==s&&(t.attrsMap=f(s,e)),u.addChild(t)}else{const t=new o(p,u);e.stopNodes.length&&e.stopNodes.includes(t.tagname)&&(t.startIndex=a),p!==s&&g&&(t.attrsMap=f(s,e)),u.addChild(t),u=t}h="",r=a}else h+=t[r]}return r}},,function(t,e,r){"use strict";var n=r(6).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,l=function(){e.writable||h()},u=e._writableState&&e._writableState.finished,h=function(){a=!1,u=!0,s||o.call(e)},c=e._readableState&&e._readableState.endEmitted,f=function(){s=!1,c=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!c?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},g=function(){e.req.on("finish",h)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",l),e.on("close",l)):(e.on("complete",h),e.on("abort",p),e.req?g():e.on("request",g)),e.on("end",f),e.on("finish",h),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",h),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",h),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("end",f),e.removeListener("error",d),e.removeListener("close",p)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return y})),r.d(e,"b",(function(){return w}));var n=r(3),i=r.n(n),o=r(11),s=r(84),a=r(5);const l=()=>{},u=t=>t,h=t=>Promise.resolve().then(t);function c(t){throw t}class f extends o.a{constructor(t){super(e=>{const r=this,n=Object.assign(Object.assign({},e),{complete(){e.complete(),r.onCompletion()},error(t){e.error(t),r.onError(t)},next(t){e.next(t),r.onNext(t)}});try{return this.initHasRun=!0,t(n)}catch(t){n.error(t)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state="rejected",this.rejection=t;for(const e of this.rejectionCallbacks)h(()=>e(t))}onCompletion(){this.state="fulfilled";for(const t of this.fulfillmentCallbacks)h(()=>t(this.firstValue))}then(t,e){const r=t||u,n=e||c;let i=!1;return new Promise((t,e)=>{const o=r=>{if(!i){i=!0;try{t(n(r))}catch(t){e(t)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?t(r(this.firstValue)):"rejected"===this.state?(i=!0,t(n(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(r(e))}catch(t){o(t)}}),void this.rejectionCallbacks.push(o))})}catch(t){return this.then(void 0,t)}finally(t){const e=t||l;return this.then(t=>(e(),t),()=>e())}static from(t){return function(t){return t&&"function"==typeof t.then}(t)?new f(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}var d=r(32),p=r(9);const g=i()("threads:master:messages");let m=1;function b(t,e){return new o.a(r=>{let n;const i=o=>{var s;if(g("Message from worker:",o.data),o.data&&o.data.uid===e)if((s=o.data)&&s.type===p.b.running)n=o.data.resultType;else if((t=>t&&t.type===p.b.result)(o.data))"promise"===n?(void 0!==o.data.payload&&r.next(Object(a.a)(o.data.payload)),r.complete(),t.removeEventListener("message",i)):(o.data.payload&&r.next(Object(a.a)(o.data.payload)),o.data.complete&&(r.complete(),t.removeEventListener("message",i)));else if((t=>t&&t.type===p.b.error)(o.data)){const e=Object(a.a)(o.data.error);r.error(e),t.removeEventListener("message",i)}};return t.addEventListener("message",i),()=>{if("observable"===n||!n){const r={type:p.a.cancel,uid:e};t.postMessage(r)}t.removeEventListener("message",i)}})}function y(t,e){return(...r)=>{const n=m++,{args:i,transferables:o}=function(t){if(0===t.length)return{args:[],transferables:[]};const e=[],r=[];for(const n of t)Object(d.b)(n)?(e.push(Object(a.b)(n.send)),r.push(...n.transferables)):e.push(Object(a.b)(n));return{args:e,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),l={type:p.a.run,uid:n,method:e,args:i};g("Sending command to run function to worker:",l);try{t.postMessage(l,o)}catch(t){return f.from(Promise.reject(t))}return f.from(Object(s.a)(b(t,n)))}}function w(t,e){const r={};for(const n of e)r[n]=y(t,n);return r}},function(t,e,r){"use strict";(function(e,n){var i;t.exports=k,k.ReadableState=x;r(20).EventEmitter;var o=function(t,e){return t.listeners(e).length},s=r(21),a=r(13).Buffer,l=e.Uint8Array||function(){};var u,h=r(47);u=h&&h.debuglog?h.debuglog("stream"):function(){};var c,f,d,p=r(48),g=r(22),m=r(23).getHighWaterMark,b=r(6).codes,y=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(7)(k,s);var S=g.errorOrDestroy,E=["error","close","destroy","pause","resume"];function x(t,e,n){i=i||r(8),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",n),this.buffer=new p,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(25).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function k(t){if(i=i||r(8),!(this instanceof k))return new k(t);var e=this instanceof i;this._readableState=new x(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function A(t,e,r,n,i){u("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}(t,s);else if(i||(o=function(t,e){var r;n=e,a.isBuffer(n)||n instanceof l||"string"==typeof e||void 0===e||t.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(s,e)),o)S(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)s.endEmitted?S(t,new _):C(t,s,e,!0);else if(s.ended)S(t,new w);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?C(t,s,e,!1):P(t,s)):C(t,s,e,!1)}else n||(s.reading=!1,P(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function C(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&R(t)),P(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=g.destroy,k.prototype._undestroy=g.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},k.prototype.unshift=function(t){return A(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){c||(c=r(25).StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function T(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>=1073741824?t=1073741824:(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 R(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(O,t))}function O(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,F(t)}function P(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(D,t,e))}function D(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(u("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){u("readable nexttick read 0"),t.read(0)}function M(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),F(t),e.flowing&&!e.reading&&t.read(0)}function F(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function L(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(U,e,t))}function U(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function B(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}k.prototype.read=function(t){u("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):R(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&L(this),null;var n,i=e.needReadable;return u("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&u("length less than watermark",i=!0),e.ended||e.reading?u("reading or ended",i=!1):i&&(u("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(n=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&L(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){S(this,new v("_read()"))},k.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?l:m;function a(e,n){u("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",h),t.removeListener("error",d),t.removeListener("unpipe",a),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",f),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){u("onend"),t.end()}i.endEmitted?n.nextTick(s):r.once("end",s),t.on("unpipe",a);var h=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,F(t))}}(r);t.on("drain",h);var c=!1;function f(e){u("ondata");var n=t.write(e);u("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==B(i.pipes,t))&&!c&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){u("onerror",e),m(),t.removeListener("error",d),0===o(t,"error")&&S(t,e)}function p(){t.removeListener("finish",g),m()}function g(){u("onfinish"),t.removeListener("close",p),m()}function m(){u("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",g),t.emit("pipe",r),i.flowing||(u("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={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,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=B(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},k.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?R(this):i.reading||n.nextTick(N,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(I,this),r},k.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(I,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(M,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<E.length;o++)t.on(E[o],this.emit.bind(this,E[o]));return this._read=function(e){u("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(52)),f(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=j,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(t,e){return void 0===d&&(d=r(53)),d(k,t,e)})}).call(this,r(10),r(2))},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}b(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,r)}(t,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,a;if(u(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function b(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,h=m(l,u);for(r=0;r<u;++r)o(h[r],this,e)}return!0},a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return u(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,i,o,s;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){t.exports=r(20).EventEmitter},function(t,e,r){"use strict";(function(e){function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(r,s,t)):e.nextTick(r,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,r(2))},function(t,e,r){"use strict";var n=r(6).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},function(t,e,r){"use strict";(function(e,n){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=k,k.WritableState=x;var s={deprecate:r(50)},a=r(21),l=r(13).Buffer,u=e.Uint8Array||function(){};var h,c=r(22),f=r(23).getHighWaterMark,d=r(6).codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,w=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,S=c.errorOrDestroy;function E(){}function x(t,e,s){o=o||r(8),t=t||{},"boolean"!=typeof s&&(s=e instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,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 r=t._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,o){--e.pendingcb,r?(n.nextTick(o,i),n.nextTick(P,t,e),t._writableState.errorEmitted=!0,S(t,i)):(o(i),t._writableState.errorEmitted=!0,S(t,i),P(t,e))}(t,r,i,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(t,r),i?n.nextTick(C,t,r,s,o):C(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function k(t){var e=this instanceof(o=o||r(8));if(!e&&!h.call(k,this))return new k(t);this._writableState=new x(t,this,e),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)),a.call(this)}function A(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function C(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),P(t,e)}function T(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,l=!0;r;)o[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;o.allBuffers=l,A(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,h=r.encoding,c=r.callback;if(A(t,e,!1,e.objectMode?1:u.length,u,h,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final((function(r){e.pendingcb--,r&&S(t,r),e.prefinished=!0,t.emit("prefinish"),P(t,e)}))}function P(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,n.nextTick(O,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(7)(k,a),x.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(x.prototype,"buffer",{get:s.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===k&&(t&&t._writableState instanceof x)}})):h=function(t){return t instanceof this},k.prototype.pipe=function(){S(this,new b)},k.prototype.write=function(t,e,r){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=t,l.isBuffer(i)||i instanceof u);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(t,e){var r=new v;S(t,r),n.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var o;return null===r?o=new w:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(t,o),n.nextTick(i,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,a,n,i,o);return u}(this,o,a,t,e,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||T(this,t))},k.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 _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new g("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=c.destroy,k.prototype._undestroy=c.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this,r(10),r(2))},function(t,e,r){"use strict";var n=r(51).Buffer,i=n.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 o(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&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=c,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r: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 l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}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 r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}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 d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.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,r){"use strict";t.exports=h;var n=r(6).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(8);function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);l.call(this,t),this._transformState={afterTransform:u.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",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,r){f(t,e,r)}))}function f(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(7)(h,l),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,l.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,r){r(new i("_transform()"))},h.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){l.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return b}));var n=r(3),i=r.n(n),o=r(11),s=r(5),a=r(31),l=r(0),u=r(12),h=r(18),c=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};const f=i()("threads:master:messages"),d=i()("threads:master:spawn"),p=i()("threads:master:thread-utils"),g=void 0!==t&&t.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(t.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function m(t,e,r,n){const i=r.filter(t=>t.type===u.a.internalError).map(t=>t.error);return Object.assign(t,{[l.a]:i,[l.b]:r,[l.c]:n,[l.e]:e})}function b(t,e){return c(this,void 0,void 0,(function*(){d("Initializing new thread");const r=e&&e.timeout?e.timeout:g,n=(yield function(t,e,r){return c(this,void 0,void 0,(function*(){let n;const i=new Promise((t,i)=>{n=setTimeout(()=>i(Error(r)),e)}),o=yield Promise.race([t,i]);return clearTimeout(n),o}))}(function(t){return new Promise((e,r)=>{const n=i=>{var o;f("Message from worker before finishing initialization:",i.data),(o=i.data)&&"init"===o.type?(t.removeEventListener("message",n),e(i.data)):(t=>t&&"uncaughtError"===t.type)(i.data)&&(t.removeEventListener("message",n),r(Object(s.a)(i.data.error)))};t.addEventListener("message",n)})}(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)).exposed,{termination:i,terminate:l}=function(t){const[e,r]=Object(a.a)();return{terminate:()=>c(this,void 0,void 0,(function*(){p("Terminating worker"),yield t.terminate(),r()})),termination:e}}(t),b=function(t,e){return new o.a(r=>{const n=t=>{const e={type:u.a.message,data:t.data};r.next(e)},i=t=>{p("Unhandled promise rejection event in thread:",t);const e={type:u.a.internalError,error:Error(t.reason)};r.next(e)};t.addEventListener("message",n),t.addEventListener("unhandledrejection",i),e.then(()=>{const e={type:u.a.termination};t.removeEventListener("message",n),t.removeEventListener("unhandledrejection",i),r.next(e),r.complete()})})}(t,i);if("function"===n.type){return m(Object(h.a)(t),t,b,l)}if("module"===n.type){return m(Object(h.b)(t,n.methods),t,b,l)}{const t=n.type;throw Error("Worker init message states unexpected type of expose(): "+t)}}))}}).call(this,r(2))},function(t,e,r){function n(t,e){"use strict";var r=(e=e||{}).pos||0,i="<".charCodeAt(0),o=">".charCodeAt(0),s="-".charCodeAt(0),a="/".charCodeAt(0),l="!".charCodeAt(0),u="'".charCodeAt(0),h='"'.charCodeAt(0),c="[".charCodeAt(0);"]".charCodeAt(0);function f(){for(var e=[];t[r];)if(t.charCodeAt(r)==i){if(t.charCodeAt(r+1)===a)return(r=t.indexOf(">",r))+1&&(r+=1),e;if(t.charCodeAt(r+1)===l){if(t.charCodeAt(r+2)==s){for(;-1!==r&&(t.charCodeAt(r)!==o||t.charCodeAt(r-1)!=s||t.charCodeAt(r-2)!=s||-1==r);)r=t.indexOf(">",r+1);-1===r&&(r=t.length)}else{if(t.charCodeAt(r+2)===c&&t.charCodeAt(r+8)===c&&"cdata"===t.substr(r+3,5).toLowerCase()){var n=t.indexOf("]]>",r);-1==n?(e.push(t.substr(r+8)),r=t.length):(e.push(t.substring(r+9,n)),r=n+3);continue}for(r+=2;t.charCodeAt(r)!==o&&t[r];)r++}r++;continue}var u=m();e.push(u)}else{var h=d();h.trim().length>0&&e.push(h),r++}return e}function d(){var e=r;return-2===(r=t.indexOf("<",r)-1)&&(r=t.length),t.slice(e,r+1)}function p(){for(var e=r;-1==="\r\n\t>/= ".indexOf(t[r])&&t[r];)r++;return t.slice(e,r)}var g=e.noChildNodes||["img","br","input","meta","link"];function m(){r++;const e=p(),n={};let i=[];for(;t.charCodeAt(r)!==o&&t[r];){var s=t.charCodeAt(r);if(s>64&&s<91||s>96&&s<123){for(var l=p(),c=t.charCodeAt(r);c&&c!==u&&c!==h&&!(c>64&&c<91||c>96&&c<123)&&c!==o;)r++,c=t.charCodeAt(r);if(c===u||c===h){var d=b();if(-1===r)return{tagName:e,attributes:n,children:i}}else d=null,r--;n[l]=d}r++}if(t.charCodeAt(r-1)!==a)if("script"==e){var m=r+1;r=t.indexOf("<\/script>",r),i=[t.slice(m,r)],r+=9}else if("style"==e){m=r+1;r=t.indexOf("</style>",r),i=[t.slice(m,r)],r+=8}else-1==g.indexOf(e)&&(r++,i=f());else r++;return{tagName:e,attributes:n,children:i}}function b(){var e=t[r],n=r+1;return r=t.indexOf(e,n),t.slice(n,r)}var y,w=null;if(void 0!==e.attrValue){e.attrName=e.attrName||"id";for(w=[];-1!==(y=void 0,y=new RegExp("\\s"+e.attrName+"\\s*=['\"]"+e.attrValue+"['\"]").exec(t),r=y?y.index:-1);)-1!==(r=t.lastIndexOf("<",r))&&w.push(m()),t=t.substr(r),r=0}else w=e.parseNode?m():f();return e.filter&&(w=n.filter(w,e.filter)),e.setPos&&(w.pos=r),w}n.simplify=function(t){var e={};if(!t.length)return"";if(1===t.length&&"string"==typeof t[0])return t[0];for(var r in t.forEach((function(t){if("object"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var r=n.simplify(t.children);e[t.tagName].push(r),Object.keys(t.attributes).length&&(r._attributes=t.attributes)}})),e)1==e[r].length&&(e[r]=e[r][0]);return e},n.simplifyLostLess=function(t,e={}){var r={};return t.length?1===t.length&&"string"==typeof t[0]?Object.keys(e).length?{_attributes:e,value:t[0]}:t[0]:(t.forEach((function(t){if("object"==typeof t){r[t.tagName]||(r[t.tagName]=[]);var e=n.simplifyLostLess(t.children||[],t.attributes);r[t.tagName].push(e),Object.keys(t.attributes).length&&(e._attributes=t.attributes)}})),r):""},n.filter=function(t,e,r=0,i=""){var o=[];return t.forEach((function(t,s){if("object"==typeof t&&e(t,s,r,i)&&o.push(t),t.children){var a=n.filter(t.children,e,r+1,(i?i+".":"")+s+"."+t.tagName);o=o.concat(a)}})),o},n.stringify=function(t){var e="";function r(t){if(t)for(var r=0;r<t.length;r++)"string"==typeof t[r]?e+=t[r].trim():n(t[r])}function n(t){for(var n in e+="<"+t.tagName,t.attributes)null===t.attributes[n]?e+=" "+n:-1===t.attributes[n].indexOf('"')?e+=" "+n+'="'+t.attributes[n].trim()+'"':e+=" "+n+"='"+t.attributes[n].trim()+"'";e+=">",r(t.children),e+="</"+t.tagName+">"}return r(t),e},n.toContentString=function(t){if(Array.isArray(t)){var e="";return t.forEach((function(t){e=(e+=" "+n.toContentString(t)).trim()})),e}return"object"==typeof t?n.toContentString(t.children):" "+t},n.getElementById=function(t,e,r){var i=n(t,{attrValue:e});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(t,e,r){const i=n(t,{attrName:"class",attrValue:"[a-zA-Z0-9- ]*"+e+"[a-zA-Z0-9- ]*"});return r?n.simplify(i):i},n.parseStream=function(t,e){if("string"==typeof e&&(e=e.length+2),"string"==typeof t){var i=r(41);t=i.createReadStream(t,{start:e}),e=0}var o=e,s="";return t.on("data",(function(e){s+=e;for(var r=0;;){if(!(o=s.indexOf("<",o)+1))return void(o=r);if("/"!==s[o+1]){var i=n(s,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>s.length-1||o<r)return s=s.slice(r),o=0,void(r=0);t.emit("xml",i),r=o}else o+=1,r=pos}})),t},n.transformStream=function(t){const e=r(42);"string"==typeof t&&(t=t.length+2);var i=t||0,o="";return e({readableObjectMode:!0},(function(t,e,r){o+=t;for(var s=0;;){if(!(i=o.indexOf("<",i)+1))return i=s,r();if("/"!==o[i+1]){var a=n(o,{pos:i-1,parseNode:!0,setPos:!0});if((i=a.pos)>o.length-1||i<s)return o=o.slice(s),i=0,r();this.push(a),s=i}else i+=1,s=pos}r()}))},t.exports=n,n.xml=n},function(t,e,r){"use strict";var n=r(56),i=r(14),o=r(61),s=r(62),a=r(63),l=r(64),u=r(65),h=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(a[r])}function f(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}c.prototype.push=function(t,e){var r,a,l,u,c,f=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(d),f.next_out=0,f.avail_out=d),(r=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===g&&(r=s.Z_OK,g=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&r!==s.Z_STREAM_END&&(0!==f.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(f.output,f.next_out),u=f.next_out-l,c=o.buf2string(f.output,l),f.next_out=u,f.avail_out=d-u,u&&i.arraySet(f.output,f.output,l,u,0),this.onData(c)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=c,e.inflate=f,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},e.ungzip=f},function(t,e,r){"use strict";var n=r(11);class i extends n.a{constructor(){super(t=>(this._observers.add(t),()=>this._observers.delete(t))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}e.a=i},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));const n=()=>{};function i(){let t,e=!1,r=n;return[new Promise(n=>{e?n(t):r=n}),n=>{e=!0,t=n,r(t)}]}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(0);function i(t){return t&&"object"==typeof t&&t[n.d]}function o(t,e){if(!e){if(!(r=t)||"object"!=typeof r)throw Error();e=[t]}var r;return{[n.d]:!0,send:t,transferables:e}}},function(t,e,r){"use strict";const n=r(68),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),u=Symbol("dispose"),h=Symbol("noDisposeOnSet"),c=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),p=()=>1;const g=(t,e,r)=>{const n=t[f].get(e);if(n){const e=n.value;if(m(t,e)){if(y(t,n),!t[a])return}else r&&(t[d]&&(n.value.now=Date.now()),t[c].unshiftNode(n));return e.value}},m=(t,e)=>{if(!e||!e.maxAge&&!t[l])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[l]&&r>t[l]},b=t=>{if(t[o]>t[i])for(let e=t[c].tail;t[o]>t[i]&&null!==e;){const r=e.prev;y(t,e),e=r}},y=(t,e)=>{if(e){const r=e.value;t[u]&&t[u](r.key,r.value),t[o]-=r.length,t[f].delete(r.key),t[c].removeNode(e)}};class w{constructor(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}}const v=(t,e,r,n)=>{let i=r.value;m(t,i)&&(y(t,r),t[a]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||p;if(this[s]="function"!=typeof e?p:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[u]=t.dispose,this[h]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,b(this)}get max(){return this[i]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[l]=t,b(this)}get maxAge(){return this[l]}set lengthCalculator(t){"function"!=typeof t&&(t=p),t!==this[s]&&(this[s]=t,this[o]=0,this[c].forEach(t=>{t.length=this[s](t.value,t.key),this[o]+=t.length})),b(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[c].length}rforEach(t,e){e=e||this;for(let r=this[c].tail;null!==r;){const n=r.prev;v(this,t,r,e),r=n}}forEach(t,e){e=e||this;for(let r=this[c].head;null!==r;){const n=r.next;v(this,t,r,e),r=n}}keys(){return this[c].toArray().map(t=>t.key)}values(){return this[c].toArray().map(t=>t.value)}reset(){this[u]&&this[c]&&this[c].length&&this[c].forEach(t=>this[u](t.key,t.value)),this[f]=new Map,this[c]=new n,this[o]=0}dump(){return this[c].map(t=>!m(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[c]}set(t,e,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](e,t);if(this[f].has(t)){if(a>this[i])return y(this,this[f].get(t)),!1;const s=this[f].get(t).value;return this[u]&&(this[h]||this[u](t,s.value)),s.now=n,s.maxAge=r,s.value=e,this[o]+=a-s.length,s.length=a,this.get(t),b(this),!0}const d=new w(t,e,a,n,r);return d.length>this[i]?(this[u]&&this[u](t,e),!1):(this[o]+=d.length,this[c].unshift(d),this[f].set(t,this[c].head),b(this),!0)}has(t){if(!this[f].has(t))return!1;const e=this[f].get(t).value;return!m(this,e)}get(t){return g(this,t,!0)}peek(t){return g(this,t,!1)}pop(){const t=this[c].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[f].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const t=i-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[f].forEach((t,e)=>g(this,e,!1))}}},function(t,e,r){"use strict";var n=r(70),i=r(72);function o(){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}e.parse=w,e.resolve=function(t,e){return w(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?w(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=w(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(u),c=["%","/","?",";","#"].concat(h),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(73);function w(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var w=t=u.join(a);if(w=w.trim(),!r&&1===t.split("#").length){var v=l.exec(w);if(v)return this.path=w,this.href=w,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var _=s.exec(w);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,w=w.substr(_.length)}if(r||_||w.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===w.substr(0,2);!E||_&&m[_]||(w=w.substr(2),this.slashes=!0)}if(!m[_]&&(E||_&&!b[_])){for(var x,k,A=-1,C=0;C<f.length;C++){-1!==(T=w.indexOf(f[C]))&&(-1===A||T<A)&&(A=T)}-1!==(k=-1===A?w.lastIndexOf("@"):w.lastIndexOf("@",A))&&(x=w.slice(0,k),w=w.slice(k+1),this.auth=decodeURIComponent(x)),A=-1;for(C=0;C<c.length;C++){var T;-1!==(T=w.indexOf(c[C]))&&(-1===A||T<A)&&(A=T)}-1===A&&(A=w.length),this.host=w.slice(0,A),w=w.slice(A),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var O=this.hostname.split(/\./),P=(C=0,O.length);C<P;C++){var D=O[C];if(D&&!D.match(d)){for(var I="",N=0,M=D.length;N<M;N++)D.charCodeAt(N)>127?I+="x":I+=D[N];if(!I.match(d)){var F=O.slice(0,C),j=O.slice(C+1),L=D.match(p);L&&(F.push(L[1]),j.unshift(L[2])),j.length&&(w="/"+j.join(".")+w),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!g[S])for(C=0,P=h.length;C<P;C++){var z=h[C];if(-1!==w.indexOf(z)){var G=encodeURIComponent(z);G===z&&(G=escape(z)),w=w.split(z).join(G)}}var V=w.indexOf("#");-1!==V&&(this.hash=w.substr(V),w=w.slice(0,V));var q=w.indexOf("?");if(-1!==q?(this.search=w.substr(q),this.query=w.substr(q+1),e&&(this.query=y.parse(this.query)),w=w.slice(0,q)):e&&(this.search="",this.query={}),w&&(this.pathname=w),b[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var W=this.search||"";this.path=U+W}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=y.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||b[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(w(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),u=0;u<l.length;u++){var h=l[u];"protocol"!==h&&(r[h]=t[h])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!b[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||m[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",y=r.search||"";r.path=g+y}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var w=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=v||w||r.host&&t.pathname,S=_,E=r.pathname&&r.pathname.split("/")||[],x=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),_=_&&(""===p[0]||""===E[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(x)r.hostname=r.host=E.shift(),(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=E.slice(-1)[0],A=(r.host||t.host||E.length>1)&&("."===k||".."===k)||""===k,C=0,T=E.length;T>=0;T--)"."===(k=E[T])?E.splice(T,1):".."===k?(E.splice(T,1),C++):C&&(E.splice(T,1),C--);if(!_&&!S)for(;C--;C)E.unshift("..");!_||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var R,O=""===E[0]||E[0]&&"/"===E[0].charAt(0);x&&(r.hostname=r.host=O?"":E.length?E.shift():"",(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.host=r.hostname=R.shift()));return(_=_||r.host&&E.length)&&!O&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){"use strict";const n=r(76),i=r(15),o=r(15),s=r(1).buildOptions,a=r(78);e.parse=function(t,e,r){if(r){!0===r&&(r={});const e=a.validate(t,r);if(!0!==e)throw Error(e.err.msg)}e=s(e,o.defaultOptions,o.props);const l=i.getTraversalObj(t,e);return n.convertToJson(l,e)},e.convertTonimn=r(79).convert2nimn,e.getTraversalObj=i.getTraversalObj,e.convertToJson=n.convertToJson,e.convertToJsonString=r(80).convertToJsonString,e.validate=a.validate,e.j2xParser=r(81),e.parseToNimn=function(t,r,n){return e.convertTonimn(e.getTraversalObj(t,n),r,n)}},function(t,e,r){"use strict";function n(t){return t instanceof DataView}r.r(e),r.d(e,"loadGeoTiff",(function(){return Ae})),r.d(e,"TiffPixelSource",(function(){return be}));const i=new ArrayBuffer(4),o=new Float32Array(i),s=new Uint32Array(i),a=new Uint32Array(512),l=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(a[0|t]=0,a[256|t]=32768,l[0|t]=24,l[256|t]=24):e<-14?(a[0|t]=1024>>-e-14,a[256|t]=1024>>-e-14|32768,l[0|t]=-e-1,l[256|t]=-e-1):e<=15?(a[0|t]=e+15<<10,a[256|t]=e+15<<10|32768,l[0|t]=13,l[256|t]=13):e<128?(a[0|t]=31744,a[256|t]=64512,l[0|t]=24,l[256|t]=24):(a[0|t]=31744,a[256|t]=64512,l[0|t]=13,l[256|t]=13)}const u=new Uint32Array(2048),h=new Uint32Array(64),c=new Uint32Array(64);u[0]=0;for(let t=1;t<1024;++t){let e=t<<13,r=0;for(;0==(8388608&e);)r-=8388608,e<<=1;e&=-8388609,r+=947912704,u[t]=e|r}for(let t=1024;t<2048;++t)u[t]=939524096+(t-1024<<13);h[0]=0;for(let t=1;t<31;++t)h[t]=t<<23;h[31]=1199570944,h[32]=2147483648;for(let t=33;t<63;++t)h[t]=2147483648+(t-32<<23);h[63]=3347054592,c[0]=0;for(let t=1;t<64;++t)c[t]=32===t?0:1024;function f(t,e,...r){if(!n(t))throw new TypeError("First argument to getFloat16 function must be a DataView");return function(t){const e=t>>10;return s[0]=u[c[e]+(1023&t)]+h[e],o[0]}(t.getUint16(e,...r))}var d=r(28),p=r.n(d);const g={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"},m={};for(const t in g)g.hasOwnProperty(t)&&(m[g[t]]=parseInt(t,10));const b=[m.BitsPerSample,m.ExtraSamples,m.SampleFormat,m.StripByteCounts,m.StripOffsets,m.StripRowCounts,m.TileByteCounts,m.TileOffsets,m.SubIFDs],y={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},w={};for(const t in y)y.hasOwnProperty(t)&&(w[y[t]]=parseInt(t,10));const v=0,_=1,S=2,E=3,x=5,k=6,A=8,C=0,T={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"},R={};for(const t in T)T.hasOwnProperty(t)&&(R[T[t]]=parseInt(t,10));function O(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function P(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let e=0;e<o;++e)for(let n=0;n<r;++n)t[r*e+n]=s[(r-n-1)*o+e]}class D{async decode(t,e){const r=await this.decodeBlock(e),n=t.Predictor||1;if(1!==n){const e=!t.StripOffsets;return function(t,e,r,n,i,o){if(!e||1===e)return t;for(let t=0;t<i.length;++t){if(i[t]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[t]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let o=0;o<n&&!(o*a*r*s>=t.byteLength);++o){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,o*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,o*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,o*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}O(n,a)}else 3===e&&(n=new Uint8Array(t,o*a*r*s,a*r*s),P(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}class I extends D{decodeBlock(t){return t}}function N(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}function M(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let t=0;t<=257;t++)e[t]=4096,r[t]=t;let n=258,i=9,o=0;function s(){n=258,i=9}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;let u=t[i]&2**(8-n)-1;u<<=r-o;let h=u;if(i+1<t.length){let e=t[i+1]>>>a;e<<=Math.max(0,r-l),h+=e}if(s>8&&i+2<t.length){const n=8*(i+3)-(e+r);h+=t[i+2]>>>n}return h}(t,o,i);return o+=i,e}function l(t,i){return r[n]=i,e[n]=t,n++,n-1}function u(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const h=[];s();const c=new Uint8Array(t);let f,d=a(c);for(;257!==d;){if(256===d){for(s(),d=a(c);256===d;)d=a(c);if(257===d)break;if(d>256)throw new Error("corrupted code at scanline "+d);N(h,u(d)),f=d}else if(d<n){const t=u(d);N(h,t),l(f,t[t.length-1]),f=d}else{const t=u(f);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${f} / ${n}, position: ${o}`);N(h,t),h.push(t[t.length-1]),l(f,t[t.length-1]),f=d}n+1>=2**i&&(12===i?f=void 0:i++),d=a(c)}return new Uint8Array(h)}class F extends D{decodeBlock(t){return M(t).buffer}}const j=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function L(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<t[a];i++){for(s=n.pop(),s.children[s.index]=e[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function U(t,e,r,n,i,o,s,a,l){const{mcusPerLine:u,progressive:h}=r,c=e;let f=e,d=0,p=0;function g(){if(p>0)return p--,d>>p&1;if(d=t[f++],255===d){const e=t[f++];if(e)throw new Error("unexpected marker: "+(d<<8|e).toString(16))}return p=7,d>>>7}function m(t){let e,r=t;for(;null!==(e=g());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function b(t){let e=t,r=0;for(;e>0;){const t=g();if(null===t)return;r=r<<1|t,--e}return r}function y(t){const e=b(t);return e>=1<<t-1?e:e+(-1<<t)+1}let w=0;let v,_=0;function S(t,e,r,n,i){const o=r%u,s=(r/u|0)*t.v+n,a=o*t.h+i;e(t,t.blocks[s][a])}function E(t,e,r){const n=r/t.blocksPerLine|0,i=r%t.blocksPerLine;e(t,t.blocks[n][i])}const x=n.length;let k,A,C,T,R,O;O=h?0===o?0===a?function(t,e){const r=m(t.huffmanTableDC),n=0===r?0:y(r)<<l;t.pred+=n,e[0]=t.pred}:function(t,e){e[0]|=g()<<l}:0===a?function(t,e){if(w>0)return void w--;let r=o;const n=s;for(;r<=n;){const n=m(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){w=b(o)+(1<<o)-1;break}r+=16}else{r+=o;e[j[r]]=y(i)*(1<<l),r++}}}:function(t,e){let r=o;const n=s;let i=0;for(;r<=n;){const n=j[r],o=e[n]<0?-1:1;switch(_){case 0:{const e=m(t.huffmanTableAC),r=15&e;if(i=e>>4,0===r)i<15?(w=b(i)+(1<<i),_=4):(i=16,_=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=y(r),_=i?2:3}continue}case 1:case 2:e[n]?e[n]+=(g()<<l)*o:(i--,0===i&&(_=2===_?3:0));break;case 3:e[n]?e[n]+=(g()<<l)*o:(e[n]=v<<l,_=0);break;case 4:e[n]&&(e[n]+=(g()<<l)*o)}r++}4===_&&(w--,0===w&&(_=0))}:function(t,e){const r=m(t.huffmanTableDC),n=0===r?0:y(r);t.pred+=n,e[0]=t.pred;let i=1;for(;i<64;){const r=m(t.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else{i+=o;e[j[i]]=y(n),i++}}};let P,D,I=0;D=1===x?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;const N=i||D;for(;I<D;){for(A=0;A<x;A++)n[A].pred=0;if(w=0,1===x)for(k=n[0],R=0;R<N;R++)E(k,O,I),I++;else for(R=0;R<N;R++){for(A=0;A<x;A++){k=n[A];const{h:t,v:e}=k;for(C=0;C<e;C++)for(T=0;T<t;T++)S(k,O,I,C,T)}if(I++,I===D)break}if(p=0,P=t[f]<<8|t[f+1],P<65280)throw new Error("marker was not found");if(!(P>=65488&&P<=65495))break;f+=2}return f-c}function B(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,r,n){const i=e.quantizationTable;let o,s,a,l,u,h,c,f,d;const p=n;let g;for(g=0;g<64;g++)p[g]=t[g]*i[g];for(g=0;g<8;++g){const t=8*g;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=5793*p[0+t]+128>>8,s=5793*p[4+t]+128>>8,a=p[2+t],l=p[6+t],u=2896*(p[1+t]-p[7+t])+128>>8,f=2896*(p[1+t]+p[7+t])+128>>8,h=p[3+t]<<4,c=p[5+t]<<4,d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*l+128>>8,a=1567*a-3784*l+128>>8,l=d,d=u-c+1>>1,u=u+c+1>>1,c=d,d=f+h+1>>1,h=f-h+1>>1,f=d,d=o-l+1>>1,o=o+l+1>>1,l=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*u+3406*f+2048>>12,u=3406*u-2276*f+2048>>12,f=d,d=799*h+4017*c+2048>>12,h=4017*h-799*c+2048>>12,c=d,p[0+t]=o+f,p[7+t]=o-f,p[1+t]=s+c,p[6+t]=s-c,p[2+t]=a+h,p[5+t]=a-h,p[3+t]=l+u,p[4+t]=l-u):(d=5793*p[0+t]+512>>10,p[0+t]=d,p[1+t]=d,p[2+t]=d,p[3+t]=d,p[4+t]=d,p[5+t]=d,p[6+t]=d,p[7+t]=d)}for(g=0;g<8;++g){const t=g;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=5793*p[0+t]+2048>>12,s=5793*p[32+t]+2048>>12,a=p[16+t],l=p[48+t],u=2896*(p[8+t]-p[56+t])+2048>>12,f=2896*(p[8+t]+p[56+t])+2048>>12,h=p[24+t],c=p[40+t],d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*l+2048>>12,a=1567*a-3784*l+2048>>12,l=d,d=u-c+1>>1,u=u+c+1>>1,c=d,d=f+h+1>>1,h=f-h+1>>1,f=d,d=o-l+1>>1,o=o+l+1>>1,l=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*u+3406*f+2048>>12,u=3406*u-2276*f+2048>>12,f=d,d=799*h+4017*c+2048>>12,h=4017*h-799*c+2048>>12,c=d,p[0+t]=o+f,p[56+t]=o-f,p[8+t]=s+c,p[48+t]=s-c,p[16+t]=a+h,p[40+t]=a-h,p[24+t]=l+u,p[32+t]=l-u):(d=5793*n[g+0]+8192>>14,p[0+t]=d,p[8+t]=d,p[16+t]=d,p[24+t]=d,p[32+t]=d,p[40+t]=d,p[48+t]=d,p[56+t]=d)}for(g=0;g<64;++g){const t=128+(p[g]+8>>4);r[g]=t<0?0:t>255?255:t}}for(let t=0;t<i;t++){const i=t<<3;for(let t=0;t<8;t++)r.push(new Uint8Array(o));for(let o=0;o<n;o++){l(e.blocks[t][o],a,s);let n=0;const u=o<<3;for(let t=0;t<8;t++){const e=r[i+t];for(let t=0;t<8;t++)e[u+t]=a[n++]}}}return r}class z{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function r(){const r=t[e]<<8|t[e+1];return e+=2,r}function n(){const n=r(),i=t.subarray(e,e+n-2);return e+=i.length,i}function i(t){let e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],n<e.h&&(n=e.h),i<e.v&&(i=e.v));const o=Math.ceil(t.samplesPerLine/8/n),s=Math.ceil(t.scanLines/8/i);for(r in t.components)if(t.components.hasOwnProperty(r)){e=t.components[r];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/n),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),u=o*e.h,h=s*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<u;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=n,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=n();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const n=r()+e-2;for(;e<n;){const n=t[e++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++){i[j[r]]=t[e++]}else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++){i[j[t]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r<s;r++){a=t[e];const r=t[e+1]>>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=t[e++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,e++)i[r]=t[e],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,e++)s[r]=t[e];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=L(i,s):this.huffmanTablesAC[15&n]=L(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[t[e++]],n=t[e++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],l=t[e++],u=U(t,e,o,i,this.resetInterval,s,a,l>>4,15&l);e+=u;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker "+o.toString(16))}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let t=0;t<this.frames.length;t++){const e=this.frames[t].components;for(const t of Object.keys(e))e[t].quantizationTable=this.quantizationTables[e[t].quantizationIdx],delete e[t].quantizationIdx}const e=t[0],{components:r,componentsOrder:n}=e,i=[],o=e.samplesPerLine,s=e.scanLines;for(let t=0;t<n.length;t++){const o=r[n[t]];i.push({lines:B(0,o),scaleX:o.h/e.maxH,scaleY:o.v/e.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let t=0;t<s;++t)for(let e=0;e<o;++e)for(let r=0;r<i.length;++r){const n=i[r];a[l]=n.lines[0|t*n.scaleY][0|e*n.scaleX],++l}return a}}class G extends D{constructor(t){super(),this.reader=new z,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}var V=r(29);class q extends D{decodeBlock(t){return Object(V.inflate)(new Uint8Array(t)).buffer}}class W extends D{decodeBlock(t){const e=new DataView(t),r=[];for(let n=0;n<t.byteLength;++n){let t=e.getInt8(n);if(t<0){const i=e.getUint8(n+1);t=-t;for(let e=0;e<=t;++e)r.push(i);n+=1}else{for(let i=0;i<=t;++i)r.push(e.getUint8(n+i+1));n+=t+1}}return new Uint8Array(r).buffer}}function H(t,e,r,n=1){return new(Object.getPrototypeOf(t).constructor)(e*r*n)}function Y(t,e,r){return(1-r)*t+r*e}function K(t,e,r,n,i,o="nearest"){switch(o.toLowerCase()){case"nearest":return function(t,e,r,n,i){const o=e/n,s=r/i;return t.map(t=>{const a=H(t,n,i);for(let l=0;l<i;++l){const i=Math.min(Math.round(s*l),r-1);for(let r=0;r<n;++r){const s=Math.min(Math.round(o*r),e-1),u=t[i*e+s];a[l*n+r]=u}}return a})}(t,e,r,n,i);case"bilinear":case"linear":return function(t,e,r,n,i){const o=e/n,s=r/i;return t.map(t=>{const a=H(t,n,i);for(let l=0;l<i;++l){const i=s*l,u=Math.floor(i),h=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const s=o*r,c=s%1,f=Math.floor(s),d=Math.min(Math.ceil(s),e-1),p=t[u*e+f],g=t[u*e+d],m=t[h*e+f],b=t[h*e+d],y=Y(Y(p,g,c),Y(m,b,c),i%1);a[l*n+r]=y}}return a})}(t,e,r,n,i);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function Z(t,e,r,n,i,o,s="nearest"){switch(s.toLowerCase()){case"nearest":return function(t,e,r,n,i,o){const s=e/n,a=r/i,l=H(t,n,i,o);for(let u=0;u<i;++u){const i=Math.min(Math.round(a*u),r-1);for(let r=0;r<n;++r){const a=Math.min(Math.round(s*r),e-1);for(let s=0;s<o;++s){const h=t[i*e*o+a*o+s];l[u*n*o+r*o+s]=h}}}return l}(t,e,r,n,i,o);case"bilinear":case"linear":return function(t,e,r,n,i,o){const s=e/n,a=r/i,l=H(t,n,i,o);for(let u=0;u<i;++u){const i=a*u,h=Math.floor(i),c=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const a=s*r,f=a%1,d=Math.floor(a),p=Math.min(Math.ceil(a),e-1);for(let s=0;s<o;++s){const a=t[h*e*o+d*o+s],g=t[h*e*o+p*o+s],m=t[c*e*o+d*o+s],b=t[c*e*o+p*o+s],y=Y(Y(a,g,f),Y(m,b,f),i%1);l[u*n*o+r*o+s]=y}}}return l}(t,e,r,n,i,o);default:throw new Error(`Unsupported resampling method: '${s}'`)}}function $(t,e,r){let n=0;for(let i=e;i<r;++i)n+=t[i];return n}function X(t,e,r){switch(t){case 1:if(e<=8)return new Uint8Array(r);if(e<=16)return new Uint16Array(r);if(e<=32)return new Uint32Array(r);break;case 2:if(8===e)return new Int8Array(r);if(16===e)return new Int16Array(r);if(32===e)return new Int32Array(r);break;case 3:switch(e){case 16:case 32:return new Float32Array(r);case 64:return new Float64Array(r)}}throw Error("Unsupported data format/bitsPerSample")}var Q=class{constructor(t,e,r,n,i,o){this.fileDirectory=t,this.geoKeys=e,this.dataView=r,this.littleEndian=n,this.tiles=i?{}:null,this.isTiled=!t.StripOffsets;const s=t.PlanarConfiguration;if(this.planarConfiguration=void 0===s?1:s,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e<this.fileDirectory.BitsPerSample.length;++e)t+=this.getSampleByteSize(e);return t}getSampleByteSize(t){if(t>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,r=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(t,e){return f(this,t,e)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){return X(this.getSampleFormat(t),this.getBitsPerSample(t),e)}async getTileOrStrip(t,e,r,n,i){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let a;const{tiles:l}=this;let u,h;1===this.planarConfiguration?a=e*o+t:2===this.planarConfiguration&&(a=r*o*s+e*o+t),this.isTiled?(u=this.fileDirectory.TileOffsets[a],h=this.fileDirectory.TileByteCounts[a]):(u=this.fileDirectory.StripOffsets[a],h=this.fileDirectory.StripByteCounts[a]);const c=(await this.source.fetch([{offset:u,length:h}],i))[0];let f;return null!==l&&l[a]?f=l[a]:(f=(async()=>{let t=await n.decode(this.fileDirectory,c);const r=this.getSampleFormat(),i=this.getBitsPerSample();return function(t,e){return(1!==t&&2!==t||!(e<=32)||e%8!=0)&&(3!==t||16!==e&&32!==e&&64!==e)}(r,i)&&(t=function(t,e,r,n,i,o,s){const a=new DataView(t),l=2===r?1:n,u=X(e,i,2===r?s*o:s*o*n),h=parseInt("1".repeat(i),2);if(1===e){let t;t=1===r?n*i:i;let e=o*t;0!=(7&e)&&(e=e+7&-8);for(let t=0;t<s;++t){const r=t*e;for(let e=0;e<o;++e){const n=r+e*l*i;for(let r=0;r<l;++r){const s=n+r*i,c=(t*o+e)*l+r,f=Math.floor(s/8),d=s%8;if(d+i<=8)u[c]=a.getUint8(f)>>8-i-d&h;else if(d+i<=16)u[c]=a.getUint16(f)>>16-i-d&h;else if(d+i<=24){const t=a.getUint16(f)<<8|a.getUint8(f+2);u[c]=t>>24-i-d&h}else u[c]=a.getUint32(f)>>32-i-d&h}}}}return u.buffer}(t,r,this.planarConfiguration,this.getSamplesPerPixel(),i,this.getTileWidth(),this.getBlockHeight(e))),t})(),null!==l&&(l[a]=f)),{x:t,y:e,sample:r,data:await f}}async _readRaster(t,e,r,n,i,o,s,a,l){const u=this.getTileWidth(),h=this.getTileHeight(),c=Math.max(Math.floor(t[0]/u),0),f=Math.min(Math.ceil(t[2]/u),Math.ceil(this.getWidth()/this.getTileWidth())),d=Math.max(Math.floor(t[1]/h),0),p=Math.min(Math.ceil(t[3]/h),Math.ceil(this.getHeight()/this.getTileHeight())),g=t[2]-t[0];let m=this.getBytesPerPixel();const b=[],y=[];for(let t=0;t<e.length;++t)1===this.planarConfiguration?b.push($(this.fileDirectory.BitsPerSample,0,e[t])/8):b.push(0),y.push(this.getReaderForSample(e[t]));const w=[],{littleEndian:v}=this;for(let o=d;o<p;++o)for(let s=c;s<f;++s)for(let a=0;a<e.length;++a){const c=a,f=e[a];2===this.planarConfiguration&&(m=this.getSampleByteSize(a));const d=this.getTileOrStrip(s,o,f,i,l);w.push(d),d.then(i=>{const o=i.data,s=new DataView(o),a=this.getBlockHeight(i.y),l=i.y*h,f=i.x*u,d=l+a,p=(i.x+1)*u,w=y[c],_=Math.min(a,a-(d-t[3])),S=Math.min(u,u-(p-t[2]));for(let i=Math.max(0,t[1]-l);i<_;++i)for(let o=Math.max(0,t[0]-f);o<S;++o){const a=(i*u+o)*m,h=w.call(s,a+b[c],v);let d;n?(d=(i+l-t[1])*g*e.length+(o+f-t[0])*e.length+c,r[d]=h):(d=(i+l-t[1])*g+o+f-t[0],r[c][d]=h)}})}if(await Promise.all(w),o&&t[2]-t[0]!==o||s&&t[3]-t[1]!==s){let i;return i=n?Z(r,t[2]-t[0],t[3]-t[1],o,s,e.length,a):K(r,t[2]-t[0],t[3]-t[1],o,s,a),i.width=o,i.height=s,i}return r.width=o||t[2]-t[0],r.height=s||t[3]-t[1],r}async readRasters({window:t,samples:e=[],interleave:r,pool:n=null,width:i,height:o,resampleMethod:s,fillValue:a,signal:l}={}){const u=t||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const h=(u[2]-u[0])*(u[3]-u[1]),c=this.getSamplesPerPixel();if(e&&e.length){for(let t=0;t<e.length;++t)if(e[t]>=c)return Promise.reject(new RangeError(`Invalid sample index '${e[t]}'.`))}else for(let t=0;t<c;++t)e.push(t);let f;if(r){f=X(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),h*e.length),a&&f.fill(a)}else{f=[];for(let t=0;t<e.length;++t){const r=this.getArrayForSample(e[t],h);Array.isArray(a)&&t<a.length?r.fill(a[t]):a&&!Array.isArray(a)&&r.fill(a),f.push(r)}}const d=n||function(t){switch(t.Compression){case void 0:case 1:return new I;case 5:return new F;case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new G(t);case 8:case 32946:return new q;case 32773:return new W;default:throw new Error("Unknown compression method identifier: "+t.Compression)}}(this.fileDirectory);return await this._readRaster(u,e,f,r,d,i,o,s,l)}async readRGB({window:t,pool:e=null,width:r,height:n,resampleMethod:i,enableAlpha:o=!1,signal:s}={}){const a=t||[0,0,this.getWidth(),this.getHeight()];if(a[0]>a[2]||a[1]>a[3])throw new Error("Invalid subsets");const l=this.fileDirectory.PhotometricInterpretation;if(l===S){let a=[0,1,2];if(this.fileDirectory.ExtraSamples!==C&&o){a=[];for(let t=0;t<this.fileDirectory.BitsPerSample.length;t+=1)a.push(t)}return this.readRasters({window:t,interleave:!0,samples:a,pool:e,width:r,height:n,resampleMethod:i,signal:s})}let u;switch(l){case v:case _:case E:u=[0];break;case x:u=[0,1,2,3];break;case k:case A:u=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const h={window:a,interleave:!0,samples:u,pool:e,width:r,height:n,resampleMethod:i,signal:s},{fileDirectory:c}=this,f=await this.readRasters(h),d=2**this.fileDirectory.BitsPerSample[0];let p;switch(l){case v:p=function(t,e){const{width:r,height:n}=t,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<t.length;++r,n+=3)o=256-t[r]/e*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}(f,d);break;case _:p=function(t,e){const{width:r,height:n}=t,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<t.length;++r,n+=3)o=t[r]/e*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}(f,d);break;case E:p=function(t,e){const{width:r,height:n}=t,i=new Uint8Array(r*n*3),o=e.length/3,s=e.length/3*2;for(let r=0,n=0;r<t.length;++r,n+=3){const a=t[r];i[n]=e[a]/65536*256,i[n+1]=e[a+o]/65536*256,i[n+2]=e[a+s]/65536*256}return i}(f,c.ColorMap);break;case x:p=function(t){const{width:e,height:r}=t,n=new Uint8Array(e*r*3);for(let e=0,r=0;e<t.length;e+=4,r+=3){const i=t[e],o=t[e+1],s=t[e+2],a=t[e+3];n[r]=(255-i)/256*255*((255-a)/256),n[r+1]=(255-o)/256*255*((255-a)/256),n[r+2]=(255-s)/256*255*((255-a)/256)}return n}(f);break;case k:p=function(t){const{width:e,height:r}=t,n=new Uint8ClampedArray(e*r*3);for(let e=0,r=0;e<t.length;e+=3,r+=3){const i=t[e],o=t[e+1],s=t[e+2];n[r]=i+1.402*(s-128),n[r+1]=i-.34414*(o-128)-.71414*(s-128),n[r+2]=i+1.772*(o-128)}return n}(f);break;case A:p=function(t){const{width:e,height:r}=t,n=new Uint8Array(e*r*3);for(let e=0,r=0;e<t.length;e+=3,r+=3){let i,o,s,a=(t[e+0]+16)/116,l=(t[e+1]<<24>>24)/500+a,u=a-(t[e+2]<<24>>24)/200;l=.95047*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),u=1.08883*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),i=3.2406*l+-1.5372*a+-.4986*u,o=-.9689*l+1.8758*a+.0415*u,s=.0557*l+-.204*a+1.057*u,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,s))}return n}(f);break;default:throw new Error("Unsupported photometric interpretation.")}return p.width=f.width,p.height=f.height,p}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const t=[];for(let e=0;e<this.fileDirectory.ModelTiepoint.length;e+=6)t.push({i:this.fileDirectory.ModelTiepoint[e],j:this.fileDirectory.ModelTiepoint[e+1],k:this.fileDirectory.ModelTiepoint[e+2],x:this.fileDirectory.ModelTiepoint[e+3],y:this.fileDirectory.ModelTiepoint[e+4],z:this.fileDirectory.ModelTiepoint[e+5]});return t}getGDALMetadata(t=null){const e={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA,n=p()(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");const i=n[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");let o=i.children.filter(t=>"Item"===t.tagName);null!==t&&(o=o.filter(e=>Number(e.attributes.sample)===t));for(let t=0;t<o.length;++t){const r=o[t];e[r.attributes.name]=r.children[0]}return e}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const t=this.fileDirectory.GDAL_NODATA;return Number(t.substring(0,t.length-1))}getOrigin(){const t=this.fileDirectory.ModelTiepoint,e=this.fileDirectory.ModelTransformation;if(t&&6===t.length)return[t[3],t[4],t[5]];if(e)return[e[3],e[7],e[11]];throw new Error("The image does not have an affine transformation.")}getResolution(t=null){const e=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(e)return[e[0],-e[1],e[2]];if(r)return[r[0],r[5],r[10]];if(t){const[e,r,n]=t.getResolution();return[e*t.getWidth()/this.getWidth(),r*t.getHeight()/this.getHeight(),n*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(){const t=this.getOrigin(),e=this.getResolution(),r=t[0],n=t[1],i=r+e[0]*this.getWidth(),o=n+e[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}};class J{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const r=this.getUint32(t,e),n=this.getUint32(t+4,e);let i;if(e){if(i=r+2**32*n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}if(i=2**32*r+n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}getInt64(t,e){let r=0;const n=(128&this._dataView.getUint8(t+(e?7:0)))>0;let i=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(t+(e?o:7-o));n&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),r+=s*256**o}return n&&(r=-r),r}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return f(this._dataView,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class tt{constructor(t,e,r,n){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),r=this.readUint32(t+4);let n;if(this._littleEndian){if(n=e+2**32*r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=2**32*e+r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}readInt64(t){let e=0;const r=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),e+=o*256**i}return r&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}let et;function rt(){return et||(et=function(){try{throw new Error}catch(t){const e=(""+t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(e)return(""+e[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return"/"}()),et}const nt="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,it=t=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t);function ot(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}let st;function at(){return st||(st=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class t extends Worker{constructor(t,e){var r,n;"string"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):"string"==typeof t&&!it(t)&&rt().match(/^file:\/\//i)&&(t=new URL(t,rt().replace(/\/[^\/]+$/,"/")),(null===(r=null==e?void 0:e.CORSWorkaround)||void 0===r||r)&&(t=ot(`importScripts(${JSON.stringify(t)});`))),"string"==typeof t&&it(t)&&(null===(n=null==e?void 0:e.CORSWorkaround)||void 0===n||n)&&(t=ot(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}class e extends t{constructor(t,e){super(window.URL.createObjectURL(t),e)}static fromText(t,r){const n=new window.Blob([t],{type:"text/javascript"});return new e(n,r)}}return{blob:e,default:t}}()),st}at().blob,at().default;var lt,ut=r(3),ht=r.n(ut),ct=r(30),ft=r(84),dt=r(11);function pt(t){return Promise.all(t.map(t=>{const e=t=>({status:"fulfilled",value:t}),r=t=>({status:"rejected",reason:t}),n=Promise.resolve(t);try{return n.then(e,r)}catch(t){return Promise.reject(t)}}))}!function(t){t.initialized="initialized",t.taskCanceled="taskCanceled",t.taskCompleted="taskCompleted",t.taskFailed="taskFailed",t.taskQueued="taskQueued",t.taskQueueDrained="taskQueueDrained",t.taskStart="taskStart",t.terminated="terminated"}(lt||(lt={}));var gt=r(0);function mt(t){throw Error(t)}const bt={errors:t=>t[gt.a]||mt("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:t=>t[gt.b]||mt("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:t=>t[gt.c]()};var yt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))};let wt=1;class vt{constructor(t,e){this.eventSubject=new ct.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof e?{size:e}:e||{},{size:n=nt}=r;this.debug=ht()("threads:pool:"+(r.name||String(wt++)).replace(/\W/g," ").trim().replace(/\s+/g,"-")),this.options=r,this.workers=function(t,e){return function(t){const e=[];for(let r=0;r<t;r++)e.push(r);return e}(e).map(()=>({init:t(),runningTasks:[]}))}(t,n),this.eventObservable=Object(ft.a)(dt.a.from(this.eventSubject)),Promise.all(this.workers.map(t=>t.init)).then(()=>this.eventSubject.next({type:lt.initialized,size:this.workers.length}),t=>{this.debug("Error while initializing pool worker:",t),this.eventSubject.error(t),this.initErrors.push(t)})}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find(e=>e.runningTasks.length<t)}runPoolTask(t,e){return yt(this,void 0,void 0,(function*(){const r=this.workers.indexOf(t)+1;this.debug(`Running task #${e.id} on worker #${r}...`),this.eventSubject.next({type:lt.taskStart,taskID:e.id,workerID:r});try{const n=yield e.run(yield t.init);this.debug(`Task #${e.id} completed successfully`),this.eventSubject.next({type:lt.taskCompleted,returnValue:n,taskID:e.id,workerID:r})}catch(t){this.debug(`Task #${e.id} failed`),this.eventSubject.next({type:lt.taskFailed,taskID:e.id,error:t,workerID:r})}}))}run(t,e){return yt(this,void 0,void 0,(function*(){const r=(()=>yt(this,void 0,void 0,(function*(){var n;yield(n=0,new Promise(t=>setTimeout(t,n)));try{yield this.runPoolTask(t,e)}finally{t.runningTasks=t.runningTasks.filter(t=>t!==r),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(r)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug("Task queue is empty"),void this.eventSubject.next({type:lt.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise((e,r)=>{const n=this.events().subscribe(i=>{i.type===lt.taskCompleted&&i.taskID===t?(n.unsubscribe(),e(i.returnValue)):i.type===lt.taskFailed&&i.taskID===t?(n.unsubscribe(),r(i.error)):i.type===lt.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))})})}settled(t=!1){return yt(this,void 0,void 0,(function*(){const e=()=>{return t=this.workers,e=t=>t.runningTasks,t.reduce((t,r)=>[...t,...e(r)],[]);var t,e},r=[],n=this.eventObservable.subscribe(t=>{t.type===lt.taskFailed&&r.push(t.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield pt(e()),r):(yield new Promise((t,e)=>{const r=this.eventObservable.subscribe({next(e){e.type===lt.taskQueueDrained&&(r.unsubscribe(),t(void 0))},error:e})}),yield pt(e()),n.unsubscribe(),r)}))}completed(t=!1){return yt(this,void 0,void 0,(function*(){const e=this.settled(t),r=new Promise((t,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===lt.taskQueueDrained?(n.unsubscribe(),t(e)):i.type===lt.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([e,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch(t=>{this.debug(`Task #${r} errored:`,t)});const i={id:r,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(t=>t!==i),this.eventSubject.next({type:lt.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=e)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:lt.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return yt(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:lt.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(t=>yt(this,void 0,void 0,(function*(){return bt.terminate(yield t.init)}))))}))}}function _t(t,e){return new vt(t,e)}vt.EventType=lt,_t.EventType=lt;r(27),r(32);"undefined"!=typeof navigator&&navigator.hardwareConcurrency;function St(t){if(void 0!==Object.fromEntries)return Object.fromEntries(t);const e={};for(const[r,n]of t)e[r.toLowerCase()]=n;return e}function Et(t){return St(t.split("\r\n").map(t=>{const e=t.split(":").map(t=>t.trim());return e[0]=e[0].toLowerCase(),e}))}function xt(t){let e,r,n;return t&&([,e,r,n]=t.match(/bytes (\d+)-(\d+)\/(\d+)/),e=parseInt(e,10),r=parseInt(r,10),n=parseInt(n,10)),{start:e,end:r,total:n}}class kt{async fetch(t,e){return await Promise.all(t.map(t=>this.fetchSlice(t,e)))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}var At=r(33),Ct=r.n(At);function Tt(t,e){for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function Rt(t){const e={};for(const r in t)if(t.hasOwnProperty(r)){e[t[r]]=r}return e}function Ot(t,e){const r=[];for(let n=0;n<t;n++)r.push(e(n));return r}function Pt(t,e){const r=Array.isArray(t)?t:Array.from(t),n=Array.isArray(e)?e:Array.from(e);return r.map((t,e)=>[t,n[e]])}class Dt extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Dt),this.name="AbortError"}}class It extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const Nt=It;class Mt{constructor(t,e,r=null){this.offset=t,this.length=e,this.data=r}get top(){return this.offset+this.length}}class Ft{constructor(t,e,r){this.offset=t,this.length=e,this.blockIds=r}}class jt extends kt{constructor(t,{blockSize:e=65536,cacheSize:r=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new Ct.a({max:r}),this.blockRequests=new Map,this.blockIdsToFetch=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const r=new Map,n=new Map,i=new Set;for(const{offset:e,length:o}of t){let t=e+o;const{fileSize:s}=this;null!==s&&(t=Math.min(t,s));for(let o=Math.floor(e/this.blockSize)*this.blockSize;o<t;o+=this.blockSize){const t=Math.floor(o/this.blockSize);this.blockCache.has(t)?r.set(t,this.blockCache.get(t)):this.blockRequests.has(t)?n.set(t,this.blockRequests.get(t)):(this.blockIdsToFetch.has(t)||this.blockIdsToFetch.add(t),i.add(t))}}await async function(t){return new Promise(e=>setTimeout(e,t))}(),this.fetchBlocks(e);for(const t of i){const e=this.blockRequests.get(t),i=this.blockCache.get(t);if(e)n.set(t,e);else{if(!i)throw new Error(`Block ${t} is not in the block requests`);r.set(t,i)}}let o=await Promise.allSettled(n.values());if(o.some(t=>"rejected"===t.status)){const t=new Set;for(const[r,i]of Pt(n.keys(),o)){const{rejected:n,reason:o}=i;n&&"AbortError"===o.name&&o.signal!==e&&(this.blockIdsToFetch.add(r),t.add(r))}if(this.blockIdsToFetch.length>0){this.fetchBlocks(e);for(const e of t){const t=this.blockRequests.get(e);if(!t)throw new Error(`Block ${e} is not in the block requests`);n.set(e,t)}o=await Promise.allSettled(Array.from(n.values()))}}if(o.some(t=>"rejected"===t.status)){if(e&&e.aborted)throw new Dt("Request was aborted");throw new Nt(o.filter(t=>"rejected"===t.status).map(t=>t.reason),"Request failed")}const s=o.map(t=>t.value),a=new Map(Pt(Array.from(n.keys()),s));for(const[t,e]of r)a.set(t,e);return this.readSliceData(t,a)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),r=this.source.fetch(e,t);for(let n=0;n<e.length;++n){const i=e[n];for(const e of i.blockIds){const i=(async()=>{try{const t=(await r)[n],i=e*this.blockSize,o=i-t.offset,s=Math.min(o+this.blockSize,t.data.byteLength),a=t.data.slice(o,s),l=new Mt(i,a.byteLength,a);return this.blockCache.set(e,l),l}catch(e){throw"AbortError"===e.name&&(e.signal=t),e}finally{this.blockRequests.delete(e)}})();this.blockRequests.set(e,i)}}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort((t,e)=>t-e);if(0===e.length)return[];let r=[],n=null;const i=[];for(const t of e)null===n||n+1===t?(r.push(t),n=t):(i.push(new Ft(r[0]*this.blockSize,r.length*this.blockSize,r)),r=[t],n=t);return i.push(new Ft(r[0]*this.blockSize,r.length*this.blockSize,r)),i}readSliceData(t,e){return t.map(t=>{const r=t.offset+t.length,n=Math.floor(t.offset/this.blockSize),i=Math.floor((t.offset+t.length)/this.blockSize),o=new ArrayBuffer(t.length),s=new Uint8Array(o);for(let o=n;o<=i;++o){const n=e.get(o),i=n.offset-t.offset,a=n.top-r;let l,u=0,h=0;i<0?u=-i:i>0&&(h=i),l=a<0?n.length-u:r-n.offset-u;const c=new Uint8Array(n.data,u,l);s.set(c,h)}return o})}}class Lt{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class Ut{constructor(t){this.url=t}async request({headers:t,credentials:e,signal:r}={}){throw new Error("request is not implemented")}}class Bt extends Lt{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class zt extends Ut{constructor(t,e){super(t),this.credentials=e}async request({headers:t,credentials:e,signal:r}={}){const n=await fetch(this.url,{headers:t,credentials:e,signal:r});return new Bt(n)}}class Gt extends Lt{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class Vt extends Ut{constructRequest(t,e){return new Promise((r,n)=>{const i=new XMLHttpRequest;i.open("GET",this.url),i.responseType="arraybuffer";for(const[e,r]of Object.entries(t))i.setRequestHeader(e,r);i.onload=()=>{const t=i.response;r(new Gt(i,t))},i.onerror=n,i.onabort=()=>n(new Dt("Request aborted")),i.send(),e&&(e.aborted&&i.abort(),e.addEventListener("abort",()=>i.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}var qt=r(4),Wt=r.n(qt),Ht=r(34),Yt=r.n(Ht);class Kt extends Lt{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class Zt extends Ut{constructor(t){super(t),this.parsedUrl=Yt.a.parse(this.url),this.httpApi=(this.parsedUrl.protocol,Wt.a)}constructRequest(t,e){return new Promise((r,n)=>{const i=this.httpApi.get({...this.parsedUrl,headers:t},t=>{const e=new Promise(e=>{const r=[];t.on("data",t=>{r.push(t)}),t.on("end",()=>{const t=Buffer.concat(r).buffer;e(t)}),t.on("error",n)});r(new Kt(t,e))});i.on("error",n),e&&(e.aborted&&i.destroy(new Dt("Request aborted")),e.addEventListener("abort",()=>i.destroy(new Dt("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class $t extends kt{constructor(t,e,r,n){super(),this.client=t,this.headers=e,this.maxRanges=r,this.allowFullFile=n,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):(this.maxRanges>0&&t.length,await Promise.all(t.map(t=>this.fetchSlice(t,e))))}async fetchSlices(t,e){const r=await this.client.request({headers:{...this.headers,Range:"bytes="+t.map(({offset:t,length:e})=>`${t}-${t+e}`).join(",")},signal:e});if(r.ok){if(206===r.status){const{type:n,params:i}=function(t){const[e,...r]=t.split(";").map(t=>t.trim());return{type:e,params:St(r.map(t=>t.split("=")))}}(r.getHeader("content-type"));if("multipart/byteranges"===n){const t=function(t,e){let r=null;const n=new TextDecoder("ascii"),i=[],o="--"+e,s=o+"--";for(let e=0;e<10;++e){n.decode(new Uint8Array(t,e,o.length))===o&&(r=e)}if(null===r)throw new Error("Could not find initial boundary");for(;r<t.byteLength;){const e=n.decode(new Uint8Array(t,r,Math.min(o.length+1024,t.byteLength-r)));if(0===e.length||e.startsWith(s))break;if(!e.startsWith(o))throw new Error("Part does not start with boundary");const a=e.substr(o.length+2);if(0===a.length)break;const l=a.indexOf("\r\n\r\n"),u=Et(a.substr(0,l)),{start:h,end:c,total:f}=xt(u["content-range"]),d=r+o.length+l+"\r\n\r\n".length,p=parseInt(c,10)+1-parseInt(h,10);i.push({headers:u,data:t.slice(d,d+p),offset:h,length:p,fileSize:f}),r=d+p+4}return i}(await r.getData(),i.boundary);return this._fileSize=t[0].fileSize||null,t}const o=await r.getData(),{start:s,end:a,total:l}=xt(r.getHeader("content-range"));this._fileSize=l||null;const u=[{data:o,offset:s,length:a-s}];if(t.length>1){const r=await Promise.all(t.slice(1).map(t=>this.fetchSlice(t,e)));return u.concat(r)}return u}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await r.getData();return this._fileSize=t.byteLength,[{data:t,offset:0,length:t.byteLength}]}}throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:r,length:n}=t,i=await this.client.request({headers:{...this.headers,Range:`bytes=${r}-${r+n}`},signal:e});if(i.ok){if(206===i.status){const t=await i.getData(),{total:e}=xt(i.getHeader("content-range"));return this._fileSize=e||null,{data:t,offset:r,length:n}}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await i.getData();return this._fileSize=t.byteLength,{data:t,offset:0,length:t.byteLength}}}throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function Xt(t,{blockSize:e,cacheSize:r}){return null===e?t:new jt(t,e,r)}function Qt(t,{forceXHR:e=!1,...r}={}){return"function"!=typeof fetch||e?"undefined"!=typeof XMLHttpRequest?function(t,{headers:e={},maxRanges:r=0,allowFullFile:n=!1,...i}={}){const o=new Vt(t);return Xt(new $t(o,e,r,n),i)}(t,r):function(t,{headers:e={},maxRanges:r=0,allowFullFile:n=!1,...i}={}){const o=new Zt(t);return Xt(new $t(o,e,r,n),i)}(t,r):function(t,{headers:e={},credentials:r,maxRanges:n=0,allowFullFile:i=!1,...o}={}){const s=new zt(t,r);return Xt(new $t(s,e,n,i),o)}(t,r)}class Jt extends kt{constructor(t){super(),this.file=t}async fetchSlice(t,e){return new Promise((r,n)=>{const i=this.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=t=>r(t.target.result),o.onerror=n,o.onabort=n,o.readAsArrayBuffer(i),e&&e.addEventListener("abort",()=>o.abort())})}}const te=Rt(g),ee=Rt(T),re={};Tt(re,te),Tt(re,ee);Rt(y);const ne={nextZero:(t,e)=>{let r=e;for(;0!==t[r];)r++;return r},readUshort:(t,e)=>t[e]<<8|t[e+1],readShort:(t,e)=>{const r=ne.ui8;return r[0]=t[e+1],r[1]=t[e+0],ne.i16[0]},readInt:(t,e)=>{const r=ne.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],ne.i32[0]},readUint:(t,e)=>{const r=ne.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],ne.ui32[0]},readASCII:(t,e,r)=>r.map(r=>String.fromCharCode(t[e+r])).join(""),readFloat:(t,e)=>{const r=ne.ui8;return Ot(4,n=>{r[n]=t[e+3-n]}),ne.fl32[0]},readDouble:(t,e)=>{const r=ne.ui8;return Ot(8,n=>{r[n]=t[e+7-n]}),ne.fl64[0]},writeUshort:(t,e,r)=>{t[e]=r>>8&255,t[e+1]=255&r},writeUint:(t,e,r)=>{t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r>>0&255},writeASCII:(t,e,r)=>{Ot(r.length,n=>{t[e+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};ne.fl64=new Float64Array(ne.ui8.buffer),ne.writeDouble=(t,e,r)=>{ne.fl64[0]=r,Ot(8,r=>{t[e+r]=ne.ui8[7-r]})};class ie{log(){}debug(){}info(){}warn(){}error(){}time(){}timeEnd(){}}new ie;function oe(t){switch(t){case w.BYTE:case w.ASCII:case w.SBYTE:case w.UNDEFINED:return 1;case w.SHORT:case w.SSHORT:return 2;case w.LONG:case w.SLONG:case w.FLOAT:case w.IFD:return 4;case w.RATIONAL:case w.SRATIONAL:case w.DOUBLE:case w.LONG8:case w.SLONG8:case w.IFD8:return 8;default:throw new RangeError("Invalid field type: "+t)}}function se(t,e,r,n){let i=null,o=null;const s=oe(e);switch(e){case w.BYTE:case w.ASCII:case w.UNDEFINED:i=new Uint8Array(r),o=t.readUint8;break;case w.SBYTE:i=new Int8Array(r),o=t.readInt8;break;case w.SHORT:i=new Uint16Array(r),o=t.readUint16;break;case w.SSHORT:i=new Int16Array(r),o=t.readInt16;break;case w.LONG:case w.IFD:i=new Uint32Array(r),o=t.readUint32;break;case w.SLONG:i=new Int32Array(r),o=t.readInt32;break;case w.LONG8:case w.IFD8:i=new Array(r),o=t.readUint64;break;case w.SLONG8:i=new Array(r),o=t.readInt64;break;case w.RATIONAL:i=new Uint32Array(2*r),o=t.readUint32;break;case w.SRATIONAL:i=new Int32Array(2*r),o=t.readInt32;break;case w.FLOAT:i=new Float32Array(r),o=t.readFloat32;break;case w.DOUBLE:i=new Float64Array(r),o=t.readFloat64;break;default:throw new RangeError("Invalid field type: "+e)}if(e!==w.RATIONAL&&e!==w.SRATIONAL)for(let e=0;e<r;++e)i[e]=o.call(t,n+e*s);else for(let e=0;e<r;e+=2)i[e]=o.call(t,n+e*s),i[e+1]=o.call(t,n+(e*s+4));return e===w.ASCII?new TextDecoder("utf-8").decode(i):i}class ae{constructor(t,e,r){this.fileDirectory=t,this.geoKeyDirectory=e,this.nextIFDByteOffset=r}}class le extends Error{constructor(t){super("No image at index "+t),this.index=t}}class ue{async readRasters(t={}){const{window:e,width:r,height:n}=t;let{resX:i,resY:o,bbox:s}=t;const a=await this.getImage();let l=a;const u=await this.getImageCount(),h=a.getBoundingBox();if(e&&s)throw new Error('Both "bbox" and "window" passed.');if(r||n){if(e){const[t,r]=a.getOrigin(),[n,i]=a.getResolution();s=[t+e[0]*n,r+e[1]*i,t+e[2]*n,r+e[3]*i]}const t=s||h;if(r){if(i)throw new Error("Both width and resX passed");i=(t[2]-t[0])/r}if(n){if(o)throw new Error("Both width and resY passed");o=(t[3]-t[1])/n}}if(i||o){const t=[];for(let e=0;e<u;++e){const r=await this.getImage(e),{SubfileType:n,NewSubfileType:i}=r.fileDirectory;(0===e||2===n||1&i)&&t.push(r)}t.sort((t,e)=>t.getWidth()-e.getWidth());for(let e=0;e<t.length;++e){const r=t[e],n=(h[2]-h[0])/r.getWidth(),s=(h[3]-h[1])/r.getHeight();if(l=r,i&&i>n||o&&o>s)break}}let c=e;if(s){const[t,e]=a.getOrigin(),[r,n]=l.getResolution(a);c=[Math.round((s[0]-t)/r),Math.round((s[1]-e)/n),Math.round((s[2]-t)/r),Math.round((s[3]-e)/n)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return l.readRasters({...t,window:c})}}class he extends ue{constructor(t,e,r,n,i={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const r=this.bigTiff?4048:1024;return new tt((await this.source.fetch([{offset:t,length:void 0!==e?e:r}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,r=this.bigTiff?8:2;let n=await this.getSlice(t);const i=this.bigTiff?n.readUint64(t):n.readUint16(t),o=i*e+(this.bigTiff?16:6);n.covers(t,o)||(n=await this.getSlice(t,o));const s={};let a=t+(this.bigTiff?8:2);for(let t=0;t<i;a+=e,++t){const t=n.readUint16(a),e=n.readUint16(a+2),r=this.bigTiff?n.readUint64(a+4):n.readUint32(a+4);let i,o;const l=oe(e),u=a+(this.bigTiff?12:8);if(l*r<=(this.bigTiff?8:4))i=se(n,e,r,u);else{const t=n.readOffset(u),o=oe(e)*r;if(n.covers(t,o))i=se(n,e,r,t);else{i=se(await this.getSlice(t,o),e,r,t)}}o=1===r&&-1===b.indexOf(t)&&e!==w.RATIONAL&&e!==w.SRATIONAL?i[0]:i,s[g[t]]=o}const l=function(t){const e=t.GeoKeyDirectory;if(!e)return null;const r={};for(let n=4;n<=4*e[3];n+=4){const i=T[e[n]],o=e[n+1]?g[e[n+1]]:null,s=e[n+2],a=e[n+3];let l=null;if(o){if(l=t[o],null==l)throw new Error(`Could not get value of geoKey '${i}'.`);"string"==typeof l?l=l.substring(a,a+s-1):l.subarray&&(l=l.subarray(a,a+s),1===s&&(l=l[0]))}else l=a;r[i]=l}return r}(s),u=n.readOffset(t+r+e*i);return new ae(s,l,u)}async requestIFD(t){if(this.ifdRequests[t])return this.ifdRequests[t];if(0===t)return this.ifdRequests[t]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[t];if(!this.ifdRequests[t-1])try{this.ifdRequests[t-1]=this.requestIFD(t-1)}catch(e){if(e instanceof le)throw new le(t);throw e}return this.ifdRequests[t]=(async()=>{const e=await this.ifdRequests[t-1];if(0===e.nextIFDByteOffset)throw new le(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new Q(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof le))throw t;e=!1}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=",r=e.length+100;let n=await this.getSlice(t,r);if(e===se(n,w.ASCII,e.length,t)){const e=se(n,w.ASCII,r,t).split("\n")[0],i=Number(e.split("=")[1].split(" ")[0])+e.length;i>r&&(n=await this.getSlice(t,i));const o=se(n,w.ASCII,i,t);this.ghostValues={},o.split("\n").filter(t=>t.length>0).map(t=>t.split("=")).forEach(([t,e])=>{this.ghostValues[t]=e})}return this.ghostValues}static async fromSource(t,e,r){const n=(await t.fetch([{offset:0,length:1024}],r))[0],i=new J(n),o=i.getUint16(0,0);let s;if(18761===o)s=!0;else{if(19789!==o)throw new TypeError("Invalid byte order value.");s=!1}const a=i.getUint16(2,s);let l;if(42===a)l=!1;else{if(43!==a)throw new TypeError("Invalid magic number.");l=!0;if(8!==i.getUint16(4,s))throw new Error("Unsupported offset byte-size.")}const u=l?i.getUint64(8,s):i.getUint32(4,s);return new he(t,s,l,u,e)}close(){return"function"==typeof this.source.close&&this.source.close()}}async function ce(t,e){return he.fromSource(new Jt(t),e)}function fe(t,e){return t[e]}function de(t){return Array.isArray(t)?t:[t]}function pe(t){if(!Number.isInteger(t))throw Error("Not an integer.");const e=new ArrayBuffer(4);new DataView(e).setInt32(0,t,!1);const r=new Uint8Array(e);return Array.from(r)}function ge(t){const e=t[t.length-1];return 3===e||4===e}function me(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var be=class{constructor(t,e,r,n,i,o){me(this,"dtype",void 0),me(this,"tileSize",void 0),me(this,"shape",void 0),me(this,"labels",void 0),me(this,"meta",void 0),me(this,"_indexer",void 0),this._indexer=t,this.dtype=e,this.tileSize=r,this.shape=n,this.labels=i,this.meta=o}async getRaster({selection:t,signal:e}){const r=await this._indexer(t);return this._readRasters(r,{signal:e})}async getTile({x:t,y:e,selection:r,signal:n}){const{height:i,width:o}=this._getTileExtent(t,e),s=t*this.tileSize,a=e*this.tileSize,l=[s,a,s+o,a+i],u=await this._indexer(r);return this._readRasters(u,{window:l,width:o,height:i,signal:n})}async _readRasters(t,e){var r;const n=ge(this.shape),i=await t.readRasters({interleave:n,...e});if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw"__vivSignalAborted";return{data:n?i:i[0],width:i.width,height:i.height}}_getTileExtent(t,e){const{height:r,width:n}=function(t){const e=ge(t.shape),[r,n]=t.shape.slice(e?-3:-2);return{height:r,width:n}}(this);let i=this.tileSize,o=this.tileSize;const s=Math.floor(n/this.tileSize),a=Math.floor(r/this.tileSize);return t===s&&(o=n%this.tileSize),e===a&&(i=r%this.tileSize),{height:i,width:o}}onTileError(t){console.error(t)}};function ye(t){const{SizeC:e,SizeZ:r,SizeT:n,DimensionOrder:i}=t.Pixels;switch(i){case"XYZCT":return({t:t,c:n,z:i})=>t*r*e+n*r+i;case"XYZTC":return({t:t,c:e,z:i})=>e*r*n+t*r+i;case"XYCTZ":return({t:t,c:r,z:i})=>i*e*n+t*e+r;case"XYCZT":return({t:t,c:n,z:i})=>t*e*r+i*e+n;case"XYTCZ":return({t:t,c:r,z:i})=>i*n*e+r*n+t;case"XYTZC":return({t:t,c:e,z:i})=>e*n*r+i*n+t;default:throw new Error(`Invalid OME-XML DimensionOrder, got ${i}.`)}}const we={uint8:"Uint8",uint16:"Uint16",uint32:"Uint32",float:"Float32",double:"Float64",int8:"Int8",int16:"Int16",int32:"Int32"};function ve({Pixels:t}){const e=t.DimensionOrder.toLowerCase().split("").reverse();const r=function(t){const e=new Map(t.map((t,e)=>[t,e]));if(e.size!==t.length)throw Error("Labels must be unique, found duplicated label.");return t=>{const r=e.get(t);if(void 0===r)throw Error("Invalid dimension.");return r}}(e),n=Array(e.length).fill(0);n[r("t")]=t.SizeT,n[r("c")]=t.SizeC,n[r("z")]=t.SizeZ,t.Interleaved&&(e.push("_c"),n.push(3));const i=e=>{const i=[...n];return i[r("x")]=t.SizeX>>e,i[r("y")]=t.SizeY>>e,i};if(!(t.Type in we))throw Error(`Pixel type ${t.Type} not supported.`);const o=we[t.Type];if(t.PhysicalSizeX&&t.PhysicalSizeY){const r={x:{size:t.PhysicalSizeX,unit:t.PhysicalSizeXUnit},y:{size:t.PhysicalSizeY,unit:t.PhysicalSizeYUnit}};return t.PhysicalSizeZ&&(r.z={size:t.PhysicalSizeZ,unit:t.PhysicalSizeZUnit}),{labels:e,getShape:i,physicalSizes:r,dtype:o}}return{labels:e,getShape:i,dtype:o}}var _e=r(35),Se=r.n(_e);const Ee={attributeNamePrefix:"",attrNodeName:"attr",parseNodeValue:!0,parseAttributeValue:!0,ignoreAttributes:!1};function xe(t){const e=(t=>Se.a.parse(t,Ee))(t);if(!e.OME)throw Error("Failed to parse OME-XML metadata.");return de(e.OME.Image).map(t=>{const e=de(t.Pixels.Channel).map(t=>"Color"in t.attr?{...t.attr,Color:pe(t.attr.Color)}:{...t.attr}),{AquisitionDate:r="",Description:n=""}=t,i={...t.attr,AquisitionDate:r,Description:n,Pixels:{...t.Pixels.attr,Channels:e}};return{...i,format(){const{Pixels:t}=i,e=["X","Y","Z"].map(e=>{const r=t["PhysicalSize"+e],n=t[`PhysicalSize${e}Unit`];return r&&n?`${r} ${n}`:"-"}).join(" x ");return{"Acquisition Date":i.AquisitionDate,"Dimensions (XY)":`${t.SizeX} x ${t.SizeY}`,"Pixels Type":t.Type,"Pixels Size (XYZ)":e,"Z-sections/Timepoints":`${t.SizeZ} x ${t.SizeT}`,Channels:t.SizeC}}}})}async function ke(t,e){const{ImageDescription:r,SubIFDs:n,PhotometricInterpretation:i}=e.fileDirectory,o=xe(r);let s,a;n?(s=n.length+1,a=function(t,e){const r=ye(e[0]),n=new Map;return async(e,i)=>{const o=r(e),s=await t.getImage(o);if(0===i)return s;const{SubIFDs:a}=s.fileDirectory;if(!a)throw Error("Indexing Error: OME-TIFF is missing SubIFDs.");const l=`${e.t}-${e.c}-${e.z}-${i}`;if(!n.has(l)){const e=a[i-1];n.set(l,t.parseFileDirectoryAt(e))}const u=await n.get(l);return new s.constructor(u.fileDirectory,u.geoKeyDirectory,t.dataView,t.littleEndian,t.cache,t.source)}}(t,o)):(s=o.length,a=function(t,e){const r=e[0],{SizeT:n,SizeC:i,SizeZ:o}=r.Pixels,s=ye(r);return(e,r)=>{const a=s(e),l=r*o*n*i;return t.getImage(a+l)}}(t,o));const l=o[0],{labels:u,getShape:h,physicalSizes:c,dtype:f}=ve(l),d=e.getTileWidth(),p={photometricInterpretation:i,physicalSizes:c};return{data:Array.from({length:s}).map((t,e)=>{const r=h(e);return new be(t=>a(t,e),f,d,r,u,p)}),metadata:l}}async function Ae(t,e={}){const{headers:r,offsets:n}=e;let i;i=t instanceof he?t:"string"==typeof t?await async function(t,e={},r){return he.fromSource(Qt(t,e),r)}(t,r):await ce(t),n&&(i=function(t,e){return new Proxy(t,{get:(t,r)=>"getImage"===r?r=>{if(!(r in t.ifdRequests)&&r in e){const n=e[r];t.ifdRequests[r]=t.parseFileDirectoryAt(n)}return t.getImage(r)}:"__viv-offsets"===r||Reflect.get(t,r)})}(i,n)),function(t){fe(t,"__viv-offsets")||console.warn("GeoTIFF source is missing offsets proxy."),fe(t,"__viv-decoder-pool")||console.warn("GeoTIFF source is missing decoder-pool proxy.")}(i);const o=await i.getImage(0);if(o.fileDirectory.ImageDescription.includes("<OME"))return ke(i,o);throw new Error("GeoTIFF not recognized.")}},function(t,e,r){"use strict";r.r(e),function(t){var e=r(36);globalThis.loaders=globalThis.loaders||{},t.exports=Object.assign(globalThis.loaders,e)}.call(this,r(40)(t))},,,function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){},function(t,e,r){(function(e){var n=r(43).Transform,i=r(7);function o(t){n.call(this,t),this._destroyed=!1}function s(t,e,r){r(null,t)}function a(t){return function(e,r,n){return"function"==typeof e&&(n=r,r=e,e={}),"function"!=typeof r&&(r=s),"function"!=typeof n&&(n=null),t(e,r,n)}}i(o,n),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var r=this;e.nextTick((function(){t&&r.emit("error",t),r.emit("close")}))}},t.exports=a((function(t,e,r){var n=new o(t);return n._transform=e,r&&(n._flush=r),n})),t.exports.ctor=a((function(t,e,r){function n(e){if(!(this instanceof n))return new n(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(n,o),n.prototype._transform=e,r&&(n.prototype._flush=r),n})),t.exports.obj=a((function(t,e,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return n._transform=e,r&&(n._flush=r),n}))}).call(this,r(2))},function(t,e,r){(e=t.exports=r(19)).Stream=e,e.Readable=e,e.Writable=r(24),e.Duplex=r(8),e.Transform=r(26),e.PassThrough=r(54),e.finished=r(17),e.pipeline=r(55)},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=u(t),s=n[0],a=n[1],l=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
9
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?i-1:0,f=r?-1:1,d=t[e+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){},function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(13).Buffer,a=r(49).inspect,l=a&&a.custom||"inspect";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}var e,r,u;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),u&&o(e,u),t}()},function(t,e){},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(10))},function(t,e,r){
11
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
12
- var n=r(13),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e){var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(17),s=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),c=Symbol("handlePromise"),f=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[f].read();null!==r&&(t[h]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){e.nextTick(p,t)}var m=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((i(n={get stream(){return this[f]},next:function(){var t=this,r=this[l];if(null!==r)return Promise.reject(r);if(this[u])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise((function(r,n){e.nextTick((function(){t[l]?n(t[l]):r(d(void 0,!0))}))}));var n,i=this[h];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[u]?r(d(void 0,!0)):e[c](r,n)}),n)}}(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[c])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[f].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},f,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,u,{value:t._readableState.endEmitted,writable:!0}),i(e,c,{value:function(t,e){var n=r[f].read();n?(r[h]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[h]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[h]=null,r[s]=null,r[a]=null,e(t)),void(r[l]=t)}var n=r[s];null!==n&&(r[h]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[u]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this,r(2))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=i;var n=r(26);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(7)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n;var i=r(6).codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function l(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(17)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var l=!1;return function(e){if(!a&&!l)return l=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function u(t){t()}function h(t,e){return t.pipe(e)}function c(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=c(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return l(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(u),o||(s.forEach(u),i(n))}))}));return e.reduce(h)}},function(t,e,r){"use strict";var n=r(14),i=r(57),o=r(58),s=r(59),a=r(60);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function c(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function f(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,c(t))):-2}function d(t,e){var r,n;return t?(n=new u,t.state=n,n.window=null,0!==(r=f(t,e))&&(t.state=null),r):-2}var p,g,m=!0;function b(t){if(m){var e;for(p=new n.Buf32(512),g=new n.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(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,g,0,t.work,{bits:5}),m=!1}t.lencode=p,t.lenbits=9,t.distcode=g,t.distbits=5}function y(t,e,r,i){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,e,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}e.inflateReset=c,e.inflateReset2=f,e.inflateResetKeep=h,e.inflateInit=function(t){return d(t,15)},e.inflateInit2=d,e.inflate=function(t,e){var r,u,h,c,f,d,p,g,m,w,v,_,S,E,x,k,A,C,T,R,O,P,D,I,N=0,M=new n.Buf8(4),F=[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-2;12===(r=t.state).mode&&(r.mode=13),f=t.next_out,h=t.output,p=t.avail_out,c=t.next_in,u=t.input,d=t.avail_in,g=r.hold,m=r.bits,w=d,v=p,P=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(2&r.wrap&&35615===g){r.check=0,M[0]=255&g,M[1]=g>>>8&255,r.check=o(r.check,M,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(m-=4,O=8+(15&(g>>>=4)),0===r.wbits)r.wbits=O;else if(O>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<O,t.adler=r.check=1,r.mode=512&g?10:12,g=0,m=0;break;case 2:for(;m<16;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(r.flags=g,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(M[0]=255&g,M[1]=g>>>8&255,r.check=o(r.check,M,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.head&&(r.head.time=g),512&r.flags&&(M[0]=255&g,M[1]=g>>>8&255,M[2]=g>>>16&255,M[3]=g>>>24&255,r.check=o(r.check,M,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(M[0]=255&g,M[1]=g>>>8&255,r.check=o(r.check,M,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(M[0]=255&g,M[1]=g>>>8&255,r.check=o(r.check,M,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((_=r.length)>d&&(_=d),_&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,c,_,O)),512&r.flags&&(r.check=o(r.check,u,_,c)),d-=_,c+=_,r.length-=_),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;_=0;do{O=u[c+_++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O))}while(O&&_<d);if(512&r.flags&&(r.check=o(r.check,u,_,c)),d-=_,c+=_,O)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break t;_=0;do{O=u[c+_++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O))}while(O&&_<d);if(512&r.flags&&(r.check=o(r.check,u,_,c)),d-=_,c+=_,O)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(g!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}g=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;m<32;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}t.adler=r.check=l(g),g=0,m=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,r.hold=g,r.bits=m,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){g>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}switch(r.last=1&g,m-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(b(r),r.mode=20,6===e){g>>>=2,m-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(_=r.length){if(_>d&&(_=d),_>p&&(_=p),0===_)break t;n.arraySet(h,u,c,_,f),d-=_,c+=_,p-=_,f+=_,r.length-=_;break}r.mode=12;break;case 17:for(;m<14;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(r.nlen=257+(31&g),g>>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.lens[F[r.have++]]=7&g,g>>>=3,m-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,D={bits:r.lenbits},P=a(0,r.lens,0,19,r.lencode,0,r.work,D),r.lenbits=D.bits,P){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;k=(N=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&N,!((x=N>>>24)<=m);){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(A<16)g>>>=x,m-=x,r.lens[r.have++]=A;else{if(16===A){for(I=x+2;m<I;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(g>>>=x,m-=x,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}O=r.lens[r.have-1],_=3+(3&g),g>>>=2,m-=2}else if(17===A){for(I=x+3;m<I;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}m-=x,O=0,_=3+(7&(g>>>=x)),g>>>=3,m-=3}else{for(I=x+7;m<I;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}m-=x,O=0,_=11+(127&(g>>>=x)),g>>>=7,m-=7}if(r.have+_>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;_--;)r.lens[r.have++]=O}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,D={bits:r.lenbits},P=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,D),r.lenbits=D.bits,P){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,D={bits:r.distbits},P=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,D),r.distbits=D.bits,P){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(d>=6&&p>=258){t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,r.hold=g,r.bits=m,s(t,v),f=t.next_out,h=t.output,p=t.avail_out,c=t.next_in,u=t.input,d=t.avail_in,g=r.hold,m=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;k=(N=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&N,!((x=N>>>24)<=m);){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(k&&0==(240&k)){for(C=x,T=k,R=A;k=(N=r.lencode[R+((g&(1<<C+T)-1)>>C)])>>>16&255,A=65535&N,!(C+(x=N>>>24)<=m);){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=x,m-=x,r.back+=x,r.length=A,0===k){r.mode=26;break}if(32&k){r.back=-1,r.mode=12;break}if(64&k){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&k,r.mode=22;case 22:if(r.extra){for(I=r.extra;m<I;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;k=(N=r.distcode[g&(1<<r.distbits)-1])>>>16&255,A=65535&N,!((x=N>>>24)<=m);){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(0==(240&k)){for(C=x,T=k,R=A;k=(N=r.distcode[R+((g&(1<<C+T)-1)>>C)])>>>16&255,A=65535&N,!(C+(x=N>>>24)<=m);){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=x,m-=x,r.back+=x,64&k){t.msg="invalid distance code",r.mode=30;break}r.offset=A,r.extra=15&k,r.mode=24;case 24:if(r.extra){for(I=r.extra;m<I;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break t;if(_=v-p,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}_>r.wnext?(_-=r.wnext,S=r.wsize-_):S=r.wnext-_,_>r.length&&(_=r.length),E=r.window}else E=h,S=f-r.offset,_=r.length;_>p&&(_=p),p-=_,r.length-=_;do{h[f++]=E[S++]}while(--_);0===r.length&&(r.mode=21);break;case 26:if(0===p)break t;h[f++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===d)break t;d--,g|=u[c++]<<m,m+=8}if(v-=p,t.total_out+=v,r.total+=v,v&&(t.adler=r.check=r.flags?o(r.check,h,v,f-v):i(r.check,h,v,f-v)),v=p,(r.flags?g:l(g))!==r.check){t.msg="incorrect data check",r.mode=30;break}g=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===d)break t;d--,g+=u[c++]<<m,m+=8}if(g!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}g=0,m=0}r.mode=29;case 29:P=1;break t;case 30:P=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,r.hold=g,r.bits=m,(r.wsize||v!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&y(t,t.output,t.next_out,v-t.avail_out)?(r.mode=31,-4):(w-=t.avail_in,v-=t.avail_out,t.total_in+=w,t.total_out+=v,r.total+=v,r.wrap&&v&&(t.adler=r.check=r.flags?o(r.check,h,v,t.next_out-v):i(r.check,h,v,t.next_out-v)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===w&&0===v||4===e)&&0===P&&(P=-5),P)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?-2:(r.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,e,n,0)!==r.check?-3:y(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,r){"use strict";t.exports=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,s=i+r;t^=-1;for(var a=i;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},function(t,e,r){"use strict";t.exports=function(t,e){var r,n,i,o,s,a,l,u,h,c,f,d,p,g,m,b,y,w,v,_,S,E,x,k,A;r=t.state,n=t.next_in,k=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),l=r.dmax,u=r.wsize,h=r.whave,c=r.wnext,f=r.window,d=r.hold,p=r.bits,g=r.lencode,m=r.distcode,b=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;t:do{p<15&&(d+=k[n++]<<p,p+=8,d+=k[n++]<<p,p+=8),w=g[d&b];e:for(;;){if(d>>>=v=w>>>24,p-=v,0===(v=w>>>16&255))A[o++]=65535&w;else{if(!(16&v)){if(0==(64&v)){w=g[(65535&w)+(d&(1<<v)-1)];continue e}if(32&v){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}_=65535&w,(v&=15)&&(p<v&&(d+=k[n++]<<p,p+=8),_+=d&(1<<v)-1,d>>>=v,p-=v),p<15&&(d+=k[n++]<<p,p+=8,d+=k[n++]<<p,p+=8),w=m[d&y];r:for(;;){if(d>>>=v=w>>>24,p-=v,!(16&(v=w>>>16&255))){if(0==(64&v)){w=m[(65535&w)+(d&(1<<v)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(S=65535&w,p<(v&=15)&&(d+=k[n++]<<p,(p+=8)<v&&(d+=k[n++]<<p,p+=8)),(S+=d&(1<<v)-1)>l){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=v,p-=v,S>(v=o-s)){if((v=S-v)>h&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=0,x=f,0===c){if(E+=u-v,v<_){_-=v;do{A[o++]=f[E++]}while(--v);E=o-S,x=A}}else if(c<v){if(E+=u+c-v,(v-=c)<_){_-=v;do{A[o++]=f[E++]}while(--v);if(E=0,c<_){_-=v=c;do{A[o++]=f[E++]}while(--v);E=o-S,x=A}}}else if(E+=c-v,v<_){_-=v;do{A[o++]=f[E++]}while(--v);E=o-S,x=A}for(;_>2;)A[o++]=x[E++],A[o++]=x[E++],A[o++]=x[E++],_-=3;_&&(A[o++]=x[E++],_>1&&(A[o++]=x[E++]))}else{E=o-S;do{A[o++]=A[E++],A[o++]=A[E++],A[o++]=A[E++],_-=3}while(_>2);_&&(A[o++]=A[E++],_>1&&(A[o++]=A[E++]))}break}}break}}while(n<i&&o<a);n-=_=p>>3,d&=(1<<(p-=_<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,r.bits=p}},function(t,e,r){"use strict";var n=r(14),i=[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],o=[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],s=[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],a=[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];t.exports=function(t,e,r,l,u,h,c,f){var d,p,g,m,b,y,w,v,_,S=f.bits,E=0,x=0,k=0,A=0,C=0,T=0,R=0,O=0,P=0,D=0,I=null,N=0,M=new n.Buf16(16),F=new n.Buf16(16),j=null,L=0;for(E=0;E<=15;E++)M[E]=0;for(x=0;x<l;x++)M[e[r+x]]++;for(C=S,A=15;A>=1&&0===M[A];A--);if(C>A&&(C=A),0===A)return u[h++]=20971520,u[h++]=20971520,f.bits=1,0;for(k=1;k<A&&0===M[k];k++);for(C<k&&(C=k),O=1,E=1;E<=15;E++)if(O<<=1,(O-=M[E])<0)return-1;if(O>0&&(0===t||1!==A))return-1;for(F[1]=0,E=1;E<15;E++)F[E+1]=F[E]+M[E];for(x=0;x<l;x++)0!==e[r+x]&&(c[F[e[r+x]]++]=x);if(0===t?(I=j=c,y=19):1===t?(I=i,N-=257,j=o,L-=257,y=256):(I=s,j=a,y=-1),D=0,x=0,E=k,b=h,T=C,R=0,g=-1,m=(P=1<<C)-1,1===t&&P>852||2===t&&P>592)return 1;for(;;){w=E-R,c[x]<y?(v=0,_=c[x]):c[x]>y?(v=j[L+c[x]],_=I[N+c[x]]):(v=96,_=0),d=1<<E-R,k=p=1<<T;do{u[b+(D>>R)+(p-=d)]=w<<24|v<<16|_|0}while(0!==p);for(d=1<<E-1;D&d;)d>>=1;if(0!==d?(D&=d-1,D+=d):D=0,x++,0==--M[E]){if(E===A)break;E=e[r+c[x]]}if(E>C&&(D&m)!==g){for(0===R&&(R=C),b+=k,O=1<<(T=E-R);T+R<A&&!((O-=M[T+R])<=0);)T++,O<<=1;if(P+=1<<T,1===t&&P>852||2===t&&P>592)return 1;u[g=D&m]=C<<24|T<<16|b-h|0}}return 0!==D&&(u[b+D]=E-R<<24|64<<16|0),f.bits=C,0}},function(t,e,r){"use strict";var n=r(14),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",s=0;s<e;s++)r+=String.fromCharCode(t[s]);return r}s[254]=s[254]=1,e.string2buf=function(t){var e,r,i,o,s,a=t.length,l=0;for(o=0;o<a;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(l),s=0,o=0;s<l;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},e.buf2binstring=function(t){return l(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,n,i,o,a=e||t.length,u=new Array(2*a);for(n=0,r=0;r<a;)if((i=t[r++])<128)u[n++]=i;else if((o=s[i])>4)u[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&t[r++],o--;o>1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return l(u,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e}},function(t,e,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,r){"use strict";t.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"}},function(t,e,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,r){t.exports=function(t){function e(t){let r,i=null;function o(...t){if(!o.enabled)return;const n=o,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";a++;const o=e.formatters[i];if("function"==typeof o){const e=t[a];r=o.call(n,e),t.splice(a,1),a--}return r}),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return o.namespace=t,o.useColors=e.useColors(),o.color=e.selectColor(t),o.extend=n,o.destroy=e.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?e.enabled(t):i,set:t=>{i=t}}),"function"==typeof e.init&&e.init(o),o}function n(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map(t=>"-"+t)].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(67),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(r=>{e[r]=t[r]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},function(t,e){var r=1e3,n=6e4,i=60*n,o=24*i;function s(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,e){e=e||{};var a=typeof t;if("string"===a&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(t);if("number"===a&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=o)return s(t,e,o,"day");if(e>=i)return s(t,e,i,"hour");if(e>=n)return s(t,e,n,"minute");if(e>=r)return s(t,e,r,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=o)return Math.round(t/o)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=n)return Math.round(t/n)+"m";if(e>=r)return Math.round(t/r)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){"use strict";function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}function i(t,e,r){var n=e===t.head?new a(r,null,e,t):new a(r,e,e.next,t);return null===n.next&&(t.tail=n),null===n.prev&&(t.head=n),t.length++,n}function o(t,e){t.tail=new a(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function s(t,e){t.head=new a(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function a(t,e,r,n){if(!(this instanceof a))return new a(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}t.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e},n.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},n.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},n.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)o(this,arguments[t]);return this.length},n.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)s(this,arguments[t]);return this.length},n.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},n.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},n.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;null!==r;n++)t.call(e,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;null!==r;n--)t.call(e,r.value,n,this),r=r.prev},n.prototype.get=function(t){for(var e=0,r=this.head;null!==r&&e<t;e++)r=r.next;if(e===t&&null!==r)return r.value},n.prototype.getReverse=function(t){for(var e=0,r=this.tail;null!==r&&e<t;e++)r=r.prev;if(e===t&&null!==r)return r.value},n.prototype.map=function(t,e){e=e||this;for(var r=new n,i=this.head;null!==i;)r.push(t.call(e,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(t,e){e=e||this;for(var r=new n,i=this.tail;null!==i;)r.push(t.call(e,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<e;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&i>e;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,o=this.head;null!==o&&n<t;n++)o=o.next;var s=[];for(n=0;o&&n<e;n++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};try{r(69)(n)}catch(t){}},function(t,e,r){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,l=2147483647,u=/^xn--/,h=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw new RangeError(f[t])}function m(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function b(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+m((t=t.replace(c,".")).split("."),e).join(".")}function y(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function w(t){return m(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function v(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function _(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function S(t){var e,r,n,i,o,s,a,u,h,c,f,p=[],m=t.length,b=0,y=128,v=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&g("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=b,s=1,a=36;i>=m&&g("invalid-input"),((u=(f=t.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>d((l-b)/s))&&g("overflow"),b+=u*s,!(u<(h=a<=v?1:a>=v+26?26:a-v));a+=36)s>d(l/(c=36-h))&&g("overflow"),s*=c;v=_(b-o,e=p.length+1,0==o),d(b/e)>l-y&&g("overflow"),y+=d(b/e),b%=e,p.splice(b++,0,y)}return w(p)}function E(t){var e,r,n,i,o,s,a,u,h,c,f,m,b,w,S,E=[];for(m=(t=y(t)).length,e=128,r=0,o=72,s=0;s<m;++s)(f=t[s])<128&&E.push(p(f));for(n=i=E.length,i&&E.push("-");n<m;){for(a=l,s=0;s<m;++s)(f=t[s])>=e&&f<a&&(a=f);for(a-e>d((l-r)/(b=n+1))&&g("overflow"),r+=(a-e)*b,e=a,s=0;s<m;++s)if((f=t[s])<e&&++r>l&&g("overflow"),f==e){for(u=r,h=36;!(u<(c=h<=o?1:h>=o+26?26:h-o));h+=36)S=u-c,w=36-c,E.push(p(v(c+S%w,0))),u=d(S/w);E.push(p(v(u,0))),o=_(r,b,n==i),r=0,++n}++r,++e}return E.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:w},decode:S,encode:E,toASCII:function(t){return b(t,(function(t){return h.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return b(t,(function(t){return u.test(t)?S(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return a}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(71)(t),r(10))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(74),e.encode=e.stringify=r(75)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var h=0;h<u;++h){var c,f,d,p,g=t[h].replace(a,"%20"),m=g.indexOf(r);m>=0?(c=g.substr(0,m),f=g.substr(m+1)):(c=g,f=""),d=decodeURIComponent(c),p=decodeURIComponent(f),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";const n=r(1),i=function(t,e,r){const o={};if((!t.child||n.isEmptyObject(t.child))&&(!t.attrsMap||n.isEmptyObject(t.attrsMap)))return n.isExist(t.val)?t.val:"";if(n.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)){const i=n.isTagNameInArrayMode(t.tagname,e.arrayMode,r);o[e.textNodeName]=i?[t.val]:t.val}n.merge(o,t.attrsMap,e.arrayMode);const s=Object.keys(t.child);for(let a=0;a<s.length;a++){const l=s[a];if(t.child[l]&&t.child[l].length>1){o[l]=[];for(let r in t.child[l])t.child[l].hasOwnProperty(r)&&o[l].push(i(t.child[l][r],e,l))}else{const s=i(t.child[l][0],e,l),a=!0===e.arrayMode&&"object"==typeof s||n.isTagNameInArrayMode(l,e.arrayMode,r);o[l]=a?[s]:s}}return o};e.convertToJson=i},function(t,e,r){"use strict";t.exports=function(t,e,r){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=r,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}}},function(t,e,r){"use strict";const n=r(1),i={allowBooleanAttributes:!1},o=["allowBooleanAttributes"];function s(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return f("InvalidXml","XML declaration allowed only at the start of the document.",p(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&(r--,0===r))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=n.buildOptions(e,i,o);const r=[];let u=!1,d=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let i=0;i<t.length;i++)if("<"===t[i]&&"?"===t[i+1]){if(i+=2,i=s(t,i),i.err)return i}else{if("<"!==t[i]){if(" "===t[i]||"\t"===t[i]||"\n"===t[i]||"\r"===t[i])continue;return f("InvalidChar","char '"+t[i]+"' is not expected.",p(t,i))}if(i++,"!"===t[i]){i=a(t,i);continue}{let o=!1;"/"===t[i]&&(o=!0,i++);let m="";for(;i<t.length&&">"!==t[i]&&" "!==t[i]&&"\t"!==t[i]&&"\n"!==t[i]&&"\r"!==t[i];i++)m+=t[i];if(m=m.trim(),"/"===m[m.length-1]&&(m=m.substring(0,m.length-1),i--),g=m,!n.isName(g)){let e;return e=0===m.trim().length?"There is an unnecessary space between tag name and backward slash '</ ..'.":"Tag '"+m+"' is an invalid name.",f("InvalidTag",e,p(t,i))}const b=l(t,i);if(!1===b)return f("InvalidAttr","Attributes for '"+m+"' have open quote.",p(t,i));let y=b.value;if(i=b.index,"/"===y[y.length-1]){y=y.substring(0,y.length-1);const r=h(y,e);if(!0!==r)return f(r.err.code,r.err.msg,p(t,i-y.length+r.err.line));u=!0}else if(o){if(!b.tagClosed)return f("InvalidTag","Closing tag '"+m+"' doesn't have proper closing.",p(t,i));if(y.trim().length>0)return f("InvalidTag","Closing tag '"+m+"' can't have attributes or invalid starting.",p(t,i));{const e=r.pop();if(m!==e)return f("InvalidTag","Closing tag '"+e+"' is expected inplace of '"+m+"'.",p(t,i));0==r.length&&(d=!0)}}else{const n=h(y,e);if(!0!==n)return f(n.err.code,n.err.msg,p(t,i-y.length+n.err.line));if(!0===d)return f("InvalidXml","Multiple possible root nodes found.",p(t,i));r.push(m),u=!0}for(i++;i<t.length;i++)if("<"===t[i]){if("!"===t[i+1]){i++,i=a(t,i);continue}if("?"!==t[i+1])break;if(i=s(t,++i),i.err)return i}else if("&"===t[i]){const e=c(t,i);if(-1==e)return f("InvalidChar","char '&' is not expected.",p(t,i));i=e}"<"===t[i]&&i--}}var g;return u?!(r.length>0)||f("InvalidXml","Invalid '"+JSON.stringify(r,null,4).replace(/\r?\n/g,"")+"' found.",1):f("InvalidXml","Start tag expected.",1)};function l(t,e){let r="",n="",i=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])if(""===n)n=t[e];else{if(n!==t[e])continue;n=""}else if(">"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}const u=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(t,e){const r=n.getAllMatches(t,u),i={};for(let n=0;n<r.length;n++){if(0===r[n][1].length)return f("InvalidAttr","Attribute '"+r[n][2]+"' has no space in starting.",g(t,r[n][0]));if(void 0===r[n][3]&&!e.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+r[n][2]+"' is not allowed.",g(t,r[n][0]));const o=r[n][2];if(!d(o))return f("InvalidAttr","Attribute '"+o+"' is an invalid name.",g(t,r[n][0]));if(i.hasOwnProperty(o))return f("InvalidAttr","Attribute '"+o+"' is repeated.",g(t,r[n][0]));i[o]=1}return!0}function c(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);let r=0;for(;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function f(t,e,r){return{err:{code:t,msg:e,line:r}}}function d(t){return n.isName(t)}function p(t,e){return t.substring(0,e).split(/\r?\n/).length}function g(t,e){return t.indexOf(e)+e.length}},function(t,e,r){"use strict";const n=function(t){return String.fromCharCode(t)},i={nilChar:n(176),missingChar:n(201),nilPremitive:n(175),missingPremitive:n(200),emptyChar:n(178),emptyValue:n(177),boundryChar:n(179),objStart:n(198),arrStart:n(204),arrayEnd:n(185)},o=[i.nilChar,i.nilPremitive,i.missingChar,i.missingPremitive,i.boundryChar,i.emptyChar,i.emptyValue,i.arrayEnd,i.objStart,i.arrStart],s=function(t,e,r){if("string"==typeof e)return t&&t[0]&&void 0!==t[0].val?a(t[0].val,e):a(t,e);{const o=void 0===(n=t)?i.missingChar:null===n?i.nilChar:!(n.child&&0===Object.keys(n.child).length&&(!n.attrsMap||0===Object.keys(n.attrsMap).length))||i.emptyChar;if(!0===o){let n="";if(Array.isArray(e)){n+=i.arrStart;const o=e[0],u=t.length;if("string"==typeof o)for(let e=0;e<u;e++){const r=a(t[e].val,o);n=l(n,r)}else for(let e=0;e<u;e++){const i=s(t[e],o,r);n=l(n,i)}n+=i.arrayEnd}else{n+=i.objStart;const o=Object.keys(e);Array.isArray(t)&&(t=t[0]);for(let i in o){const a=o[i];let u;u=!r.ignoreAttributes&&t.attrsMap&&t.attrsMap[a]?s(t.attrsMap[a],e[a],r):a===r.textNodeName?s(t.val,e[a],r):s(t.child[a],e[a],r),n=l(n,u)}}return n}return o}var n},a=function(t){switch(t){case void 0:return i.missingPremitive;case null:return i.nilPremitive;case"":return i.emptyValue;default:return t}},l=function(t,e){return u(e[0])||u(t[t.length-1])||(t+=i.boundryChar),t+e},u=function(t){return-1!==o.indexOf(t)};const h=r(15),c=r(1).buildOptions;e.convert2nimn=function(t,e,r){return r=c(r,h.defaultOptions,h.props),s(t,e,r)}},function(t,e,r){"use strict";const n=r(1),i=r(1).buildOptions,o=r(15),s=function(t,e,r){let i="{";const o=Object.keys(t.child);for(let r=0;r<o.length;r++){var a=o[r];if(t.child[a]&&t.child[a].length>1){for(var l in i+='"'+a+'" : [ ',t.child[a])i+=s(t.child[a][l],e)+" , ";i=i.substr(0,i.length-1)+" ] "}else i+='"'+a+'" : '+s(t.child[a][0],e)+" ,"}return n.merge(i,t.attrsMap),n.isEmptyObject(i)?n.isExist(t.val)?t.val:"":(n.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)&&(i+='"'+e.textNodeName+'" : '+(!0!==(u=t.val)&&!1!==u&&isNaN(u)?'"'+u+'"':u)),","===i[i.length-1]&&(i=i.substr(0,i.length-2)),i+"}");var u};e.convertToJsonString=function(t,e){return(e=i(e,o.defaultOptions,o.props)).indentBy=e.indentBy||"",s(t,e,0)}},function(t,e,r){"use strict";const n=r(1).buildOptions,i={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},o=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function s(t){this.options=n(t,i,o),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.options.cdataTagName?this.isCDATA=g:this.isCDATA=function(){return!1},this.replaceCDATAstr=a,this.replaceCDATAarr=l,this.options.format?(this.indentate=d,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=f,this.buildObjNode=h):(this.buildTextNode=c,this.buildObjNode=u),this.buildTextValNode=c,this.buildObjectNode=u}function a(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"<![CDATA["+e+"]]"+this.tagEndChar:t.replace(this.options.cdataPositionChar,"<![CDATA["+e+"]]"+this.tagEndChar)}function l(t,e){if(t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t)return t+"<![CDATA["+e.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(let r in e)t=t.replace(this.options.cdataPositionChar,"<![CDATA["+e[r]+"]]>");return t+this.newLine}function u(t,e,r,n){return r&&!t.includes("<")?this.indentate(n)+"<"+e+r+">"+t+"</"+e+this.tagEndChar:this.indentate(n)+"<"+e+r+this.tagEndChar+t+this.indentate(n)+"</"+e+this.tagEndChar}function h(t,e,r,n){return""!==t?this.buildObjectNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function c(t,e,r,n){return this.indentate(n)+"<"+e+r+">"+this.options.tagValueProcessor(t)+"</"+e+this.tagEndChar}function f(t,e,r,n){return""!==t?this.buildTextValNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function d(t){return this.options.indentBy.repeat(t)}function p(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}function g(t){return t===this.options.cdataTagName}s.prototype.parse=function(t){return this.j2x(t,0).val},s.prototype.j2x=function(t,e){let r="",n="";const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];if(void 0===t[o]);else if(null===t[o])n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)n+=this.buildTextNode(t[o],o,"",e);else if("object"!=typeof t[o]){const i=this.isAttribute(o);i?r+=" "+i+'="'+this.options.attrValueProcessor(""+t[o])+'"':this.isCDATA(o)?t[this.options.textNodeName]?n+=this.replaceCDATAstr(t[this.options.textNodeName],t[o]):n+=this.replaceCDATAstr("",t[o]):o===this.options.textNodeName?t[this.options.cdataTagName]||(n+=this.options.tagValueProcessor(""+t[o])):n+=this.buildTextNode(t[o],o,"",e)}else if(Array.isArray(t[o]))if(this.isCDATA(o))n+=this.indentate(e),t[this.options.textNodeName]?n+=this.replaceCDATAarr(t[this.options.textNodeName],t[o]):n+=this.replaceCDATAarr("",t[o]);else{const r=t[o].length;for(let i=0;i<r;i++){const r=t[o][i];if(void 0===r);else if(null===r)n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof r){const t=this.j2x(r,e+1);n+=this.buildObjNode(t.val,o,t.attrStr,e)}else n+=this.buildTextNode(r,o,"",e)}}else if(this.options.attrNodeName&&o===this.options.attrNodeName){const e=Object.keys(t[o]),n=e.length;for(let i=0;i<n;i++)r+=" "+e[i]+'="'+this.options.attrValueProcessor(""+t[o][e[i]])+'"'}else{const r=this.j2x(t[o],e+1);n+=this.buildObjNode(r.val,o,r.attrStr,e)}}return{attrStr:r,val:n}},t.exports=s},,,function(t,e,r){"use strict";var n=r(11),i=r(30);var o=function(t){"function"==typeof t?t():t&&"function"==typeof t.unsubscribe&&t.unsubscribe()};e.a=function(t){const e=new i.a;let r,s=0;return new n.a(n=>{r||(r=t.subscribe(e));const i=e.subscribe(n);return s++,()=>{s--,i.unsubscribe(),0===s&&(o(r),r=void 0)}})}}])}));
13
- //# sourceMappingURL=dist.min.js.map