scratch-storage 2.0.0 → 2.0.1
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.
- package/dist/node/scratch-storage.js +4 -2
- package/dist/node/scratch-storage.js.map +1 -1
- package/dist/web/scratch-storage.js +4 -2
- package/dist/web/scratch-storage.js.map +1 -1
- package/dist/web/scratch-storage.min.js +4 -2
- package/dist/web/scratch-storage.min.js.map +1 -1
- package/package.json +2 -2
- package/src/FetchWorkerTool.js +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratch-storage.js","sources":["webpack://ScratchStorage/webpack/bootstrap","webpack://ScratchStorage/./src/builtins/defaultBitmap.png","webpack://ScratchStorage/./src/builtins/defaultSound.wav","webpack://ScratchStorage/./src/builtins/defaultVector.svg","webpack://ScratchStorage/./node_modules/arraybuffer-loader/lib/to-array-buffer.js","webpack://ScratchStorage/./node_modules/fastestsmallesttextencoderdecoder/NodeJS/EncoderAndDecoderNodeJS.min.mjs","webpack://ScratchStorage/./node_modules/microee/index.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/filter.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/transform.js","webpack://ScratchStorage/./node_modules/minilog/lib/index.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/console.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/clean.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/color.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/learnboost.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/npm.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/time.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/util.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/withstack.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/redis.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/stringify.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/console.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/color.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/util.js","webpack://ScratchStorage/./node_modules/node-fetch/lib/index.mjs","webpack://ScratchStorage/./src/FetchWorkerTool.worker.js","webpack://ScratchStorage/./node_modules/worker-loader/dist/workers/InlineWorker.js","webpack://ScratchStorage/./src/Asset.js","webpack://ScratchStorage/./src/AssetType.js","webpack://ScratchStorage/./src/BuiltinHelper.js","webpack://ScratchStorage/./src/DataFormat.js","webpack://ScratchStorage/./src/FetchTool.js","webpack://ScratchStorage/./src/FetchWorkerTool.js","webpack://ScratchStorage/./src/Helper.js","webpack://ScratchStorage/./src/ProxyTool.js","webpack://ScratchStorage/./src/ScratchStorage.js","webpack://ScratchStorage/./src/WebHelper.js","webpack://ScratchStorage/./src/index.js","webpack://ScratchStorage/./src/log.js","webpack://ScratchStorage/external \"base64-js\"","webpack://ScratchStorage/external \"http\"","webpack://ScratchStorage/external \"https\"","webpack://ScratchStorage/external \"js-md5\"","webpack://ScratchStorage/external \"stream\"","webpack://ScratchStorage/external \"url\"","webpack://ScratchStorage/external \"util\"","webpack://ScratchStorage/external \"zlib\""],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAAAAADmVT4XAAADZElEQVR42u3a70vbQBgH8O/7vOibvsmbFUEEWUGGUhQ25nDuhSKIUFDxlYi0SAd94atRmFiHCH2x4W8iiNtwowXRgd1QipJYY3N/1F4kTQ6XLKS9yyHcvWyO8MnT5y53Tw5EcIMESIAESIAESIAESIAEPFVAq/6l8G4oAQCp4aniwbUVJ6BVzafwqKXy1VZMgNb+CHzbyK4ZB+Bi0nnk0VyhsDiSoAmvvnMHmGUVAF6UG+0ffsxRhsRHky/AyCsAUpumX0wAAIs6T4CxDADDtcdZsal6gjmdH8AsAEC6+s8Fa48SFExeAKusAEju+V367AmUCi9ANQ0AU3pwcOw2cMEH0FwAAKz5X228pRLR5AI4TgIAtIDL24oLUE94AB6W7LsH/cONN14Ilh44AOqD9s2LQR1KHiB9zgGgOSGeuA3ocPrME1Q4ANaceyePAzrcjHmAZYs9IBeW4/fzHiAwTCwAgTle9ACZK44ALDT9e6x7gL4aT0BQCHb4AqgA5/1TTOMLoJ7vZSMM0H/GHnCeDnu+CrU8vGYPcN5FADBYD0vCaYPDy+i0p337GSMsS1Z4vA3t9QgAZTt0IuIxFRPSKicAQHlvhk3FXF5GhBByMa8qo/sBO6BarwuYbYrYnFKDYEvE7phKgcxvEQBqnvhgiQCUOgoAO4C3JOS3L/hv23UXxVldBECfcueAqpAa0WGy/QeULREAY6aTXRFDgBuA13+ElOncAERMAGaA9hBQD4gQQHsIRE1AZoD2xrgQS5nOZyHgFKmWDSIG4GRAVidiAE4GRB6AzAB2AKIPQFaA5myHA5AV4ESNugZhC7BLR50lIBPAebrzBGQCKAFQNSIMcDvRTQIwAHxNApM3RBygGK0uyhxwOwGsPAgEnPWj5ycRCNiJtBHlAChGKQVwANzPY+CXSMDNWISiLA9AfRA5IhJQ68UnoQAt+AtOPIBKhJosF8B6UM0yLkAxQk2WCyDX9SiUh1gkQAIkoCuAvjGuquMbuijAtwG7MPL8yBICOHSPk3W8Ne8KcEUdmBi6FADYos+QleIH0N/ogOxd7AD6uAS6WRU8WcBdlgZMG/EnYUlwEpLLoQ4PjzGbiA5UsRMRsbQ+5ziDJmYqJuR6NaMomdXuFuZyPSABEiABEiABEiABEiAc8Bd6VyvCEKGqcQAAAABJRU5ErkJggg==\")","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"UklGRiYAAABXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YQIAAAAAAA==\")","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8Zz4KICA8cmVjdCBmaWxsPSIjQ0NDIiBoZWlnaHQ9IjEyOCIgd2lkdGg9IjEyOCIvPgogIDx0ZXh0IGZpbGw9ImJsYWNrIiB5PSIxMDciIHg9IjM1LjUiIGZvbnQtc2l6ZT0iMTI4Ij4/PC90ZXh0PgogPC9nPgo8L3N2Zz4K\")","'use strict'\n\nmodule.exports = function (base64Data) {\n var isBrowser = typeof window !== 'undefined' && typeof window.atob === 'function'\n var binary = isBrowser ? window.atob(base64Data) : Buffer.from(base64Data, 'base64').toString('binary')\n var bytes = new Uint8Array(binary.length)\n\n for (var i = 0; i < binary.length; ++i) {\n bytes[i] = binary.charCodeAt(i)\n }\n\n return bytes.buffer\n}\n","'use strict';var a=\"undefined\"==typeof global?\"undefined\"===typeof self?{}:self:global,p=String.fromCharCode,q={}.toString,r=a.SharedArrayBuffer,v=r?q.call(r):\"\",w=a.Uint8Array,x=w?q.call(ArrayBuffer.prototype):\"\",y=a.Buffer;try{!y&&a.require&&(y=a.require(\"Buffer\"));var z=y.prototype,A=q.call(z)}catch(g){}var B=y.allocUnsafe,C=!!w&&!y,D=new Uint16Array(32),E=!y||!!w&&w.prototype.isPrototypeOf(z),G=F.prototype;function H(){}\nfunction I(g){var h=g&&g.buffer||g,c=q.call(h);if(c!==x&&c!==A&&c!==v&&\"[object ArrayBuffer]\"!==c&&void 0!==g)throw TypeError(\"Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'\");g=E?new w(h):h||[];c=h=\"\";for(var b=0,d=g.length|0,u=d-32|0,f,e,k=0,t=0,m,l=0,n=-1;b<d;){for(f=b<=u?32:d-b|0;l<f;b=b+1|0,l=l+1|0){e=g[b]&255;switch(e>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<e){b=b-1|0;break}k=(e&7)<<6|m&63;t=5;e=256;case 14:m=g[b=b+1|0]&\n255,k<<=6,k|=(e&15)<<6|m&63,t=2===m>>6?t+4|0:24,e=e+256&768;case 13:case 12:m=g[b=b+1|0]&255,k<<=6,k|=(e&31)<<6|m&63,t=t+7|0,b<d&&2===m>>6&&k>>t&&1114112>k?(e=k,k=k-65536|0,0<=k&&(n=(k>>10)+55296|0,e=(k&1023)+56320|0,31>l?(D[l]=n,l=l+1|0,n=-1):(m=n,n=e,e=m))):(e>>=8,b=b-e-1|0,e=65533),k=t=0,f=b<=u?32:d-b|0;default:D[l]=e;continue;case 11:case 10:case 9:case 8:}D[l]=65533}c+=p(D[0],D[1],D[2],D[3],D[4],D[5],D[6],D[7],D[8],D[9],D[10],D[11],D[12],D[13],D[14],D[15],D[16],D[17],D[18],D[19],D[20],D[21],\nD[22],D[23],D[24],D[25],D[26],D[27],D[28],D[29],D[30],D[31]);32>l&&(c=c.slice(0,l-32|0));if(b<d){if(D[0]=n,l=~n>>>31,n=-1,c.length<h.length)continue}else-1!==n&&(c+=p(n));h+=c;c=\"\"}return h}H.prototype.decode=I;function F(){}\nfunction J(g){g=void 0===g?\"\":\"\"+g;var h=g.length|0,c=C?new w((h<<1)+8|0):B?B((h<<1)+8|0):new y((h<<1)+8|0),b,d=0,u=!1;for(b=0;b<h;b=b+1|0,d=d+1|0){var f=g.charCodeAt(b)|0;if(127>=f)c[d]=f;else{if(2047>=f)c[d]=192|f>>6;else{a:{if(55296<=f)if(56320>f){var e=g.charCodeAt(b=b+1|0)|0;if(56320<=e&&57343>=e){f=(f<<10)+e-56613888|0;if(65535<f){c[d]=240|f>>18;c[d=d+1|0]=128|f>>12&63;c[d=d+1|0]=128|f>>6&63;c[d=d+1|0]=128|f&63;continue}break a}f=65533}else 57343>=f&&(f=65533);!u&&b<<1<d&&b<<1<(d-7|0)&&(u=!0,\ne=C?new w(3*h):B?B(3*h):new y(3*h),e.set(c),c=e)}c[d]=224|f>>12;c[d=d+1|0]=128|f>>6&63}c[d=d+1|0]=128|f&63}}return c.subarray(0,d)}G.encode=J;function K(g,h){var c=g[h];return function(){return c.apply(g,arguments)}}var L=a.TextDecoder,M=a.TextEncoder;var TextDecoder=L||H,TextEncoder=M||F,decode=L?K(new L,\"decode\"):I,encode=M?K(new M,\"encode\"):J;export{TextDecoder,TextEncoder,decode,encode};//AnonyCo\n//# sourceMappingURL=https://cdn.jsdelivr.net/gh/AnonyCo/FastestSmallestTextEncoderDecoder/NodeJS/EncoderAndDecoderNodeJS.min.mjs.map\n","function M() { this._events = {}; }\nM.prototype = {\n on: function(ev, cb) {\n this._events || (this._events = {});\n var e = this._events;\n (e[ev] || (e[ev] = [])).push(cb);\n return this;\n },\n removeListener: function(ev, cb) {\n var e = this._events[ev] || [], i;\n for(i = e.length-1; i >= 0 && e[i]; i--){\n if(e[i] === cb || e[i].cb === cb) { e.splice(i, 1); }\n }\n },\n removeAllListeners: function(ev) {\n if(!ev) { this._events = {}; }\n else { this._events[ev] && (this._events[ev] = []); }\n },\n listeners: function(ev) {\n return (this._events ? this._events[ev] || [] : []);\n },\n emit: function(ev) {\n this._events || (this._events = {});\n var args = Array.prototype.slice.call(arguments, 1), i, e = this._events[ev] || [];\n for(i = e.length-1; i >= 0 && e[i]; i--){\n e[i].apply(this, args);\n }\n return this;\n },\n when: function(ev, cb) {\n return this.once(ev, cb, true);\n },\n once: function(ev, cb, when) {\n if(!cb) return this;\n function c() {\n if(!when) this.removeListener(ev, c);\n if(cb.apply(this, arguments) && when) this.removeListener(ev, c);\n }\n c.cb = cb;\n this.on(ev, c);\n return this;\n }\n};\nM.mixin = function(dest) {\n var o = M.prototype, k;\n for (k in o) {\n o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);\n }\n};\nmodule.exports = M;\n","// default filter\nvar Transform = require('./transform.js');\n\nvar levelMap = { debug: 1, info: 2, warn: 3, error: 4 };\n\nfunction Filter() {\n this.enabled = true;\n this.defaultResult = true;\n this.clear();\n}\n\nTransform.mixin(Filter);\n\n// allow all matching, with level >= given level\nFilter.prototype.allow = function(name, level) {\n this._white.push({ n: name, l: levelMap[level] });\n return this;\n};\n\n// deny all matching, with level <= given level\nFilter.prototype.deny = function(name, level) {\n this._black.push({ n: name, l: levelMap[level] });\n return this;\n};\n\nFilter.prototype.clear = function() {\n this._white = [];\n this._black = [];\n return this;\n};\n\nfunction test(rule, name) {\n // use .test for RegExps\n return (rule.n.test ? rule.n.test(name) : rule.n == name);\n};\n\nFilter.prototype.test = function(name, level) {\n var i, len = Math.max(this._white.length, this._black.length);\n for(i = 0; i < len; i++) {\n if(this._white[i] && test(this._white[i], name) && levelMap[level] >= this._white[i].l) {\n return true;\n }\n if(this._black[i] && test(this._black[i], name) && levelMap[level] <= this._black[i].l) {\n return false;\n }\n }\n return this.defaultResult;\n};\n\nFilter.prototype.write = function(name, level, args) {\n if(!this.enabled || this.test(name, level)) {\n return this.emit('item', name, level, args);\n }\n};\n\nmodule.exports = Filter;\n","var Transform = require('./transform.js'),\n Filter = require('./filter.js');\n\nvar log = new Transform(),\n slice = Array.prototype.slice;\n\nexports = module.exports = function create(name) {\n var o = function() { log.write(name, undefined, slice.call(arguments)); return o; };\n o.debug = function() { log.write(name, 'debug', slice.call(arguments)); return o; };\n o.info = function() { log.write(name, 'info', slice.call(arguments)); return o; };\n o.warn = function() { log.write(name, 'warn', slice.call(arguments)); return o; };\n o.error = function() { log.write(name, 'error', slice.call(arguments)); return o; };\n o.log = o.debug; // for interface compliance with Node and browser consoles\n o.suggest = exports.suggest;\n o.format = log.format;\n return o;\n};\n\n// filled in separately\nexports.defaultBackend = exports.defaultFormatter = null;\n\nexports.pipe = function(dest) {\n return log.pipe(dest);\n};\n\nexports.end = exports.unpipe = exports.disable = function(from) {\n return log.unpipe(from);\n};\n\nexports.Transform = Transform;\nexports.Filter = Filter;\n// this is the default filter that's applied when .enable() is called normally\n// you can bypass it completely and set up your own pipes\nexports.suggest = new Filter();\n\nexports.enable = function() {\n if(exports.defaultFormatter) {\n return log.pipe(exports.suggest) // filter\n .pipe(exports.defaultFormatter) // formatter\n .pipe(exports.defaultBackend); // backend\n }\n return log.pipe(exports.suggest) // filter\n .pipe(exports.defaultBackend); // formatter\n};\n\n","var microee = require('microee');\n\n// Implements a subset of Node's stream.Transform - in a cross-platform manner.\nfunction Transform() {}\n\nmicroee.mixin(Transform);\n\n// The write() signature is different from Node's\n// --> makes it much easier to work with objects in logs.\n// One of the lessons from v1 was that it's better to target\n// a good browser rather than the lowest common denominator\n// internally.\n// If you want to use external streams, pipe() to ./stringify.js first.\nTransform.prototype.write = function(name, level, args) {\n this.emit('item', name, level, args);\n};\n\nTransform.prototype.end = function() {\n this.emit('end');\n this.removeAllListeners();\n};\n\nTransform.prototype.pipe = function(dest) {\n var s = this;\n // prevent double piping\n s.emit('unpipe', dest);\n // tell the dest that it's being piped to\n dest.emit('pipe', s);\n\n function onItem() {\n dest.write.apply(dest, Array.prototype.slice.call(arguments));\n }\n function onEnd() { !dest._isStdio && dest.end(); }\n\n s.on('item', onItem);\n s.on('end', onEnd);\n\n s.when('unpipe', function(from) {\n var match = (from === dest) || typeof from == 'undefined';\n if(match) {\n s.removeListener('item', onItem);\n s.removeListener('end', onEnd);\n dest.emit('unpipe');\n }\n return match;\n });\n\n return dest;\n};\n\nTransform.prototype.unpipe = function(from) {\n this.emit('unpipe', from);\n return this;\n};\n\nTransform.prototype.format = function(dest) {\n throw new Error([\n 'Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:',\n 'var Minilog = require(\\'minilog\\');',\n 'Minilog',\n ' .pipe(Minilog.backends.console.formatClean)',\n ' .pipe(Minilog.backends.console);'].join('\\n'));\n};\n\nTransform.mixin = function(dest) {\n var o = Transform.prototype, k;\n for (k in o) {\n o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);\n }\n};\n\nmodule.exports = Transform;\n","module.exports = require('./common/minilog.js');\n\nvar consoleLogger = require('./node/console.js');\n\n// if we are running inside Electron then use the web version of console.js\nvar isElectron = (typeof window !== 'undefined' && window.process && window.process.type === 'renderer');\nif (isElectron) {\n consoleLogger = require('./web/console.js').minilog;\n}\n\n// intercept the pipe method and transparently wrap the stringifier, if the\n// destination is a Node core stream\n\nmodule.exports.Stringifier = require('./node/stringify.js');\n\nvar oldPipe = module.exports.pipe;\nmodule.exports.pipe = function(dest) {\n if(dest instanceof require('stream')) {\n return oldPipe.call(module.exports, new (module.exports.Stringifier)).pipe(dest);\n } else {\n return oldPipe.call(module.exports, dest);\n }\n};\n\nmodule.exports.defaultBackend = consoleLogger;\nmodule.exports.defaultFormatter = consoleLogger.formatMinilog;\n\nmodule.exports.backends = {\n redis: require('./node/redis.js'),\n nodeConsole: consoleLogger,\n console: consoleLogger\n};\n","var Transform = require('../common/transform.js');\n\nfunction ConsoleBackend() { }\n\nTransform.mixin(ConsoleBackend);\n\nConsoleBackend.prototype.write = function() {\n console.log.apply(console, arguments);\n};\n\nvar e = new ConsoleBackend();\n\nvar levelMap = require('./formatters/util.js').levelMap;\n\ne.filterEnv = function() {\n console.error('Minilog.backends.console.filterEnv is deprecated in Minilog v2.');\n // return the instance of Minilog\n return require('../common/minilog.js');\n};\n\ne.formatters = [\n 'formatClean', 'formatColor', 'formatNpm',\n 'formatLearnboost', 'formatMinilog', 'formatWithStack', 'formatTime'\n];\n\ne.formatClean = new (require('./formatters/clean.js'));\ne.formatColor = new (require('./formatters/color.js'));\ne.formatNpm = new (require('./formatters/npm.js'));\ne.formatLearnboost = new (require('./formatters/learnboost.js'));\ne.formatMinilog = new (require('./formatters/minilog.js'));\ne.formatWithStack = new (require('./formatters/withstack.js'));\ne.formatTime = new (require('./formatters/time.js'));\n\nmodule.exports = e;\n","var Transform = require('../../common/transform.js');\n\nfunction FormatClean() {}\n\nTransform.mixin(FormatClean);\n\nFormatClean.prototype.write = function(name, level, args) {\n function pad(s) { return (s.toString().length == 1? '0'+s : s); }\n this.emit('item', (name ? name + ' ' : '') + (level ? level + ' ' : '') + args.join(' '));\n};\n\nmodule.exports = FormatClean;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatColor() {}\n\nTransform.mixin(FormatColor);\n\nFormatColor.prototype.write = function(name, level, args) {\n var colors = { debug: 'magenta', info: 'cyan', warn: 'yellow', error: 'red' };\n function pad(s) { return (s.toString().length == 4? ' '+s : s); }\n this.emit('item', (name ? name + ' ' : '')\n + (level ? style('- ' + pad(level.toUpperCase()) + ' -', colors[level]) + ' ' : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatColor;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatLearnboost() {}\n\nTransform.mixin(FormatLearnboost);\n\nFormatLearnboost.prototype.write = function(name, level, args) {\n var colors = { debug: 'grey', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatLearnboost;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style,\n util = require('util');\n\nfunction FormatMinilog() {}\n\nTransform.mixin(FormatMinilog);\n\nFormatMinilog.prototype.write = function(name, level, args) {\n var colors = { debug: 'blue', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.map(function(item) {\n return (typeof item == 'string' ? item : util.inspect(item, null, 3, true));\n }).join(' '));\n};\n\nmodule.exports = FormatMinilog;\n","var Transform = require('../../common/transform.js');\n\nfunction FormatNpm() {}\n\nTransform.mixin(FormatNpm);\n\nFormatNpm.prototype.write = function(name, level, args) {\n var out = {\n debug: '\\033[34;40m' + 'debug' + '\\033[39m ',\n info: '\\033[32m' + 'info' + '\\033[39m ',\n warn: '\\033[30;41m' + 'WARN' + '\\033[0m ',\n error: '\\033[31;40m' + 'ERR!' + '\\033[0m '\n };\n this.emit('item', (name ? '\\033[37;40m'+ name +'\\033[0m ' : '')\n + (level && out[level]? out[level] : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatNpm;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style,\n util = require('util');\n\nfunction FormatTime() {}\n\nfunction timestamp() {\n var d = new Date();\n return ('0' + d.getDate()).slice(-2) + '-' +\n ('0' + (d.getMonth() + 1)).slice(-2) + '-' +\n d.getFullYear() + ' ' +\n ('0' + d.getHours()).slice(-2) + ':' +\n ('0' + d.getMinutes()).slice(-2) + ':' +\n ('0' + d.getSeconds()).slice(-2) + '.' +\n ('00' + d.getMilliseconds()).slice(-3);\n}\n\nTransform.mixin(FormatTime);\n\nFormatTime.prototype.write = function(name, level, args) {\n var colors = { debug: 'blue', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', style(timestamp() +' ', 'grey')\n + (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.map(function(item) {\n return (typeof item == 'string' ? item : util.inspect(item, null, 3, true));\n }).join(' '));\n};\n\nmodule.exports = FormatTime;\n","var styles = {\n //styles\n 'bold' : ['\\033[1m', '\\033[22m'],\n 'italic' : ['\\033[3m', '\\033[23m'],\n 'underline' : ['\\033[4m', '\\033[24m'],\n 'inverse' : ['\\033[7m', '\\033[27m'],\n //grayscale\n 'white' : ['\\033[37m', '\\033[39m'],\n 'grey' : ['\\033[90m', '\\033[39m'],\n 'black' : ['\\033[30m', '\\033[39m'],\n //colors\n 'blue' : ['\\033[34m', '\\033[39m'],\n 'cyan' : ['\\033[36m', '\\033[39m'],\n 'green' : ['\\033[32m', '\\033[39m'],\n 'magenta' : ['\\033[35m', '\\033[39m'],\n 'red' : ['\\033[31m', '\\033[39m'],\n 'yellow' : ['\\033[33m', '\\033[39m']\n };\n\nexports.levelMap = { debug: 1, info: 2, warn: 3, error: 4 };\n\nexports.style = function(str, style) {\n return styles[style][0] + str + styles[style][1];\n}\n\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatNpm() {}\n\nTransform.mixin(FormatNpm);\n\nfunction noop(a){\n return a;\n}\n\nvar types = {\n string: noop,\n number: noop,\n default: JSON.stringify.bind(JSON)\n};\n\nfunction stringify(args) {\n return args.map(function(arg) {\n return (types[typeof arg] || types.default)(arg);\n });\n}\n\nFormatNpm.prototype.write = function(name, level, args) {\n var colors = { debug: 'magenta', info: 'cyan', warn: 'yellow', error: 'red' };\n function pad(s) { return (s.toString().length == 4? ' '+s : s); }\n function getStack() {\n var orig = Error.prepareStackTrace;\n Error.prepareStackTrace = function (err, stack) {\n return stack;\n };\n var err = new Error;\n Error.captureStackTrace(err, arguments.callee);\n var stack = err.stack;\n Error.prepareStackTrace = orig;\n return stack;\n }\n\n var frame = getStack()[5],\n fileName = FormatNpm.fullPath ? frame.getFileName() : frame.getFileName().replace(/^.*\\/(.+)$/, '/$1');\n\n this.emit('item', (name ? name + ' ' : '')\n + (level ? style(pad(level), colors[level]) + ' ' : '')\n + style(fileName + \":\" + frame.getLineNumber(), 'grey')\n + ' '\n + stringify(args).join(' '));\n};\n\nFormatNpm.fullPath = true;\n\nmodule.exports = FormatNpm;\n\n","function RedisBackend(options) {\n this.client = options.client;\n this.key = options.key;\n}\n\nRedisBackend.prototype.write = function(str) {\n this.client.rpush(this.key, str);\n};\n\nRedisBackend.prototype.end = function() {};\n\nRedisBackend.prototype.clear = function(cb) {\n this.client.del(this.key, cb);\n};\n\nmodule.exports = RedisBackend;\n","var Transform = require('../common/transform.js');\n\nfunction Stringify() {}\n\nTransform.mixin(Stringify);\n\nStringify.prototype.write = function(name, level, args) {\n var result = [];\n if(name) result.push(name);\n if(level) result.push(level);\n result = result.concat(args);\n for(var i = 0; i < result.length; i++) {\n if(result[i] && typeof result[i] == 'object') {\n // Buffers in Node.js look bad when stringified\n if(result[i].constructor && result[i].constructor.isBuffer) {\n result[i] = result[i].toString();\n } else {\n try {\n result[i] = JSON.stringify(result[i]);\n } catch(stringifyError) {\n // happens when an object has a circular structure\n // do not throw an error, when printing, the toString() method of the object will be used\n }\n }\n } else {\n result[i] = result[i];\n }\n }\n this.emit('item', result.join(' ') + '\\n');\n};\n\nmodule.exports = Stringify;\n","var Transform = require('../common/transform.js');\n\nvar newlines = /\\n+$/,\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var i = args.length-1;\n if (typeof console === 'undefined' || !console.log) {\n return;\n }\n if(console.log.apply) {\n return console.log.apply(console, [name, level].concat(args));\n } else if(JSON && JSON.stringify) {\n // console.log.apply is undefined in IE8 and IE9\n // for IE8/9: make console.log at least a bit less awful\n if(args[i] && typeof args[i] == 'string') {\n args[i] = args[i].replace(newlines, '');\n }\n try {\n for(i = 0; i < args.length; i++) {\n args[i] = JSON.stringify(args[i]);\n }\n } catch(e) {}\n console.log(args.join(' '));\n }\n};\n\nlogger.formatters = ['color', 'minilog'];\nlogger.color = require('./formatters/color.js');\nlogger.minilog = require('./formatters/minilog.js');\n\nmodule.exports = logger;\n","var Transform = require('../../common/transform.js'),\n color = require('./util.js');\n\nvar colors = { debug: ['cyan'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var fn = console.log;\n if(console[level] && console[level].apply) {\n fn = console[level];\n fn.apply(console, [ '%c'+name+' %c'+level, color('gray'), color.apply(color, colors[level])].concat(args));\n }\n};\n\n// NOP, because piping the formatted logs can only cause trouble.\nlogger.pipe = function() { };\n\nmodule.exports = logger;\n","var Transform = require('../../common/transform.js'),\n color = require('./util.js'),\n colors = { debug: ['gray'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var fn = console.log;\n if(level != 'debug' && console[level]) {\n fn = console[level];\n }\n\n var subset = [], i = 0;\n if(level != 'info') {\n for(; i < args.length; i++) {\n if(typeof args[i] != 'string') break;\n }\n fn.apply(console, [ '%c'+name +' '+ args.slice(0, i).join(' '), color.apply(color, colors[level]) ].concat(args.slice(i)));\n } else {\n fn.apply(console, [ '%c'+name, color.apply(color, colors[level]) ].concat(args));\n }\n};\n\n// NOP, because piping the formatted logs can only cause trouble.\nlogger.pipe = function() { };\n\nmodule.exports = logger;\n","var hex = {\n black: '#000',\n red: '#c23621',\n green: '#25bc26',\n yellow: '#bbbb00',\n blue: '#492ee1',\n magenta: '#d338d3',\n cyan: '#33bbc8',\n gray: '#808080',\n purple: '#708'\n};\nfunction color(fg, isInverse) {\n if(isInverse) {\n return 'color: #fff; background: '+hex[fg]+';';\n } else {\n return 'color: '+hex[fg]+';';\n }\n}\n\nmodule.exports = color;\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = /<meta.+?charset=(['\"])(.+?)\\1/i.exec(str);\n\t}\n\n\t// html4\n\tif (!res && str) {\n\t\tres = /<meta[\\s]+?http-equiv=(['\"])content-type\\1[\\s]+?content=(['\"])(.+?)\\2/i.exec(str);\n\t\tif (!res) {\n\t\t\tres = /<meta[\\s]+?content=(['\"])(.+?)\\1[\\s]+?http-equiv=(['\"])content-type\\3/i.exec(str);\n\t\t\tif (res) {\n\t\t\t\tres.pop(); // drop last quote\n\t\t\t}\n\t\t}\n\n\t\tif (res) {\n\t\t\tres = /charset=(.*)/i.exec(res.pop());\n\t\t}\n\t}\n\n\t// xml\n\tif (!res && str) {\n\t\tres = /<\\?xml.+?encoding=(['\"])(.+?)\\1/i.exec(str);\n\t}\n\n\t// found charset\n\tif (res) {\n\t\tcharset = res.pop();\n\n\t\t// prevent decode issues when sites use incorrect encoding\n\t\t// ref: https://hsivonen.fi/encoding-menu/\n\t\tif (charset === 'gb2312' || charset === 'gbk') {\n\t\t\tcharset = 'gb18030';\n\t\t}\n\t}\n\n\t// turn raw buffers into a single utf-8 buffer\n\treturn convert(buffer, 'UTF-8', charset).toString();\n}\n\n/**\n * Detect a URLSearchParams object\n * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143\n *\n * @param Object obj Object to detect by type or brand\n * @return String\n */\nfunction isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}\n\n/**\n * Check if `obj` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} obj\n * @return {boolean}\n */\nfunction isBlob(obj) {\n\treturn typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @return Mixed\n */\nfunction clone(instance) {\n\tlet p1, p2;\n\tlet body = instance.body;\n\n\t// don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// check that body is a stream and not form-data object\n\t// note: we can't clone the form-data object without having it as a dependency\n\tif (body instanceof Stream && typeof body.getBoundary !== 'function') {\n\t\t// tee instance body\n\t\tp1 = new PassThrough();\n\t\tp2 = new PassThrough();\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].body = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n}\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param Mixed instance Any options.body input\n */\nfunction extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param Body instance Instance of Body\n * @return Number? Number of bytes, or null if not possible\n */\nfunction getTotalBytes(instance) {\n\tconst body = instance.body;\n\n\n\tif (body === null) {\n\t\t// body is null\n\t\treturn 0;\n\t} else if (isBlob(body)) {\n\t\treturn body.size;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn body.length;\n\t} else if (body && typeof body.getLengthSync === 'function') {\n\t\t// detect form data input from form-data module\n\t\tif (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x\n\t\tbody.hasKnownLength && body.hasKnownLength()) {\n\t\t\t// 2.x\n\t\t\treturn body.getLengthSync();\n\t\t}\n\t\treturn null;\n\t} else {\n\t\t// body is stream\n\t\treturn null;\n\t}\n}\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param Body instance Instance of Body\n * @return Void\n */\nfunction writeToStream(dest, instance) {\n\tconst body = instance.body;\n\n\n\tif (body === null) {\n\t\t// body is null\n\t\tdest.end();\n\t} else if (isBlob(body)) {\n\t\tbody.stream().pipe(dest);\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\tdest.write(body);\n\t\tdest.end();\n\t} else {\n\t\t// body is stream\n\t\tbody.pipe(dest);\n\t}\n}\n\n// expose Promise\nBody.Promise = global.Promise;\n\n/**\n * headers.js\n *\n * Headers class offers convenient helpers\n */\n\nconst invalidTokenRegex = /[^\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]/;\nconst invalidHeaderCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/;\n\nfunction validateName(name) {\n\tname = `${name}`;\n\tif (invalidTokenRegex.test(name) || name === '') {\n\t\tthrow new TypeError(`${name} is not a legal HTTP header name`);\n\t}\n}\n\nfunction validateValue(value) {\n\tvalue = `${value}`;\n\tif (invalidHeaderCharRegex.test(value)) {\n\t\tthrow new TypeError(`${value} is not a legal HTTP header value`);\n\t}\n}\n\n/**\n * Find the key in the map object given a header name.\n *\n * Returns undefined if not found.\n *\n * @param String name Header name\n * @return String|Undefined\n */\nfunction find(map, name) {\n\tname = name.toLowerCase();\n\tfor (const key in map) {\n\t\tif (key.toLowerCase() === name) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst MAP = Symbol('map');\nclass Headers {\n\t/**\n * Headers class\n *\n * @param Object headers Response headers\n * @return Void\n */\n\tconstructor() {\n\t\tlet init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence<sequence<ByteString>>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record<ByteString, ByteString>\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","module.exports = function() {\n return require(\"!!/home/travis/build/LLK/scratch-storage/node_modules/worker-loader/dist/workers/InlineWorker.js\")(\"/******/ (function(modules) { // webpackBootstrap\\n/******/ \\t// The module cache\\n/******/ \\tvar installedModules = {};\\n/******/\\n/******/ \\t// The require function\\n/******/ \\tfunction __webpack_require__(moduleId) {\\n/******/\\n/******/ \\t\\t// Check if module is in cache\\n/******/ \\t\\tif(installedModules[moduleId]) {\\n/******/ \\t\\t\\treturn installedModules[moduleId].exports;\\n/******/ \\t\\t}\\n/******/ \\t\\t// Create a new module (and put it into the cache)\\n/******/ \\t\\tvar module = installedModules[moduleId] = {\\n/******/ \\t\\t\\ti: moduleId,\\n/******/ \\t\\t\\tl: false,\\n/******/ \\t\\t\\texports: {}\\n/******/ \\t\\t};\\n/******/\\n/******/ \\t\\t// Execute the module function\\n/******/ \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n/******/\\n/******/ \\t\\t// Flag the module as loaded\\n/******/ \\t\\tmodule.l = true;\\n/******/\\n/******/ \\t\\t// Return the exports of the module\\n/******/ \\t\\treturn module.exports;\\n/******/ \\t}\\n/******/\\n/******/\\n/******/ \\t// expose the modules object (__webpack_modules__)\\n/******/ \\t__webpack_require__.m = modules;\\n/******/\\n/******/ \\t// expose the module cache\\n/******/ \\t__webpack_require__.c = installedModules;\\n/******/\\n/******/ \\t// define getter function for harmony exports\\n/******/ \\t__webpack_require__.d = function(exports, name, getter) {\\n/******/ \\t\\tif(!__webpack_require__.o(exports, name)) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\n/******/ \\t\\t}\\n/******/ \\t};\\n/******/\\n/******/ \\t// define __esModule on exports\\n/******/ \\t__webpack_require__.r = function(exports) {\\n/******/ \\t\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\n/******/ \\t\\t}\\n/******/ \\t\\tObject.defineProperty(exports, '__esModule', { value: true });\\n/******/ \\t};\\n/******/\\n/******/ \\t// create a fake namespace object\\n/******/ \\t// mode & 1: value is a module id, require it\\n/******/ \\t// mode & 2: merge all properties of value into the ns\\n/******/ \\t// mode & 4: return value when already ns object\\n/******/ \\t// mode & 8|1: behave like require\\n/******/ \\t__webpack_require__.t = function(value, mode) {\\n/******/ \\t\\tif(mode & 1) value = __webpack_require__(value);\\n/******/ \\t\\tif(mode & 8) return value;\\n/******/ \\t\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\n/******/ \\t\\tvar ns = Object.create(null);\\n/******/ \\t\\t__webpack_require__.r(ns);\\n/******/ \\t\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\n/******/ \\t\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\n/******/ \\t\\treturn ns;\\n/******/ \\t};\\n/******/\\n/******/ \\t// getDefaultExport function for compatibility with non-harmony modules\\n/******/ \\t__webpack_require__.n = function(module) {\\n/******/ \\t\\tvar getter = module && module.__esModule ?\\n/******/ \\t\\t\\tfunction getDefault() { return module['default']; } :\\n/******/ \\t\\t\\tfunction getModuleExports() { return module; };\\n/******/ \\t\\t__webpack_require__.d(getter, 'a', getter);\\n/******/ \\t\\treturn getter;\\n/******/ \\t};\\n/******/\\n/******/ \\t// Object.prototype.hasOwnProperty.call\\n/******/ \\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\n/******/\\n/******/ \\t// __webpack_public_path__\\n/******/ \\t__webpack_require__.p = \\\"\\\";\\n/******/\\n/******/\\n/******/ \\t// Load entry module and return exports\\n/******/ \\treturn __webpack_require__(__webpack_require__.s = \\\"./node_modules/babel-loader/lib/index.js?!./src/FetchWorkerTool.worker.js\\\");\\n/******/ })\\n/************************************************************************/\\n/******/ ({\\n\\n/***/ \\\"./node_modules/babel-loader/lib/index.js?!./src/FetchWorkerTool.worker.js\\\":\\n/*!*******************************************************************************!*\\\\\\n !*** ./node_modules/babel-loader/lib??ref--4!./src/FetchWorkerTool.worker.js ***!\\n \\\\*******************************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* WEBPACK VAR INJECTION */(function(fetch) {/* eslint-env worker */\\nvar jobsActive = 0;\\nvar complete = [];\\nvar intervalId = null;\\n/**\\n * Register a step function.\\n *\\n * Step checks if there are completed jobs and if there are sends them to the\\n * parent. Then it checks the jobs count. If there are no further jobs, clear\\n * the step.\\n */\\n\\nvar registerStep = function registerStep() {\\n intervalId = setInterval(function () {\\n if (complete.length) {\\n // Send our chunk of completed requests and instruct postMessage to\\n // transfer the buffers instead of copying them.\\n postMessage(complete.slice(), // Instruct postMessage that these buffers in the sent message\\n // should use their Transferable trait. After the postMessage\\n // call the \\\"buffers\\\" will still be in complete if you looked,\\n // but they will all be length 0 as the data they reference has\\n // been sent to the window. This lets us send a lot of data\\n // without the normal postMessage behaviour of making a copy of\\n // all of the data for the window.\\n complete.map(function (response) {\\n return response.buffer;\\n }).filter(Boolean));\\n complete.length = 0;\\n }\\n\\n if (jobsActive === 0) {\\n clearInterval(intervalId);\\n intervalId = null;\\n }\\n }, 1);\\n};\\n/**\\n * Receive a job from the parent and fetch the requested data.\\n * @param {object} options.job A job id, url, and options descriptor to perform.\\n */\\n\\n\\nvar onMessage = function onMessage(_ref) {\\n var job = _ref.data;\\n\\n if (jobsActive === 0 && !intervalId) {\\n registerStep();\\n }\\n\\n jobsActive++;\\n fetch(job.url, job.options).then(function (result) {\\n if (result.ok) return result.arrayBuffer();\\n if (result.status === 404) return null;\\n return Promise.reject(result.status);\\n }).then(function (buffer) {\\n return complete.push({\\n id: job.id,\\n buffer: buffer\\n });\\n }).catch(function (error) {\\n return complete.push({\\n id: job.id,\\n error: error\\n });\\n }).then(function () {\\n return jobsActive--;\\n });\\n};\\n\\nif (self.fetch) {\\n postMessage({\\n support: {\\n fetch: true\\n }\\n });\\n self.addEventListener('message', onMessage);\\n} else {\\n postMessage({\\n support: {\\n fetch: false\\n }\\n });\\n self.addEventListener('message', function (_ref2) {\\n var job = _ref2.data;\\n postMessage([{\\n id: job.id,\\n error: new Error('fetch is unavailable')\\n }]);\\n });\\n}\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! node-fetch */ \\\"./node_modules/node-fetch/lib/index.mjs\\\")[\\\"default\\\"]))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/node-fetch/lib/index.mjs\\\":\\n/*!***********************************************!*\\\\\\n !*** ./node_modules/node-fetch/lib/index.mjs ***!\\n \\\\***********************************************/\\n/*! exports provided: default, Headers, Request, Response, FetchError */\\n/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n__webpack_require__.r(__webpack_exports__);\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Headers\\\", function() { return Headers; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Request\\\", function() { return Request; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Response\\\", function() { return Response; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"FetchError\\\", function() { return FetchError; });\\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ \\\"stream\\\");\\n/* harmony import */ var http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! http */ \\\"http\\\");\\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! url */ \\\"url\\\");\\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! https */ \\\"https\\\");\\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! zlib */ \\\"zlib\\\");\\n\\n\\n\\n\\n\\n\\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\\n\\n// fix for \\\"Readable\\\" isn't a named export issue\\nconst Readable = stream__WEBPACK_IMPORTED_MODULE_0__.Readable;\\n\\nconst BUFFER = Symbol('buffer');\\nconst TYPE = Symbol('type');\\n\\nclass Blob {\\n\\tconstructor() {\\n\\t\\tthis[TYPE] = '';\\n\\n\\t\\tconst blobParts = arguments[0];\\n\\t\\tconst options = arguments[1];\\n\\n\\t\\tconst buffers = [];\\n\\t\\tlet size = 0;\\n\\n\\t\\tif (blobParts) {\\n\\t\\t\\tconst a = blobParts;\\n\\t\\t\\tconst length = Number(a.length);\\n\\t\\t\\tfor (let i = 0; i < length; i++) {\\n\\t\\t\\t\\tconst element = a[i];\\n\\t\\t\\t\\tlet buffer;\\n\\t\\t\\t\\tif (element instanceof Buffer) {\\n\\t\\t\\t\\t\\tbuffer = element;\\n\\t\\t\\t\\t} else if (ArrayBuffer.isView(element)) {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\\n\\t\\t\\t\\t} else if (element instanceof ArrayBuffer) {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(element);\\n\\t\\t\\t\\t} else if (element instanceof Blob) {\\n\\t\\t\\t\\t\\tbuffer = element[BUFFER];\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tsize += buffer.length;\\n\\t\\t\\t\\tbuffers.push(buffer);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tthis[BUFFER] = Buffer.concat(buffers);\\n\\n\\t\\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\\n\\t\\tif (type && !/[^\\\\u0020-\\\\u007E]/.test(type)) {\\n\\t\\t\\tthis[TYPE] = type;\\n\\t\\t}\\n\\t}\\n\\tget size() {\\n\\t\\treturn this[BUFFER].length;\\n\\t}\\n\\tget type() {\\n\\t\\treturn this[TYPE];\\n\\t}\\n\\ttext() {\\n\\t\\treturn Promise.resolve(this[BUFFER].toString());\\n\\t}\\n\\tarrayBuffer() {\\n\\t\\tconst buf = this[BUFFER];\\n\\t\\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\\n\\t\\treturn Promise.resolve(ab);\\n\\t}\\n\\tstream() {\\n\\t\\tconst readable = new Readable();\\n\\t\\treadable._read = function () {};\\n\\t\\treadable.push(this[BUFFER]);\\n\\t\\treadable.push(null);\\n\\t\\treturn readable;\\n\\t}\\n\\ttoString() {\\n\\t\\treturn '[object Blob]';\\n\\t}\\n\\tslice() {\\n\\t\\tconst size = this.size;\\n\\n\\t\\tconst start = arguments[0];\\n\\t\\tconst end = arguments[1];\\n\\t\\tlet relativeStart, relativeEnd;\\n\\t\\tif (start === undefined) {\\n\\t\\t\\trelativeStart = 0;\\n\\t\\t} else if (start < 0) {\\n\\t\\t\\trelativeStart = Math.max(size + start, 0);\\n\\t\\t} else {\\n\\t\\t\\trelativeStart = Math.min(start, size);\\n\\t\\t}\\n\\t\\tif (end === undefined) {\\n\\t\\t\\trelativeEnd = size;\\n\\t\\t} else if (end < 0) {\\n\\t\\t\\trelativeEnd = Math.max(size + end, 0);\\n\\t\\t} else {\\n\\t\\t\\trelativeEnd = Math.min(end, size);\\n\\t\\t}\\n\\t\\tconst span = Math.max(relativeEnd - relativeStart, 0);\\n\\n\\t\\tconst buffer = this[BUFFER];\\n\\t\\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\\n\\t\\tconst blob = new Blob([], { type: arguments[2] });\\n\\t\\tblob[BUFFER] = slicedBuffer;\\n\\t\\treturn blob;\\n\\t}\\n}\\n\\nObject.defineProperties(Blob.prototype, {\\n\\tsize: { enumerable: true },\\n\\ttype: { enumerable: true },\\n\\tslice: { enumerable: true }\\n});\\n\\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Blob',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\n/**\\n * fetch-error.js\\n *\\n * FetchError interface for operational errors\\n */\\n\\n/**\\n * Create FetchError instance\\n *\\n * @param String message Error message for human\\n * @param String type Error type for machine\\n * @param String systemError For Node.js system error\\n * @return FetchError\\n */\\nfunction FetchError(message, type, systemError) {\\n Error.call(this, message);\\n\\n this.message = message;\\n this.type = type;\\n\\n // when err.type is `system`, err.code contains system error code\\n if (systemError) {\\n this.code = this.errno = systemError.code;\\n }\\n\\n // hide custom error implementation details from end-users\\n Error.captureStackTrace(this, this.constructor);\\n}\\n\\nFetchError.prototype = Object.create(Error.prototype);\\nFetchError.prototype.constructor = FetchError;\\nFetchError.prototype.name = 'FetchError';\\n\\nlet convert;\\ntry {\\n\\tconvert = require('encoding').convert;\\n} catch (e) {}\\n\\nconst INTERNALS = Symbol('Body internals');\\n\\n// fix an issue where \\\"PassThrough\\\" isn't a named export for node <10\\nconst PassThrough = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough;\\n\\n/**\\n * Body mixin\\n *\\n * Ref: https://fetch.spec.whatwg.org/#body\\n *\\n * @param Stream body Readable stream\\n * @param Object opts Response options\\n * @return Void\\n */\\nfunction Body(body) {\\n\\tvar _this = this;\\n\\n\\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\\n\\t _ref$size = _ref.size;\\n\\n\\tlet size = _ref$size === undefined ? 0 : _ref$size;\\n\\tvar _ref$timeout = _ref.timeout;\\n\\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\\n\\n\\tif (body == null) {\\n\\t\\t// body is undefined or null\\n\\t\\tbody = null;\\n\\t} else if (isURLSearchParams(body)) {\\n\\t\\t// body is a URLSearchParams\\n\\t\\tbody = Buffer.from(body.toString());\\n\\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\\n\\t\\t// body is ArrayBuffer\\n\\t\\tbody = Buffer.from(body);\\n\\t} else if (ArrayBuffer.isView(body)) {\\n\\t\\t// body is ArrayBufferView\\n\\t\\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\\n\\t} else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) ; else {\\n\\t\\t// none of the above\\n\\t\\t// coerce to string then buffer\\n\\t\\tbody = Buffer.from(String(body));\\n\\t}\\n\\tthis[INTERNALS] = {\\n\\t\\tbody,\\n\\t\\tdisturbed: false,\\n\\t\\terror: null\\n\\t};\\n\\tthis.size = size;\\n\\tthis.timeout = timeout;\\n\\n\\tif (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) {\\n\\t\\tbody.on('error', function (err) {\\n\\t\\t\\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\\n\\t\\t\\t_this[INTERNALS].error = error;\\n\\t\\t});\\n\\t}\\n}\\n\\nBody.prototype = {\\n\\tget body() {\\n\\t\\treturn this[INTERNALS].body;\\n\\t},\\n\\n\\tget bodyUsed() {\\n\\t\\treturn this[INTERNALS].disturbed;\\n\\t},\\n\\n\\t/**\\n * Decode response as ArrayBuffer\\n *\\n * @return Promise\\n */\\n\\tarrayBuffer() {\\n\\t\\treturn consumeBody.call(this).then(function (buf) {\\n\\t\\t\\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Return raw response as Blob\\n *\\n * @return Promise\\n */\\n\\tblob() {\\n\\t\\tlet ct = this.headers && this.headers.get('content-type') || '';\\n\\t\\treturn consumeBody.call(this).then(function (buf) {\\n\\t\\t\\treturn Object.assign(\\n\\t\\t\\t// Prevent copying\\n\\t\\t\\tnew Blob([], {\\n\\t\\t\\t\\ttype: ct.toLowerCase()\\n\\t\\t\\t}), {\\n\\t\\t\\t\\t[BUFFER]: buf\\n\\t\\t\\t});\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as json\\n *\\n * @return Promise\\n */\\n\\tjson() {\\n\\t\\tvar _this2 = this;\\n\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\treturn JSON.parse(buffer.toString());\\n\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\\n\\t\\t\\t}\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as text\\n *\\n * @return Promise\\n */\\n\\ttext() {\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\treturn buffer.toString();\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as buffer (non-spec api)\\n *\\n * @return Promise\\n */\\n\\tbuffer() {\\n\\t\\treturn consumeBody.call(this);\\n\\t},\\n\\n\\t/**\\n * Decode response as text, while automatically detecting the encoding and\\n * trying to decode to UTF-8 (non-spec api)\\n *\\n * @return Promise\\n */\\n\\ttextConverted() {\\n\\t\\tvar _this3 = this;\\n\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\treturn convertBody(buffer, _this3.headers);\\n\\t\\t});\\n\\t}\\n};\\n\\n// In browsers, all properties are enumerable.\\nObject.defineProperties(Body.prototype, {\\n\\tbody: { enumerable: true },\\n\\tbodyUsed: { enumerable: true },\\n\\tarrayBuffer: { enumerable: true },\\n\\tblob: { enumerable: true },\\n\\tjson: { enumerable: true },\\n\\ttext: { enumerable: true }\\n});\\n\\nBody.mixIn = function (proto) {\\n\\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\\n\\t\\t// istanbul ignore else: future proof\\n\\t\\tif (!(name in proto)) {\\n\\t\\t\\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\\n\\t\\t\\tObject.defineProperty(proto, name, desc);\\n\\t\\t}\\n\\t}\\n};\\n\\n/**\\n * Consume and convert an entire Body to a Buffer.\\n *\\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\\n *\\n * @return Promise\\n */\\nfunction consumeBody() {\\n\\tvar _this4 = this;\\n\\n\\tif (this[INTERNALS].disturbed) {\\n\\t\\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\\n\\t}\\n\\n\\tthis[INTERNALS].disturbed = true;\\n\\n\\tif (this[INTERNALS].error) {\\n\\t\\treturn Body.Promise.reject(this[INTERNALS].error);\\n\\t}\\n\\n\\tlet body = this.body;\\n\\n\\t// body is null\\n\\tif (body === null) {\\n\\t\\treturn Body.Promise.resolve(Buffer.alloc(0));\\n\\t}\\n\\n\\t// body is blob\\n\\tif (isBlob(body)) {\\n\\t\\tbody = body.stream();\\n\\t}\\n\\n\\t// body is buffer\\n\\tif (Buffer.isBuffer(body)) {\\n\\t\\treturn Body.Promise.resolve(body);\\n\\t}\\n\\n\\t// istanbul ignore if: should never happen\\n\\tif (!(body instanceof stream__WEBPACK_IMPORTED_MODULE_0__)) {\\n\\t\\treturn Body.Promise.resolve(Buffer.alloc(0));\\n\\t}\\n\\n\\t// body is stream\\n\\t// get ready to actually consume the body\\n\\tlet accum = [];\\n\\tlet accumBytes = 0;\\n\\tlet abort = false;\\n\\n\\treturn new Body.Promise(function (resolve, reject) {\\n\\t\\tlet resTimeout;\\n\\n\\t\\t// allow timeout on slow response body\\n\\t\\tif (_this4.timeout) {\\n\\t\\t\\tresTimeout = setTimeout(function () {\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\\n\\t\\t\\t}, _this4.timeout);\\n\\t\\t}\\n\\n\\t\\t// handle stream errors\\n\\t\\tbody.on('error', function (err) {\\n\\t\\t\\tif (err.name === 'AbortError') {\\n\\t\\t\\t\\t// if the request was aborted, reject with this Error\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(err);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// other errors, such as incorrect content-encoding\\n\\t\\t\\t\\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\\n\\t\\t\\t}\\n\\t\\t});\\n\\n\\t\\tbody.on('data', function (chunk) {\\n\\t\\t\\tif (abort || chunk === null) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\taccumBytes += chunk.length;\\n\\t\\t\\taccum.push(chunk);\\n\\t\\t});\\n\\n\\t\\tbody.on('end', function () {\\n\\t\\t\\tif (abort) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tclearTimeout(resTimeout);\\n\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tresolve(Buffer.concat(accum, accumBytes));\\n\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\t// handle streams that have accumulated too much data (issue #414)\\n\\t\\t\\t\\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\\n\\t\\t\\t}\\n\\t\\t});\\n\\t});\\n}\\n\\n/**\\n * Detect buffer encoding and convert to target encoding\\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\\n *\\n * @param Buffer buffer Incoming buffer\\n * @param String encoding Target encoding\\n * @return String\\n */\\nfunction convertBody(buffer, headers) {\\n\\tif (typeof convert !== 'function') {\\n\\t\\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\\n\\t}\\n\\n\\tconst ct = headers.get('content-type');\\n\\tlet charset = 'utf-8';\\n\\tlet res, str;\\n\\n\\t// header\\n\\tif (ct) {\\n\\t\\tres = /charset=([^;]*)/i.exec(ct);\\n\\t}\\n\\n\\t// no charset in content type, peek at response body for at most 1024 bytes\\n\\tstr = buffer.slice(0, 1024).toString();\\n\\n\\t// html5\\n\\tif (!res && str) {\\n\\t\\tres = /<meta.+?charset=(['\\\"])(.+?)\\\\1/i.exec(str);\\n\\t}\\n\\n\\t// html4\\n\\tif (!res && str) {\\n\\t\\tres = /<meta[\\\\s]+?http-equiv=(['\\\"])content-type\\\\1[\\\\s]+?content=(['\\\"])(.+?)\\\\2/i.exec(str);\\n\\t\\tif (!res) {\\n\\t\\t\\tres = /<meta[\\\\s]+?content=(['\\\"])(.+?)\\\\1[\\\\s]+?http-equiv=(['\\\"])content-type\\\\3/i.exec(str);\\n\\t\\t\\tif (res) {\\n\\t\\t\\t\\tres.pop(); // drop last quote\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif (res) {\\n\\t\\t\\tres = /charset=(.*)/i.exec(res.pop());\\n\\t\\t}\\n\\t}\\n\\n\\t// xml\\n\\tif (!res && str) {\\n\\t\\tres = /<\\\\?xml.+?encoding=(['\\\"])(.+?)\\\\1/i.exec(str);\\n\\t}\\n\\n\\t// found charset\\n\\tif (res) {\\n\\t\\tcharset = res.pop();\\n\\n\\t\\t// prevent decode issues when sites use incorrect encoding\\n\\t\\t// ref: https://hsivonen.fi/encoding-menu/\\n\\t\\tif (charset === 'gb2312' || charset === 'gbk') {\\n\\t\\t\\tcharset = 'gb18030';\\n\\t\\t}\\n\\t}\\n\\n\\t// turn raw buffers into a single utf-8 buffer\\n\\treturn convert(buffer, 'UTF-8', charset).toString();\\n}\\n\\n/**\\n * Detect a URLSearchParams object\\n * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143\\n *\\n * @param Object obj Object to detect by type or brand\\n * @return String\\n */\\nfunction isURLSearchParams(obj) {\\n\\t// Duck-typing as a necessary condition.\\n\\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\\n\\t\\treturn false;\\n\\t}\\n\\n\\t// Brand-checking and more duck-typing as optional condition.\\n\\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\\n}\\n\\n/**\\n * Check if `obj` is a W3C `Blob` object (which `File` inherits from)\\n * @param {*} obj\\n * @return {boolean}\\n */\\nfunction isBlob(obj) {\\n\\treturn typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);\\n}\\n\\n/**\\n * Clone body given Res/Req instance\\n *\\n * @param Mixed instance Response or Request instance\\n * @return Mixed\\n */\\nfunction clone(instance) {\\n\\tlet p1, p2;\\n\\tlet body = instance.body;\\n\\n\\t// don't allow cloning a used body\\n\\tif (instance.bodyUsed) {\\n\\t\\tthrow new Error('cannot clone body after it is used');\\n\\t}\\n\\n\\t// check that body is a stream and not form-data object\\n\\t// note: we can't clone the form-data object without having it as a dependency\\n\\tif (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__ && typeof body.getBoundary !== 'function') {\\n\\t\\t// tee instance body\\n\\t\\tp1 = new PassThrough();\\n\\t\\tp2 = new PassThrough();\\n\\t\\tbody.pipe(p1);\\n\\t\\tbody.pipe(p2);\\n\\t\\t// set instance body to teed body and return the other teed body\\n\\t\\tinstance[INTERNALS].body = p1;\\n\\t\\tbody = p2;\\n\\t}\\n\\n\\treturn body;\\n}\\n\\n/**\\n * Performs the operation \\\"extract a `Content-Type` value from |object|\\\" as\\n * specified in the specification:\\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\\n *\\n * This function assumes that instance.body is present.\\n *\\n * @param Mixed instance Any options.body input\\n */\\nfunction extractContentType(body) {\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\treturn null;\\n\\t} else if (typeof body === 'string') {\\n\\t\\t// body is string\\n\\t\\treturn 'text/plain;charset=UTF-8';\\n\\t} else if (isURLSearchParams(body)) {\\n\\t\\t// body is a URLSearchParams\\n\\t\\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\\n\\t} else if (isBlob(body)) {\\n\\t\\t// body is blob\\n\\t\\treturn body.type || null;\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\treturn null;\\n\\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\\n\\t\\t// body is ArrayBuffer\\n\\t\\treturn null;\\n\\t} else if (ArrayBuffer.isView(body)) {\\n\\t\\t// body is ArrayBufferView\\n\\t\\treturn null;\\n\\t} else if (typeof body.getBoundary === 'function') {\\n\\t\\t// detect form data input from form-data module\\n\\t\\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\\n\\t} else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) {\\n\\t\\t// body is stream\\n\\t\\t// can't really do much about this\\n\\t\\treturn null;\\n\\t} else {\\n\\t\\t// Body constructor defaults other things to string\\n\\t\\treturn 'text/plain;charset=UTF-8';\\n\\t}\\n}\\n\\n/**\\n * The Fetch Standard treats this as if \\\"total bytes\\\" is a property on the body.\\n * For us, we have to explicitly get it with a function.\\n *\\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\\n *\\n * @param Body instance Instance of Body\\n * @return Number? Number of bytes, or null if not possible\\n */\\nfunction getTotalBytes(instance) {\\n\\tconst body = instance.body;\\n\\n\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\treturn 0;\\n\\t} else if (isBlob(body)) {\\n\\t\\treturn body.size;\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\treturn body.length;\\n\\t} else if (body && typeof body.getLengthSync === 'function') {\\n\\t\\t// detect form data input from form-data module\\n\\t\\tif (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x\\n\\t\\tbody.hasKnownLength && body.hasKnownLength()) {\\n\\t\\t\\t// 2.x\\n\\t\\t\\treturn body.getLengthSync();\\n\\t\\t}\\n\\t\\treturn null;\\n\\t} else {\\n\\t\\t// body is stream\\n\\t\\treturn null;\\n\\t}\\n}\\n\\n/**\\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\\n *\\n * @param Body instance Instance of Body\\n * @return Void\\n */\\nfunction writeToStream(dest, instance) {\\n\\tconst body = instance.body;\\n\\n\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\tdest.end();\\n\\t} else if (isBlob(body)) {\\n\\t\\tbody.stream().pipe(dest);\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\tdest.write(body);\\n\\t\\tdest.end();\\n\\t} else {\\n\\t\\t// body is stream\\n\\t\\tbody.pipe(dest);\\n\\t}\\n}\\n\\n// expose Promise\\nBody.Promise = global.Promise;\\n\\n/**\\n * headers.js\\n *\\n * Headers class offers convenient helpers\\n */\\n\\nconst invalidTokenRegex = /[^\\\\^_`a-zA-Z\\\\-0-9!#$%&'*+.|~]/;\\nconst invalidHeaderCharRegex = /[^\\\\t\\\\x20-\\\\x7e\\\\x80-\\\\xff]/;\\n\\nfunction validateName(name) {\\n\\tname = `${name}`;\\n\\tif (invalidTokenRegex.test(name) || name === '') {\\n\\t\\tthrow new TypeError(`${name} is not a legal HTTP header name`);\\n\\t}\\n}\\n\\nfunction validateValue(value) {\\n\\tvalue = `${value}`;\\n\\tif (invalidHeaderCharRegex.test(value)) {\\n\\t\\tthrow new TypeError(`${value} is not a legal HTTP header value`);\\n\\t}\\n}\\n\\n/**\\n * Find the key in the map object given a header name.\\n *\\n * Returns undefined if not found.\\n *\\n * @param String name Header name\\n * @return String|Undefined\\n */\\nfunction find(map, name) {\\n\\tname = name.toLowerCase();\\n\\tfor (const key in map) {\\n\\t\\tif (key.toLowerCase() === name) {\\n\\t\\t\\treturn key;\\n\\t\\t}\\n\\t}\\n\\treturn undefined;\\n}\\n\\nconst MAP = Symbol('map');\\nclass Headers {\\n\\t/**\\n * Headers class\\n *\\n * @param Object headers Response headers\\n * @return Void\\n */\\n\\tconstructor() {\\n\\t\\tlet init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\\n\\n\\t\\tthis[MAP] = Object.create(null);\\n\\n\\t\\tif (init instanceof Headers) {\\n\\t\\t\\tconst rawHeaders = init.raw();\\n\\t\\t\\tconst headerNames = Object.keys(rawHeaders);\\n\\n\\t\\t\\tfor (const headerName of headerNames) {\\n\\t\\t\\t\\tfor (const value of rawHeaders[headerName]) {\\n\\t\\t\\t\\t\\tthis.append(headerName, value);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\t// We don't worry about converting prop to ByteString here as append()\\n\\t\\t// will handle it.\\n\\t\\tif (init == null) ; else if (typeof init === 'object') {\\n\\t\\t\\tconst method = init[Symbol.iterator];\\n\\t\\t\\tif (method != null) {\\n\\t\\t\\t\\tif (typeof method !== 'function') {\\n\\t\\t\\t\\t\\tthrow new TypeError('Header pairs must be iterable');\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t// sequence<sequence<ByteString>>\\n\\t\\t\\t\\t// Note: per spec we have to first exhaust the lists then process them\\n\\t\\t\\t\\tconst pairs = [];\\n\\t\\t\\t\\tfor (const pair of init) {\\n\\t\\t\\t\\t\\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\\n\\t\\t\\t\\t\\t\\tthrow new TypeError('Each header pair must be iterable');\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tpairs.push(Array.from(pair));\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tfor (const pair of pairs) {\\n\\t\\t\\t\\t\\tif (pair.length !== 2) {\\n\\t\\t\\t\\t\\t\\tthrow new TypeError('Each header pair must be a name/value tuple');\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tthis.append(pair[0], pair[1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// record<ByteString, ByteString>\\n\\t\\t\\t\\tfor (const key of Object.keys(init)) {\\n\\t\\t\\t\\t\\tconst value = init[key];\\n\\t\\t\\t\\t\\tthis.append(key, value);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tthrow new TypeError('Provided initializer must be an object');\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Return combined header value given name\\n *\\n * @param String name Header name\\n * @return Mixed\\n */\\n\\tget(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key === undefined) {\\n\\t\\t\\treturn null;\\n\\t\\t}\\n\\n\\t\\treturn this[MAP][key].join(', ');\\n\\t}\\n\\n\\t/**\\n * Iterate over all headers\\n *\\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\\n * @param Boolean thisArg `this` context for callback function\\n * @return Void\\n */\\n\\tforEach(callback) {\\n\\t\\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\\n\\n\\t\\tlet pairs = getHeaders(this);\\n\\t\\tlet i = 0;\\n\\t\\twhile (i < pairs.length) {\\n\\t\\t\\tvar _pairs$i = pairs[i];\\n\\t\\t\\tconst name = _pairs$i[0],\\n\\t\\t\\t value = _pairs$i[1];\\n\\n\\t\\t\\tcallback.call(thisArg, value, name, this);\\n\\t\\t\\tpairs = getHeaders(this);\\n\\t\\t\\ti++;\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Overwrite header values given name\\n *\\n * @param String name Header name\\n * @param String value Header value\\n * @return Void\\n */\\n\\tset(name, value) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalue = `${value}`;\\n\\t\\tvalidateName(name);\\n\\t\\tvalidateValue(value);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tthis[MAP][key !== undefined ? key : name] = [value];\\n\\t}\\n\\n\\t/**\\n * Append a value onto existing header\\n *\\n * @param String name Header name\\n * @param String value Header value\\n * @return Void\\n */\\n\\tappend(name, value) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalue = `${value}`;\\n\\t\\tvalidateName(name);\\n\\t\\tvalidateValue(value);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key !== undefined) {\\n\\t\\t\\tthis[MAP][key].push(value);\\n\\t\\t} else {\\n\\t\\t\\tthis[MAP][name] = [value];\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Check for header name existence\\n *\\n * @param String name Header name\\n * @return Boolean\\n */\\n\\thas(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\treturn find(this[MAP], name) !== undefined;\\n\\t}\\n\\n\\t/**\\n * Delete all header values given name\\n *\\n * @param String name Header name\\n * @return Void\\n */\\n\\tdelete(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key !== undefined) {\\n\\t\\t\\tdelete this[MAP][key];\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Return raw headers (non-spec api)\\n *\\n * @return Object\\n */\\n\\traw() {\\n\\t\\treturn this[MAP];\\n\\t}\\n\\n\\t/**\\n * Get an iterator on keys.\\n *\\n * @return Iterator\\n */\\n\\tkeys() {\\n\\t\\treturn createHeadersIterator(this, 'key');\\n\\t}\\n\\n\\t/**\\n * Get an iterator on values.\\n *\\n * @return Iterator\\n */\\n\\tvalues() {\\n\\t\\treturn createHeadersIterator(this, 'value');\\n\\t}\\n\\n\\t/**\\n * Get an iterator on entries.\\n *\\n * This is the default iterator of the Headers object.\\n *\\n * @return Iterator\\n */\\n\\t[Symbol.iterator]() {\\n\\t\\treturn createHeadersIterator(this, 'key+value');\\n\\t}\\n}\\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\\n\\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Headers',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nObject.defineProperties(Headers.prototype, {\\n\\tget: { enumerable: true },\\n\\tforEach: { enumerable: true },\\n\\tset: { enumerable: true },\\n\\tappend: { enumerable: true },\\n\\thas: { enumerable: true },\\n\\tdelete: { enumerable: true },\\n\\tkeys: { enumerable: true },\\n\\tvalues: { enumerable: true },\\n\\tentries: { enumerable: true }\\n});\\n\\nfunction getHeaders(headers) {\\n\\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\\n\\n\\tconst keys = Object.keys(headers[MAP]).sort();\\n\\treturn keys.map(kind === 'key' ? function (k) {\\n\\t\\treturn k.toLowerCase();\\n\\t} : kind === 'value' ? function (k) {\\n\\t\\treturn headers[MAP][k].join(', ');\\n\\t} : function (k) {\\n\\t\\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\\n\\t});\\n}\\n\\nconst INTERNAL = Symbol('internal');\\n\\nfunction createHeadersIterator(target, kind) {\\n\\tconst iterator = Object.create(HeadersIteratorPrototype);\\n\\titerator[INTERNAL] = {\\n\\t\\ttarget,\\n\\t\\tkind,\\n\\t\\tindex: 0\\n\\t};\\n\\treturn iterator;\\n}\\n\\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\\n\\tnext() {\\n\\t\\t// istanbul ignore if\\n\\t\\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\\n\\t\\t\\tthrow new TypeError('Value of `this` is not a HeadersIterator');\\n\\t\\t}\\n\\n\\t\\tvar _INTERNAL = this[INTERNAL];\\n\\t\\tconst target = _INTERNAL.target,\\n\\t\\t kind = _INTERNAL.kind,\\n\\t\\t index = _INTERNAL.index;\\n\\n\\t\\tconst values = getHeaders(target, kind);\\n\\t\\tconst len = values.length;\\n\\t\\tif (index >= len) {\\n\\t\\t\\treturn {\\n\\t\\t\\t\\tvalue: undefined,\\n\\t\\t\\t\\tdone: true\\n\\t\\t\\t};\\n\\t\\t}\\n\\n\\t\\tthis[INTERNAL].index = index + 1;\\n\\n\\t\\treturn {\\n\\t\\t\\tvalue: values[index],\\n\\t\\t\\tdone: false\\n\\t\\t};\\n\\t}\\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\\n\\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\\n\\tvalue: 'HeadersIterator',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\n/**\\n * Export the Headers object in a form that Node.js can consume.\\n *\\n * @param Headers headers\\n * @return Object\\n */\\nfunction exportNodeCompatibleHeaders(headers) {\\n\\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\\n\\n\\t// http.request() only supports string as Host header. This hack makes\\n\\t// specifying custom Host header possible.\\n\\tconst hostHeaderKey = find(headers[MAP], 'Host');\\n\\tif (hostHeaderKey !== undefined) {\\n\\t\\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\\n\\t}\\n\\n\\treturn obj;\\n}\\n\\n/**\\n * Create a Headers object from an object of headers, ignoring those that do\\n * not conform to HTTP grammar productions.\\n *\\n * @param Object obj Object of headers\\n * @return Headers\\n */\\nfunction createHeadersLenient(obj) {\\n\\tconst headers = new Headers();\\n\\tfor (const name of Object.keys(obj)) {\\n\\t\\tif (invalidTokenRegex.test(name)) {\\n\\t\\t\\tcontinue;\\n\\t\\t}\\n\\t\\tif (Array.isArray(obj[name])) {\\n\\t\\t\\tfor (const val of obj[name]) {\\n\\t\\t\\t\\tif (invalidHeaderCharRegex.test(val)) {\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (headers[MAP][name] === undefined) {\\n\\t\\t\\t\\t\\theaders[MAP][name] = [val];\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\theaders[MAP][name].push(val);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\\n\\t\\t\\theaders[MAP][name] = [obj[name]];\\n\\t\\t}\\n\\t}\\n\\treturn headers;\\n}\\n\\nconst INTERNALS$1 = Symbol('Response internals');\\n\\n// fix an issue where \\\"STATUS_CODES\\\" aren't a named export for node <10\\nconst STATUS_CODES = http__WEBPACK_IMPORTED_MODULE_1__.STATUS_CODES;\\n\\n/**\\n * Response class\\n *\\n * @param Stream body Readable stream\\n * @param Object opts Response options\\n * @return Void\\n */\\nclass Response {\\n\\tconstructor() {\\n\\t\\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\\n\\t\\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\\n\\n\\t\\tBody.call(this, body, opts);\\n\\n\\t\\tconst status = opts.status || 200;\\n\\t\\tconst headers = new Headers(opts.headers);\\n\\n\\t\\tif (body != null && !headers.has('Content-Type')) {\\n\\t\\t\\tconst contentType = extractContentType(body);\\n\\t\\t\\tif (contentType) {\\n\\t\\t\\t\\theaders.append('Content-Type', contentType);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tthis[INTERNALS$1] = {\\n\\t\\t\\turl: opts.url,\\n\\t\\t\\tstatus,\\n\\t\\t\\tstatusText: opts.statusText || STATUS_CODES[status],\\n\\t\\t\\theaders,\\n\\t\\t\\tcounter: opts.counter\\n\\t\\t};\\n\\t}\\n\\n\\tget url() {\\n\\t\\treturn this[INTERNALS$1].url || '';\\n\\t}\\n\\n\\tget status() {\\n\\t\\treturn this[INTERNALS$1].status;\\n\\t}\\n\\n\\t/**\\n * Convenience property representing if the request ended normally\\n */\\n\\tget ok() {\\n\\t\\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\\n\\t}\\n\\n\\tget redirected() {\\n\\t\\treturn this[INTERNALS$1].counter > 0;\\n\\t}\\n\\n\\tget statusText() {\\n\\t\\treturn this[INTERNALS$1].statusText;\\n\\t}\\n\\n\\tget headers() {\\n\\t\\treturn this[INTERNALS$1].headers;\\n\\t}\\n\\n\\t/**\\n * Clone this response\\n *\\n * @return Response\\n */\\n\\tclone() {\\n\\t\\treturn new Response(clone(this), {\\n\\t\\t\\turl: this.url,\\n\\t\\t\\tstatus: this.status,\\n\\t\\t\\tstatusText: this.statusText,\\n\\t\\t\\theaders: this.headers,\\n\\t\\t\\tok: this.ok,\\n\\t\\t\\tredirected: this.redirected\\n\\t\\t});\\n\\t}\\n}\\n\\nBody.mixIn(Response.prototype);\\n\\nObject.defineProperties(Response.prototype, {\\n\\turl: { enumerable: true },\\n\\tstatus: { enumerable: true },\\n\\tok: { enumerable: true },\\n\\tredirected: { enumerable: true },\\n\\tstatusText: { enumerable: true },\\n\\theaders: { enumerable: true },\\n\\tclone: { enumerable: true }\\n});\\n\\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Response',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nconst INTERNALS$2 = Symbol('Request internals');\\n\\n// fix an issue where \\\"format\\\", \\\"parse\\\" aren't a named export for node <10\\nconst parse_url = url__WEBPACK_IMPORTED_MODULE_2__.parse;\\nconst format_url = url__WEBPACK_IMPORTED_MODULE_2__.format;\\n\\nconst streamDestructionSupported = 'destroy' in stream__WEBPACK_IMPORTED_MODULE_0__.Readable.prototype;\\n\\n/**\\n * Check if a value is an instance of Request.\\n *\\n * @param Mixed input\\n * @return Boolean\\n */\\nfunction isRequest(input) {\\n\\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\\n}\\n\\nfunction isAbortSignal(signal) {\\n\\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\\n\\treturn !!(proto && proto.constructor.name === 'AbortSignal');\\n}\\n\\n/**\\n * Request class\\n *\\n * @param Mixed input Url or Request instance\\n * @param Object init Custom options\\n * @return Void\\n */\\nclass Request {\\n\\tconstructor(input) {\\n\\t\\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\\n\\n\\t\\tlet parsedURL;\\n\\n\\t\\t// normalize input\\n\\t\\tif (!isRequest(input)) {\\n\\t\\t\\tif (input && input.href) {\\n\\t\\t\\t\\t// in order to support Node.js' Url objects; though WHATWG's URL objects\\n\\t\\t\\t\\t// will fall into this branch also (since their `toString()` will return\\n\\t\\t\\t\\t// `href` property anyway)\\n\\t\\t\\t\\tparsedURL = parse_url(input.href);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// coerce input to a string before attempting to parse\\n\\t\\t\\t\\tparsedURL = parse_url(`${input}`);\\n\\t\\t\\t}\\n\\t\\t\\tinput = {};\\n\\t\\t} else {\\n\\t\\t\\tparsedURL = parse_url(input.url);\\n\\t\\t}\\n\\n\\t\\tlet method = init.method || input.method || 'GET';\\n\\t\\tmethod = method.toUpperCase();\\n\\n\\t\\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\\n\\t\\t\\tthrow new TypeError('Request with GET/HEAD method cannot have body');\\n\\t\\t}\\n\\n\\t\\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\\n\\n\\t\\tBody.call(this, inputBody, {\\n\\t\\t\\ttimeout: init.timeout || input.timeout || 0,\\n\\t\\t\\tsize: init.size || input.size || 0\\n\\t\\t});\\n\\n\\t\\tconst headers = new Headers(init.headers || input.headers || {});\\n\\n\\t\\tif (inputBody != null && !headers.has('Content-Type')) {\\n\\t\\t\\tconst contentType = extractContentType(inputBody);\\n\\t\\t\\tif (contentType) {\\n\\t\\t\\t\\theaders.append('Content-Type', contentType);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tlet signal = isRequest(input) ? input.signal : null;\\n\\t\\tif ('signal' in init) signal = init.signal;\\n\\n\\t\\tif (signal != null && !isAbortSignal(signal)) {\\n\\t\\t\\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\\n\\t\\t}\\n\\n\\t\\tthis[INTERNALS$2] = {\\n\\t\\t\\tmethod,\\n\\t\\t\\tredirect: init.redirect || input.redirect || 'follow',\\n\\t\\t\\theaders,\\n\\t\\t\\tparsedURL,\\n\\t\\t\\tsignal\\n\\t\\t};\\n\\n\\t\\t// node-fetch-only options\\n\\t\\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\\n\\t\\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\\n\\t\\tthis.counter = init.counter || input.counter || 0;\\n\\t\\tthis.agent = init.agent || input.agent;\\n\\t}\\n\\n\\tget method() {\\n\\t\\treturn this[INTERNALS$2].method;\\n\\t}\\n\\n\\tget url() {\\n\\t\\treturn format_url(this[INTERNALS$2].parsedURL);\\n\\t}\\n\\n\\tget headers() {\\n\\t\\treturn this[INTERNALS$2].headers;\\n\\t}\\n\\n\\tget redirect() {\\n\\t\\treturn this[INTERNALS$2].redirect;\\n\\t}\\n\\n\\tget signal() {\\n\\t\\treturn this[INTERNALS$2].signal;\\n\\t}\\n\\n\\t/**\\n * Clone this request\\n *\\n * @return Request\\n */\\n\\tclone() {\\n\\t\\treturn new Request(this);\\n\\t}\\n}\\n\\nBody.mixIn(Request.prototype);\\n\\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Request',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nObject.defineProperties(Request.prototype, {\\n\\tmethod: { enumerable: true },\\n\\turl: { enumerable: true },\\n\\theaders: { enumerable: true },\\n\\tredirect: { enumerable: true },\\n\\tclone: { enumerable: true },\\n\\tsignal: { enumerable: true }\\n});\\n\\n/**\\n * Convert a Request to Node.js http request options.\\n *\\n * @param Request A Request instance\\n * @return Object The options object to be passed to http.request\\n */\\nfunction getNodeRequestOptions(request) {\\n\\tconst parsedURL = request[INTERNALS$2].parsedURL;\\n\\tconst headers = new Headers(request[INTERNALS$2].headers);\\n\\n\\t// fetch step 1.3\\n\\tif (!headers.has('Accept')) {\\n\\t\\theaders.set('Accept', '*/*');\\n\\t}\\n\\n\\t// Basic fetch\\n\\tif (!parsedURL.protocol || !parsedURL.hostname) {\\n\\t\\tthrow new TypeError('Only absolute URLs are supported');\\n\\t}\\n\\n\\tif (!/^https?:$/.test(parsedURL.protocol)) {\\n\\t\\tthrow new TypeError('Only HTTP(S) protocols are supported');\\n\\t}\\n\\n\\tif (request.signal && request.body instanceof stream__WEBPACK_IMPORTED_MODULE_0__.Readable && !streamDestructionSupported) {\\n\\t\\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch steps 2.4-2.7\\n\\tlet contentLengthValue = null;\\n\\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\\n\\t\\tcontentLengthValue = '0';\\n\\t}\\n\\tif (request.body != null) {\\n\\t\\tconst totalBytes = getTotalBytes(request);\\n\\t\\tif (typeof totalBytes === 'number') {\\n\\t\\t\\tcontentLengthValue = String(totalBytes);\\n\\t\\t}\\n\\t}\\n\\tif (contentLengthValue) {\\n\\t\\theaders.set('Content-Length', contentLengthValue);\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch step 2.11\\n\\tif (!headers.has('User-Agent')) {\\n\\t\\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch step 2.15\\n\\tif (request.compress && !headers.has('Accept-Encoding')) {\\n\\t\\theaders.set('Accept-Encoding', 'gzip,deflate');\\n\\t}\\n\\n\\tlet agent = request.agent;\\n\\tif (typeof agent === 'function') {\\n\\t\\tagent = agent(parsedURL);\\n\\t}\\n\\n\\tif (!headers.has('Connection') && !agent) {\\n\\t\\theaders.set('Connection', 'close');\\n\\t}\\n\\n\\t// HTTP-network fetch step 4.2\\n\\t// chunked encoding is handled by Node.js\\n\\n\\treturn Object.assign({}, parsedURL, {\\n\\t\\tmethod: request.method,\\n\\t\\theaders: exportNodeCompatibleHeaders(headers),\\n\\t\\tagent\\n\\t});\\n}\\n\\n/**\\n * abort-error.js\\n *\\n * AbortError interface for cancelled requests\\n */\\n\\n/**\\n * Create AbortError instance\\n *\\n * @param String message Error message for human\\n * @return AbortError\\n */\\nfunction AbortError(message) {\\n Error.call(this, message);\\n\\n this.type = 'aborted';\\n this.message = message;\\n\\n // hide custom error implementation details from end-users\\n Error.captureStackTrace(this, this.constructor);\\n}\\n\\nAbortError.prototype = Object.create(Error.prototype);\\nAbortError.prototype.constructor = AbortError;\\nAbortError.prototype.name = 'AbortError';\\n\\n// fix an issue where \\\"PassThrough\\\", \\\"resolve\\\" aren't a named export for node <10\\nconst PassThrough$1 = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough;\\nconst resolve_url = url__WEBPACK_IMPORTED_MODULE_2__.resolve;\\n\\n/**\\n * Fetch function\\n *\\n * @param Mixed url Absolute url or Request instance\\n * @param Object opts Fetch options\\n * @return Promise\\n */\\nfunction fetch(url, opts) {\\n\\n\\t// allow custom promise\\n\\tif (!fetch.Promise) {\\n\\t\\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\\n\\t}\\n\\n\\tBody.Promise = fetch.Promise;\\n\\n\\t// wrap http.request into fetch\\n\\treturn new fetch.Promise(function (resolve, reject) {\\n\\t\\t// build request object\\n\\t\\tconst request = new Request(url, opts);\\n\\t\\tconst options = getNodeRequestOptions(request);\\n\\n\\t\\tconst send = (options.protocol === 'https:' ? https__WEBPACK_IMPORTED_MODULE_3__ : http__WEBPACK_IMPORTED_MODULE_1__).request;\\n\\t\\tconst signal = request.signal;\\n\\n\\t\\tlet response = null;\\n\\n\\t\\tconst abort = function abort() {\\n\\t\\t\\tlet error = new AbortError('The user aborted a request.');\\n\\t\\t\\treject(error);\\n\\t\\t\\tif (request.body && request.body instanceof stream__WEBPACK_IMPORTED_MODULE_0__.Readable) {\\n\\t\\t\\t\\trequest.body.destroy(error);\\n\\t\\t\\t}\\n\\t\\t\\tif (!response || !response.body) return;\\n\\t\\t\\tresponse.body.emit('error', error);\\n\\t\\t};\\n\\n\\t\\tif (signal && signal.aborted) {\\n\\t\\t\\tabort();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tconst abortAndFinalize = function abortAndFinalize() {\\n\\t\\t\\tabort();\\n\\t\\t\\tfinalize();\\n\\t\\t};\\n\\n\\t\\t// send request\\n\\t\\tconst req = send(options);\\n\\t\\tlet reqTimeout;\\n\\n\\t\\tif (signal) {\\n\\t\\t\\tsignal.addEventListener('abort', abortAndFinalize);\\n\\t\\t}\\n\\n\\t\\tfunction finalize() {\\n\\t\\t\\treq.abort();\\n\\t\\t\\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\\n\\t\\t\\tclearTimeout(reqTimeout);\\n\\t\\t}\\n\\n\\t\\tif (request.timeout) {\\n\\t\\t\\treq.once('socket', function (socket) {\\n\\t\\t\\t\\treqTimeout = setTimeout(function () {\\n\\t\\t\\t\\t\\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\\n\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t}, request.timeout);\\n\\t\\t\\t});\\n\\t\\t}\\n\\n\\t\\treq.on('error', function (err) {\\n\\t\\t\\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\\n\\t\\t\\tfinalize();\\n\\t\\t});\\n\\n\\t\\treq.on('response', function (res) {\\n\\t\\t\\tclearTimeout(reqTimeout);\\n\\n\\t\\t\\tconst headers = createHeadersLenient(res.headers);\\n\\n\\t\\t\\t// HTTP fetch step 5\\n\\t\\t\\tif (fetch.isRedirect(res.statusCode)) {\\n\\t\\t\\t\\t// HTTP fetch step 5.2\\n\\t\\t\\t\\tconst location = headers.get('Location');\\n\\n\\t\\t\\t\\t// HTTP fetch step 5.3\\n\\t\\t\\t\\tconst locationURL = location === null ? null : resolve_url(request.url, location);\\n\\n\\t\\t\\t\\t// HTTP fetch step 5.5\\n\\t\\t\\t\\tswitch (request.redirect) {\\n\\t\\t\\t\\t\\tcase 'error':\\n\\t\\t\\t\\t\\t\\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\\n\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\tcase 'manual':\\n\\t\\t\\t\\t\\t\\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\\n\\t\\t\\t\\t\\t\\tif (locationURL !== null) {\\n\\t\\t\\t\\t\\t\\t\\t// handle corrupted header\\n\\t\\t\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\t\\t\\theaders.set('Location', locationURL);\\n\\t\\t\\t\\t\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\t\\t\\t\\t\\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\\n\\t\\t\\t\\t\\t\\t\\t\\treject(err);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\tcase 'follow':\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 2\\n\\t\\t\\t\\t\\t\\tif (locationURL === null) {\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 5\\n\\t\\t\\t\\t\\t\\tif (request.counter >= request.follow) {\\n\\t\\t\\t\\t\\t\\t\\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\\n\\t\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 6 (counter increment)\\n\\t\\t\\t\\t\\t\\t// Create a new Request object.\\n\\t\\t\\t\\t\\t\\tconst requestOpts = {\\n\\t\\t\\t\\t\\t\\t\\theaders: new Headers(request.headers),\\n\\t\\t\\t\\t\\t\\t\\tfollow: request.follow,\\n\\t\\t\\t\\t\\t\\t\\tcounter: request.counter + 1,\\n\\t\\t\\t\\t\\t\\t\\tagent: request.agent,\\n\\t\\t\\t\\t\\t\\t\\tcompress: request.compress,\\n\\t\\t\\t\\t\\t\\t\\tmethod: request.method,\\n\\t\\t\\t\\t\\t\\t\\tbody: request.body,\\n\\t\\t\\t\\t\\t\\t\\tsignal: request.signal,\\n\\t\\t\\t\\t\\t\\t\\ttimeout: request.timeout,\\n\\t\\t\\t\\t\\t\\t\\tsize: request.size\\n\\t\\t\\t\\t\\t\\t};\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 9\\n\\t\\t\\t\\t\\t\\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\\n\\t\\t\\t\\t\\t\\t\\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\\n\\t\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 11\\n\\t\\t\\t\\t\\t\\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.method = 'GET';\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.body = undefined;\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.headers.delete('content-length');\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 15\\n\\t\\t\\t\\t\\t\\tresolve(fetch(new Request(locationURL, requestOpts)));\\n\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t// prepare response\\n\\t\\t\\tres.once('end', function () {\\n\\t\\t\\t\\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\\n\\t\\t\\t});\\n\\t\\t\\tlet body = res.pipe(new PassThrough$1());\\n\\n\\t\\t\\tconst response_options = {\\n\\t\\t\\t\\turl: request.url,\\n\\t\\t\\t\\tstatus: res.statusCode,\\n\\t\\t\\t\\tstatusText: res.statusMessage,\\n\\t\\t\\t\\theaders: headers,\\n\\t\\t\\t\\tsize: request.size,\\n\\t\\t\\t\\ttimeout: request.timeout,\\n\\t\\t\\t\\tcounter: request.counter\\n\\t\\t\\t};\\n\\n\\t\\t\\t// HTTP-network fetch step 12.1.1.3\\n\\t\\t\\tconst codings = headers.get('Content-Encoding');\\n\\n\\t\\t\\t// HTTP-network fetch step 12.1.1.4: handle content codings\\n\\n\\t\\t\\t// in following scenarios we ignore compression support\\n\\t\\t\\t// 1. compression support is disabled\\n\\t\\t\\t// 2. HEAD request\\n\\t\\t\\t// 3. no Content-Encoding header\\n\\t\\t\\t// 4. no content response (204)\\n\\t\\t\\t// 5. content not modified response (304)\\n\\t\\t\\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// For Node v6+\\n\\t\\t\\t// Be less strict when decoding compressed responses, since sometimes\\n\\t\\t\\t// servers send slightly invalid responses that are still accepted\\n\\t\\t\\t// by common browsers.\\n\\t\\t\\t// Always using Z_SYNC_FLUSH is what cURL does.\\n\\t\\t\\tconst zlibOptions = {\\n\\t\\t\\t\\tflush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH,\\n\\t\\t\\t\\tfinishFlush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH\\n\\t\\t\\t};\\n\\n\\t\\t\\t// for gzip\\n\\t\\t\\tif (codings == 'gzip' || codings == 'x-gzip') {\\n\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createGunzip(zlibOptions));\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// for deflate\\n\\t\\t\\tif (codings == 'deflate' || codings == 'x-deflate') {\\n\\t\\t\\t\\t// handle the infamous raw deflate response from old servers\\n\\t\\t\\t\\t// a hack for old IIS and Apache servers\\n\\t\\t\\t\\tconst raw = res.pipe(new PassThrough$1());\\n\\t\\t\\t\\traw.once('data', function (chunk) {\\n\\t\\t\\t\\t\\t// see http://stackoverflow.com/questions/37519828\\n\\t\\t\\t\\t\\tif ((chunk[0] & 0x0F) === 0x08) {\\n\\t\\t\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflate());\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflateRaw());\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// for br\\n\\t\\t\\tif (codings == 'br' && typeof zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress === 'function') {\\n\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress());\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// otherwise, use response as-is\\n\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\tresolve(response);\\n\\t\\t});\\n\\n\\t\\twriteToStream(req, request);\\n\\t});\\n}\\n/**\\n * Redirect code matching\\n *\\n * @param Number code Status code\\n * @return Boolean\\n */\\nfetch.isRedirect = function (code) {\\n\\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\\n};\\n\\n// expose Promise\\nfetch.Promise = global.Promise;\\n\\n/* harmony default export */ __webpack_exports__[\\\"default\\\"] = (fetch);\\n\\n\\n\\n/***/ }),\\n\\n/***/ \\\"http\\\":\\n/*!***********************!*\\\\\\n !*** external \\\"http\\\" ***!\\n \\\\***********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"http\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"https\\\":\\n/*!************************!*\\\\\\n !*** external \\\"https\\\" ***!\\n \\\\************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"https\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"stream\\\":\\n/*!*************************!*\\\\\\n !*** external \\\"stream\\\" ***!\\n \\\\*************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"stream\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"url\\\":\\n/*!**********************!*\\\\\\n !*** external \\\"url\\\" ***!\\n \\\\**********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"url\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"zlib\\\":\\n/*!***********************!*\\\\\\n !*** external \\\"zlib\\\" ***!\\n \\\\***********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"zlib\\\");\\n\\n/***/ })\\n\\n/******/ });\\n//# sourceMappingURL=50604be620465cc30dd8.worker.js.map\", __webpack_public_path__ + \"50604be620465cc30dd8.worker.js\");\n};","'use strict';\n\n// http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string\n\nvar URL = window.URL || window.webkitURL;\n\nmodule.exports = function (content, url) {\n try {\n try {\n var blob;\n\n try {\n // BlobBuilder = Deprecated, but widely implemented\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n\n blob = new BlobBuilder();\n\n blob.append(content);\n\n blob = blob.getBlob();\n } catch (e) {\n // The proposed API\n blob = new Blob([content]);\n }\n\n return new Worker(URL.createObjectURL(blob));\n } catch (e) {\n return new Worker('data:application/javascript,' + encodeURIComponent(content));\n }\n } catch (e) {\n if (!url) {\n throw Error('Inline worker is not supported');\n }\n\n return new Worker(url);\n }\n};","// Use JS implemented TextDecoder and TextEncoder if it is not provided by the\n// browser.\nlet _TextDecoder;\nlet _TextEncoder;\nif (typeof TextDecoder === 'undefined' || typeof TextEncoder === 'undefined') {\n // Wait to require the text encoding polyfill until we know it's needed.\n // eslint-disable-next-line global-require\n const encoding = require('fastestsmallesttextencoderdecoder');\n _TextDecoder = encoding.TextDecoder;\n _TextEncoder = encoding.TextEncoder;\n} else {\n _TextDecoder = TextDecoder;\n _TextEncoder = TextEncoder;\n}\n\nconst md5 = require('js-md5');\n\nconst memoizedToString = (function () {\n /**\n * The maximum length of a chunk before encoding it into base64.\n *\n * 32766 is a multiple of 3 so btoa does not need to use padding characters\n * except for the final chunk where that is fine. 32766 is also close to\n * 32768 so it is close to a size an memory allocator would prefer.\n * @const {number}\n */\n const BTOA_CHUNK_MAX_LENGTH = 32766;\n\n /**\n * An array cache of bytes to characters.\n * @const {?Array.<string>}\n */\n let fromCharCode = null;\n\n const strings = {};\n return (assetId, data) => {\n if (!Object.prototype.hasOwnProperty.call(strings, assetId)) {\n if (typeof btoa === 'undefined') {\n // Use a library that does not need btoa to run.\n /* eslint-disable-next-line global-require */\n const base64js = require('base64-js');\n strings[assetId] = base64js.fromByteArray(data);\n } else {\n // Native btoa is faster than javascript translation. Use js to\n // create a \"binary\" string and btoa to encode it.\n if (fromCharCode === null) {\n // Cache the first 256 characters for input byte values.\n fromCharCode = new Array(256);\n for (let i = 0; i < 256; i++) {\n fromCharCode[i] = String.fromCharCode(i);\n }\n }\n\n const {length} = data;\n let s = '';\n // Iterate over chunks of the binary data.\n for (let i = 0, e = 0; i < length; i = e) {\n // Create small chunks to cause more small allocations and\n // less large allocations.\n e = Math.min(e + BTOA_CHUNK_MAX_LENGTH, length);\n let s_ = '';\n for (let j = i; j < e; j += 1) {\n s_ += fromCharCode[data[j]];\n }\n // Encode the latest chunk so the we create one big output\n // string instead of creating a big input string and then\n // one big output string.\n /* global btoa */\n s += btoa(s_);\n }\n strings[assetId] = s;\n }\n }\n return strings[assetId];\n };\n}());\n\nclass Asset {\n /**\n * Construct an Asset.\n * @param {AssetType} assetType - The type of this asset (sound, image, etc.)\n * @param {string} assetId - The ID of this asset.\n * @param {DataFormat} [dataFormat] - The format of the data (WAV, PNG, etc.); required iff `data` is present.\n * @param {Buffer} [data] - The in-memory data for this asset; optional.\n * @param {bool} [generateId] - Whether to create id from an md5 hash of data\n */\n constructor (assetType, assetId, dataFormat, data, generateId) {\n /** @type {AssetType} */\n this.assetType = assetType;\n\n /** @type {string} */\n this.assetId = assetId;\n\n this.setData(data, dataFormat || assetType.runtimeFormat, generateId);\n\n /** @type {Asset[]} */\n this.dependencies = [];\n }\n\n setData (data, dataFormat, generateId) {\n if (data && !dataFormat) {\n throw new Error('Data provided without specifying its format');\n }\n\n /** @type {DataFormat} */\n this.dataFormat = dataFormat;\n\n /** @type {Buffer} */\n this.data = data;\n\n if (generateId) this.assetId = md5(data);\n\n // Mark as clean only if set is being called without generateId\n // If a new id is being generated, mark this asset as not clean\n this.clean = !generateId;\n }\n\n /**\n * @returns {string} - This asset's data, decoded as text.\n */\n decodeText () {\n const decoder = new _TextDecoder();\n return decoder.decode(this.data);\n }\n\n /**\n * Same as `setData` but encodes text first.\n * @param {string} data - the text data to encode and store.\n * @param {DataFormat} dataFormat - the format of the data (DataFormat.SVG for example).\n * @param {bool} generateId - after setting data, set the id to an md5 of the data?\n */\n encodeTextData (data, dataFormat, generateId) {\n const encoder = new _TextEncoder();\n this.setData(encoder.encode(data), dataFormat, generateId);\n }\n\n /**\n * @param {string} [contentType] - Optionally override the content type to be included in the data URI.\n * @returns {string} - A data URI representing the asset's data.\n */\n encodeDataURI (contentType) {\n contentType = contentType || this.assetType.contentType;\n return `data:${contentType};base64,${memoizedToString(this.assetId, this.data)}`;\n }\n}\n\nmodule.exports = Asset;\n","const DataFormat = require('./DataFormat');\n\n/**\n * Enumeration of the supported asset types.\n * @type {Object.<String,AssetType>}\n * @typedef {Object} AssetType - Information about a supported asset type.\n * @property {string} contentType - the MIME type associated with this kind of data. Useful for data URIs, etc.\n * @property {string} name - The human-readable name of this asset type.\n * @property {DataFormat} runtimeFormat - The default format used for runtime, in-memory storage of this asset. For\n * example, a project stored in SB2 format on disk will be returned as JSON when loaded into memory.\n * @property {boolean} immutable - Indicates if the asset id is determined by the asset content.\n */\nconst AssetType = {\n ImageBitmap: {\n contentType: 'image/png',\n name: 'ImageBitmap',\n runtimeFormat: DataFormat.PNG,\n immutable: true\n },\n ImageVector: {\n contentType: 'image/svg+xml',\n name: 'ImageVector',\n runtimeFormat: DataFormat.SVG,\n immutable: true\n },\n Project: {\n contentType: 'application/json',\n name: 'Project',\n runtimeFormat: DataFormat.JSON,\n immutable: false\n },\n Sound: {\n contentType: 'audio/x-wav',\n name: 'Sound',\n runtimeFormat: DataFormat.WAV,\n immutable: true\n },\n Sprite: {\n contentType: 'application/json',\n name: 'Sprite',\n runtimeFormat: DataFormat.JSON,\n immutable: true\n }\n};\n\nmodule.exports = AssetType;\n","const md5 = require('js-md5');\n\nconst log = require('./log');\n\nconst Asset = require('./Asset');\nconst AssetType = require('./AssetType');\nconst DataFormat = require('./DataFormat');\nconst Helper = require('./Helper');\n\n/**\n * @typedef {object} BuiltinAssetRecord\n * @property {AssetType} type - The type of the asset.\n * @property {DataFormat} format - The format of the asset's data.\n * @property {?string} id - The asset's unique ID.\n * @property {Buffer} data - The asset's data.\n */\n\n/**\n * @type {BuiltinAssetRecord[]}\n */\nconst DefaultAssets = [\n {\n type: AssetType.ImageBitmap,\n format: DataFormat.PNG,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultBitmap.png') // eslint-disable-line global-require\n )\n },\n {\n type: AssetType.Sound,\n format: DataFormat.WAV,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultSound.wav') // eslint-disable-line global-require\n )\n },\n {\n type: AssetType.ImageVector,\n format: DataFormat.SVG,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultVector.svg') // eslint-disable-line global-require\n )\n }\n];\n\n/**\n * @type {BuiltinAssetRecord[]}\n */\nconst BuiltinAssets = DefaultAssets.concat([\n]);\n\nclass BuiltinHelper extends Helper {\n constructor (parent) {\n super(parent);\n\n /**\n * In-memory storage for all built-in assets.\n * @type {Object.<AssetType, AssetIdMap>} Maps asset type to a map of asset ID to actual assets.\n * @typedef {Object.<string, BuiltinAssetRecord>} AssetIdMap - Maps asset ID to asset.\n */\n this.assets = {};\n\n BuiltinAssets.forEach(assetRecord => {\n assetRecord.id = this._store(assetRecord.type, assetRecord.format, assetRecord.data, assetRecord.id);\n });\n }\n\n /**\n * Call `setDefaultAssetId` on the parent `ScratchStorage` instance to register all built-in default assets.\n */\n registerDefaultAssets () {\n const numAssets = DefaultAssets.length;\n for (let assetIndex = 0; assetIndex < numAssets; ++assetIndex) {\n const assetRecord = DefaultAssets[assetIndex];\n this.parent.setDefaultAssetId(assetRecord.type, assetRecord.id);\n }\n }\n\n\n /**\n * Synchronously fetch a cached asset for a given asset id. Returns null if not found.\n * @param {string} assetId - The id for the asset to fetch.\n * @returns {?Asset} The asset for assetId, if it exists.\n */\n get (assetId) {\n let asset = null;\n if (Object.prototype.hasOwnProperty.call(this.assets, assetId)) {\n /** @type{BuiltinAssetRecord} */\n const assetRecord = this.assets[assetId];\n asset = new Asset(assetRecord.type, assetRecord.id, assetRecord.format, assetRecord.data);\n }\n return asset;\n }\n\n /**\n * Alias for store (old name of store)\n * @deprecated Use BuiltinHelper.store\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n cache (assetType, dataFormat, data, id) {\n log.warn('Deprecation: BuiltinHelper.cache has been replaced with BuiltinHelper.store.');\n return this.store(assetType, dataFormat, data, id);\n }\n\n /**\n * Deprecated external API for _store\n * @deprecated Not for external use. Create assets and keep track of them outside of the storage instance.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {(string|number)} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n store (assetType, dataFormat, data, id) {\n log.warn('Deprecation: use Storage.createAsset. BuiltinHelper is for internal use only.');\n return this._store(assetType, dataFormat, data, id);\n }\n\n /**\n * Cache an asset for future lookups by ID.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {(string|number)} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n _store (assetType, dataFormat, data, id) {\n if (!dataFormat) throw new Error('Data cached without specifying its format');\n if (id !== '' && id !== null && typeof id !== 'undefined') {\n if (Object.prototype.hasOwnProperty.call(this.assets, id) && assetType.immutable) return id;\n } else if (assetType.immutable) {\n id = md5(data);\n } else {\n throw new Error('Tried to cache data without an id');\n }\n this.assets[id] = {\n type: assetType,\n format: dataFormat,\n id: id,\n data: data\n };\n return id;\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {?Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId) {\n if (!this.get(assetId)) {\n // Return null immediately so Storage can quickly move to trying the\n // next helper.\n return null;\n }\n return Promise.resolve(this.get(assetId));\n }\n}\n\nmodule.exports = BuiltinHelper;\n","/**\n * Enumeration of the supported data formats.\n * @enum {string}\n */\nconst DataFormat = {\n JPG: 'jpg',\n JSON: 'json',\n MP3: 'mp3',\n PNG: 'png',\n SB2: 'sb2',\n SB3: 'sb3',\n SVG: 'svg',\n WAV: 'wav'\n};\n\nmodule.exports = DataFormat;\n","/* eslint-env browser */\n\n/**\n * Get and send assets with the fetch standard web api.\n */\nclass FetchTool {\n /**\n * Is get supported? false if the environment does not support fetch.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return typeof fetch !== 'undefined';\n }\n\n /**\n * Request data from a server with fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @param {{method:string}} options - Additional options to configure fetch.\n * @returns {Promise.<Uint8Array>} Resolve to Buffer of data from server.\n */\n get ({url, ...options}) {\n return fetch(url, Object.assign({method: 'GET'}, options))\n .then(result => {\n if (result.ok) return result.arrayBuffer().then(b => new Uint8Array(b));\n if (result.status === 404) return null;\n return Promise.reject(result.status);\n });\n }\n\n /**\n * Is sending supported? false if the environment does not support sending\n * with fetch.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return typeof fetch !== 'undefined';\n }\n\n /**\n * Send data to a server with fetch.\n * @param {Request} reqConfig - Request configuration for data to send.\n * @returns {Promise.<string>} Server returned metadata.\n */\n send ({url, withCredentials = false, ...options}) {\n return fetch(url, Object.assign({\n credentials: withCredentials ? 'include' : 'omit'\n }, options))\n .then(response => {\n if (response.ok) return response.text();\n return Promise.reject(response.status);\n });\n }\n}\n\nmodule.exports = FetchTool;\n","/**\n * Get and send assets with a worker that uses fetch.\n */\nclass PrivateFetchWorkerTool {\n constructor () {\n /**\n * What does the worker support of the APIs we need?\n * @type {{fetch:boolean}}\n */\n this._workerSupport = {\n fetch: typeof fetch !== 'undefined'\n };\n\n /**\n * A possible error occurred standing up the worker.\n * @type {!Error}\n */\n this._supportError = null;\n\n /**\n * The worker that runs fetch and returns data for us.\n * @type {!Worker}\n */\n this.worker = null;\n\n /**\n * A map of ids to fetch job objects.\n * @type {object}\n */\n this.jobs = {};\n\n try {\n if (this.isGetSupported) {\n // eslint-disable-next-line global-require\n const FetchWorker = require('worker-loader?{\"inline\":true,\"fallback\":true}!./FetchWorkerTool.worker');\n\n this.worker = new FetchWorker();\n\n this.worker.addEventListener('message', ({data}) => {\n if (data.support) {\n this._workerSupport = data.support;\n return;\n }\n for (const message of data) {\n if (this.jobs[message.id]) {\n if (message.error) {\n this.jobs[message.id].reject(message.error);\n } else {\n this.jobs[message.id].resolve(message.buffer);\n }\n delete this.jobs[message.id];\n }\n }\n });\n }\n } catch (error) {\n this._supportError = error;\n }\n }\n\n /**\n * Is get supported?\n *\n * false if the environment does not workers, fetch, or fetch from inside a\n * worker. Finding out the worker supports fetch is asynchronous and will\n * guess that it does if the window does until the worker can inform us.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return (\n typeof Worker !== 'undefined' &&\n this._workerSupport.fetch &&\n !this._supportError\n );\n }\n\n /**\n * Request data from a server with a worker using fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @param {{method:string}} options - Additional options to configure fetch.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get ({url, ...options}) {\n return new Promise((resolve, reject) => {\n // TODO: Use a Scratch standard ID generator ...\n const id = Math.random().toString(16)\n .substring(2);\n this.worker.postMessage({\n id,\n url,\n options: Object.assign({method: 'GET'}, options)\n });\n this.jobs[id] = {\n id,\n resolve,\n reject\n };\n })\n .then(body => new Uint8Array(body));\n }\n\n /**\n * Is sending supported? always false for FetchWorkerTool.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return false;\n }\n\n /**\n * Send data to a server.\n * @throws {Error} A not implemented error.\n */\n send () {\n throw new Error('Not implemented.');\n }\n\n /**\n * Return a static PrivateFetchWorkerTool instance on demand.\n * @returns {PrivateFetchWorkerTool} A static PrivateFetchWorkerTool\n * instance\n */\n static get instance () {\n if (!this._instance) {\n this._instance = new PrivateFetchWorkerTool();\n }\n return this._instance;\n }\n}\n\n/**\n * Get and send assets with a worker that uses fetch.\n */\nclass PublicFetchWorkerTool {\n constructor () {\n /**\n * Shared instance of an internal worker. PublicFetchWorkerTool proxies\n * it.\n * @type {PrivateFetchWorkerTool}\n */\n this.inner = PrivateFetchWorkerTool.instance;\n }\n\n /**\n * Is get supported?\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return this.inner.isGetSupported;\n }\n\n /**\n * Request data from a server with a worker that uses fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get (reqConfig) {\n return this.inner.get(reqConfig);\n }\n\n /**\n * Is sending supported?\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return false;\n }\n\n /**\n * Send data to a server with a worker that uses fetch.\n * @throws {Error} A not implemented error.\n */\n send () {\n throw new Error('Not implemented.');\n }\n}\n\nmodule.exports = PublicFetchWorkerTool;\n","/**\n * Base class for asset load/save helpers.\n * @abstract\n */\nclass Helper {\n constructor (parent) {\n this.parent = parent;\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} dataFormat - The file format / file extension of the asset to fetch: PNG, JPG, etc.\n * @return {Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId, dataFormat) {\n return Promise.reject(new Error(`No asset of type ${assetType} for ID ${assetId} with format ${dataFormat}`));\n }\n}\n\nmodule.exports = Helper;\n","const FetchWorkerTool = require('./FetchWorkerTool');\nconst FetchTool = require('./FetchTool');\n\n/**\n * @typedef {object} Request\n * @property {string} url\n * @property {*} body\n * @property {string} method\n * @property {boolean} withCredentials\n */\n\n/**\n * Get and send assets with other tools in sequence.\n */\nclass ProxyTool {\n constructor (filter = ProxyTool.TOOL_FILTER.ALL) {\n let tools;\n if (filter === ProxyTool.TOOL_FILTER.READY) {\n tools = [new FetchTool()];\n } else {\n tools = [new FetchWorkerTool(), new FetchTool()];\n }\n\n /**\n * Sequence of tools to proxy.\n * @type {Array.<Tool>}\n */\n this.tools = tools;\n }\n\n /**\n * Is get supported? false if all proxied tool return false.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return this.tools.some(tool => tool.isGetSupported);\n }\n\n /**\n * Request data from with one of the proxied tools.\n * @param {Request} reqConfig - Request configuration for data to get.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get (reqConfig) {\n let toolIndex = 0;\n const nextTool = err => {\n const tool = this.tools[toolIndex++];\n if (!tool) {\n throw err;\n }\n if (!tool.isGetSupported) {\n return nextTool(err);\n }\n return tool.get(reqConfig).catch(nextTool);\n };\n return nextTool();\n }\n\n /**\n * Is sending supported? false if all proxied tool return false.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return this.tools.some(tool => tool.isSendSupported);\n }\n\n /**\n * Send data to a server with one of the proxied tools.\n * @param {Request} reqConfig - Request configuration for data to send.\n * @returns {Promise.<Buffer|string|object>} Server returned metadata.\n */\n send (reqConfig) {\n let toolIndex = 0;\n const nextTool = err => {\n const tool = this.tools[toolIndex++];\n if (!tool) {\n throw err;\n }\n if (!tool.isSendSupported) {\n return nextTool(err);\n }\n return tool.send(reqConfig).catch(nextTool);\n };\n return nextTool();\n }\n}\n\n/**\n * Constant values that filter the set of tools in a ProxyTool instance.\n * @enum {string}\n */\nProxyTool.TOOL_FILTER = {\n /**\n * Use all tools.\n */\n ALL: 'all',\n\n /**\n * Use tools that are ready right now.\n */\n READY: 'ready'\n};\n\nmodule.exports = ProxyTool;\n","const log = require('./log');\n\nconst BuiltinHelper = require('./BuiltinHelper');\nconst WebHelper = require('./WebHelper');\n\nconst _Asset = require('./Asset');\nconst _AssetType = require('./AssetType');\nconst _DataFormat = require('./DataFormat');\n\nclass ScratchStorage {\n constructor () {\n this.defaultAssetId = {};\n\n this.builtinHelper = new BuiltinHelper(this);\n this.webHelper = new WebHelper(this);\n this.builtinHelper.registerDefaultAssets(this);\n\n this._helpers = [\n {\n helper: this.builtinHelper,\n priority: 100\n },\n {\n helper: this.webHelper,\n priority: -100\n }\n ];\n }\n\n /**\n * @return {Asset} - the `Asset` class constructor.\n * @constructor\n */\n get Asset () {\n return _Asset;\n }\n\n /**\n * @return {AssetType} - the list of supported asset types.\n * @constructor\n */\n get AssetType () {\n return _AssetType;\n }\n\n /**\n * @return {DataFormat} - the list of supported data formats.\n * @constructor\n */\n get DataFormat () {\n return _DataFormat;\n }\n\n /**\n * @deprecated Please use the `Asset` member of a storage instance instead.\n * @return {Asset} - the `Asset` class constructor.\n * @constructor\n */\n static get Asset () {\n return _Asset;\n }\n\n /**\n * @deprecated Please use the `AssetType` member of a storage instance instead.\n * @return {AssetType} - the list of supported asset types.\n * @constructor\n */\n static get AssetType () {\n return _AssetType;\n }\n\n /**\n * Add a storage helper to this manager. Helpers with a higher priority number will be checked first when loading\n * or storing assets. For comparison, the helper for built-in assets has `priority=100` and the default web helper\n * has `priority=-100`. The relative order of helpers with equal priorities is undefined.\n * @param {Helper} helper - the helper to be added.\n * @param {number} [priority] - the priority for this new helper (default: 0).\n */\n addHelper (helper, priority = 0) {\n this._helpers.push({helper, priority});\n this._helpers.sort((a, b) => b.priority - a.priority);\n }\n\n /**\n * Synchronously fetch a cached asset from built-in storage. Assets are cached when they are loaded.\n * @param {string} assetId - The id of the asset to fetch.\n * @returns {?Asset} The asset, if it exists.\n */\n get (assetId) {\n return this.builtinHelper.get(assetId);\n }\n\n /**\n * Deprecated API for caching built-in assets. Use createAsset.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n cache (assetType, dataFormat, data, id) {\n log.warn('Deprecation: Storage.cache is deprecated. Use Storage.createAsset, and store assets externally.');\n return this.builtinHelper._store(assetType, dataFormat, data, id);\n }\n\n /**\n * Construct an Asset, and optionally generate an md5 hash of its data to create an id\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} [id] - The id for the cached asset.\n * @param {bool} [generateId] - flag to set id to an md5 hash of data if `id` isn't supplied\n * @returns {Asset} generated Asset with `id` attribute set if not supplied\n */\n createAsset (assetType, dataFormat, data, id, generateId) {\n if (!dataFormat) throw new Error('Tried to create asset without a dataFormat');\n return new _Asset(assetType, id, dataFormat, data, generateId);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} getFunction - A function which computes a GET URL from an Asset.\n * @param {UrlFunction} createFunction - A function which computes a POST URL for asset data.\n * @param {UrlFunction} updateFunction - A function which computes a PUT URL for asset data.\n */\n addWebStore (types, getFunction, createFunction, updateFunction) {\n this.webHelper.addStore(types, getFunction, createFunction, updateFunction);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @deprecated Please use addWebStore\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} urlFunction - A function which computes a GET URL from an Asset.\n */\n addWebSource (types, urlFunction) {\n log.warn('Deprecation: Storage.addWebSource has been replaced by addWebStore.');\n this.addWebStore(types, urlFunction);\n }\n\n /**\n * TODO: Should this be removed in favor of requesting an asset with `null` as the ID?\n * @param {AssetType} type - Get the default ID for assets of this type.\n * @return {?string} The ID of the default asset of the given type, if any.\n */\n getDefaultAssetId (type) {\n if (Object.prototype.hasOwnProperty.call(this.defaultAssetId, type.name)) {\n return this.defaultAssetId[type.name];\n }\n }\n\n /**\n * Set the default ID for a particular type of asset. This default asset will be used if a requested asset cannot\n * be found and automatic fallback is enabled. Ideally this should be an asset that is available locally or even\n * one built into this module.\n * TODO: Should this be removed in favor of requesting an asset with `null` as the ID?\n * @param {AssetType} type - The type of asset for which the default will be set.\n * @param {string} id - The default ID to use for this type of asset.\n */\n setDefaultAssetId (type, id) {\n this.defaultAssetId[type.name] = id;\n }\n\n /**\n * Fetch an asset by type & ID.\n * @param {AssetType} assetType - The type of asset to fetch. This also determines which asset store to use.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} [dataFormat] - Optional: load this format instead of the AssetType's default.\n * @return {Promise.<Asset>} A promise for the requested Asset.\n * If the promise is resolved with non-null, the value is the requested asset.\n * If the promise is resolved with null, the desired asset could not be found with the current asset sources.\n * If the promise is rejected, there was an error on at least one asset source. HTTP 404 does not count as an\n * error here, but (for example) HTTP 403 does.\n */\n load (assetType, assetId, dataFormat) {\n /** @type {Helper[]} */\n const helpers = this._helpers.map(x => x.helper);\n const errors = [];\n dataFormat = dataFormat || assetType.runtimeFormat;\n\n let helperIndex = 0;\n let helper;\n const tryNextHelper = err => {\n if (err) { // Track the error, but continue looking\n errors.push(err);\n }\n\n helper = helpers[helperIndex++];\n\n if (helper) {\n const loading = helper.load(assetType, assetId, dataFormat);\n if (loading === null) {\n return tryNextHelper();\n }\n // Note that other attempts may have logged errors; if this succeeds they will be suppressed.\n return loading\n // TODO: maybe some types of error should prevent trying the next helper?\n .catch(tryNextHelper);\n } else if (errors.length > 0) {\n // We looked through all the helpers and couldn't find the asset, AND\n // at least one thing went wrong while we were looking.\n return Promise.reject(errors);\n }\n\n // Nothing went wrong but we couldn't find the asset.\n return Promise.resolve(null);\n };\n\n return tryNextHelper();\n }\n\n /**\n * Store an asset by type & ID.\n * @param {AssetType} assetType - The type of asset to fetch. This also determines which asset store to use.\n * @param {?DataFormat} [dataFormat] - Optional: load this format instead of the AssetType's default.\n * @param {Buffer} data - Data to store for the asset\n * @param {?string} [assetId] - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {Promise.<object>} A promise for asset metadata\n */\n store (assetType, dataFormat, data, assetId) {\n dataFormat = dataFormat || assetType.runtimeFormat;\n return new Promise(\n (resolve, reject) =>\n this.webHelper.store(assetType, dataFormat, data, assetId)\n .then(body => {\n this.builtinHelper._store(assetType, dataFormat, data, body.id);\n return resolve(body);\n })\n .catch(error => reject(error))\n );\n }\n}\n\nmodule.exports = ScratchStorage;\n","const log = require('./log');\n\nconst Asset = require('./Asset');\nconst Helper = require('./Helper');\nconst ProxyTool = require('./ProxyTool');\n\nconst ensureRequestConfig = reqConfig => {\n if (typeof reqConfig === 'string') {\n return {\n url: reqConfig\n };\n }\n return reqConfig;\n};\n\n/**\n * @typedef {function} UrlFunction - A function which computes a URL from asset information.\n * @param {Asset} - The asset for which the URL should be computed.\n * @returns {(string|object)} - A string representing the URL for the asset request OR an object with configuration for\n * the underlying fetch call (necessary for configuring e.g. authentication)\n */\n\nclass WebHelper extends Helper {\n constructor (parent) {\n super(parent);\n\n /**\n * @type {Array.<StoreRecord>}\n * @typedef {object} StoreRecord\n * @property {Array.<string>} types - The types of asset provided by this store, from AssetType's name field.\n * @property {UrlFunction} getFunction - A function which computes a URL from an Asset.\n * @property {UrlFunction} createFunction - A function which computes a URL from an Asset.\n * @property {UrlFunction} updateFunction - A function which computes a URL from an Asset.\n */\n this.stores = [];\n\n /**\n * Set of tools to best load many assets in parallel. If one tool\n * cannot be used, it will use the next.\n * @type {ProxyTool}\n */\n this.assetTool = new ProxyTool();\n\n /**\n * Set of tools to best load project data in parallel with assets. This\n * tool set prefers tools that are immediately ready. Some tools have\n * to initialize before they can load files.\n * @type {ProxyTool}\n */\n this.projectTool = new ProxyTool(ProxyTool.TOOL_FILTER.READY);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @deprecated Please use addStore\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} urlFunction - A function which computes a URL from an Asset.\n */\n addSource (types, urlFunction) {\n log.warn('Deprecation: WebHelper.addSource has been replaced with WebHelper.addStore.');\n this.addStore(types, urlFunction);\n }\n\n /**\n * Register a web-based store for assets. Sources will be checked in order of registration.\n * @param {Array.<AssetType>} types - The types of asset provided by this store.\n * @param {UrlFunction} getFunction - A function which computes a GET URL for an Asset\n * @param {UrlFunction} createFunction - A function which computes a POST URL for an Asset\n * @param {UrlFunction} updateFunction - A function which computes a PUT URL for an Asset\n */\n addStore (types, getFunction, createFunction, updateFunction) {\n this.stores.push({\n types: types.map(assetType => assetType.name),\n get: getFunction,\n create: createFunction,\n update: updateFunction\n });\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} dataFormat - The file format / file extension of the asset to fetch: PNG, JPG, etc.\n * @return {Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId, dataFormat) {\n\n /** @type {Array.<{url:string, result:*}>} List of URLs attempted & errors encountered. */\n const errors = [];\n const stores = this.stores.slice()\n .filter(store => store.types.indexOf(assetType.name) >= 0);\n \n // New empty asset but it doesn't have data yet\n const asset = new Asset(assetType, assetId, dataFormat);\n\n let tool = this.assetTool;\n if (assetType.name === 'Project') {\n tool = this.projectTool;\n }\n\n let storeIndex = 0;\n const tryNextSource = err => {\n if (err) {\n errors.push(err);\n }\n const store = stores[storeIndex++];\n\n /** @type {UrlFunction} */\n const reqConfigFunction = store && store.get;\n\n if (reqConfigFunction) {\n const reqConfig = ensureRequestConfig(reqConfigFunction(asset));\n if (reqConfig === false) {\n return tryNextSource();\n }\n\n return tool.get(reqConfig)\n .then(body => {\n if (body) {\n asset.setData(body, dataFormat);\n return asset;\n }\n return tryNextSource();\n })\n .catch(tryNextSource);\n } else if (errors.length > 0) {\n return Promise.reject(errors);\n }\n\n // no stores matching asset\n return Promise.resolve(null);\n };\n\n return tryNextSource();\n }\n\n /**\n * Create or update an asset with provided data. The create function is called if no asset id is provided\n * @param {AssetType} assetType - The type of asset to create or update.\n * @param {?DataFormat} dataFormat - DataFormat of the data for the stored asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {?string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {Promise.<object>} A promise for the response from the create or update request\n */\n store (assetType, dataFormat, data, assetId) {\n const asset = new Asset(assetType, assetId, dataFormat);\n // If we have an asset id, we should update, otherwise create to get an id\n const create = assetId === '' || assetId === null || typeof assetId === 'undefined';\n\n // Use the first store with the appropriate asset type and url function\n const store = this.stores.filter(s =>\n // Only use stores for the incoming asset type\n s.types.indexOf(assetType.name) !== -1 && (\n // Only use stores that have a create function if this is a create request\n // or an update function if this is an update request\n (create && s.create) || s.update\n )\n )[0];\n\n const method = create ? 'post' : 'put';\n\n if (!store) return Promise.reject(new Error('No appropriate stores'));\n\n let tool = this.assetTool;\n if (assetType.name === 'Project') {\n tool = this.projectTool;\n }\n\n const reqConfig = ensureRequestConfig(\n create ? store.create(asset) : store.update(asset)\n );\n const reqBodyConfig = Object.assign({body: data, method}, reqConfig);\n return tool.send(reqBodyConfig)\n .then(body => {\n // xhr makes it difficult to both send FormData and\n // automatically parse a JSON response. So try to parse\n // everything as JSON.\n if (typeof body === 'string') {\n try {\n body = JSON.parse(body);\n } catch (parseError) {\n // If it's not parseable, then we can't add the id even\n // if we want to, so stop here\n return body;\n }\n }\n return Object.assign({\n id: body['content-name'] || assetId\n }, body);\n });\n }\n}\n\nmodule.exports = WebHelper;\n","const ScratchStorage = require('./ScratchStorage');\n\n/**\n * Export for use with NPM & Node.js.\n * @type {ScratchStorage}\n */\nmodule.exports = ScratchStorage;\n","const minilog = require('minilog');\nminilog.enable();\n\nmodule.exports = minilog('storage');\n","module.exports = require(\"base64-js\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"js-md5\");","module.exports = require(\"stream\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClFA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrmDA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AADA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AAEA;AAEA;AACA;AAAA;AACA;AACA;;;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AADA;AAEA;AACA;AAAA;AAEA;AAGA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;AClJA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAzBA;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AAEA;AACA;AACA;AACA;AAAA;AAJA;AASA;AACA;AACA;AACA;AAAA;AAJA;AASA;AACA;AACA;AACA;AAAA;AAJA;AAUA;AACA;AACA;AACA;AAAA;AACA;AAEA;;;;;AACA;AAAA;AACA;AADA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAZA;AAaA;AAEA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;AA9GA;AACA;AAgHA;;;;;;;;;;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA;AAWA;;;;;;;;;;;;;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AADA;AAIA;AACA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AAAA;AACA;AADA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AADA;AAIA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AALA;AAAA;AACA;AADA;AAKA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAdA;AAAA;AAAA;AAAA;AAAA;AAeA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AADA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAHA;AACA;AAIA;AACA;AACA;AACA;AAHA;AAKA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;AAGA;AACA;AACA;AACA;AACA;AADA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;;ACjLA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;ACrBA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAAA;AACA;AADA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA;AAYA;;;;;;;;;;;;;;;;;ACvGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAFA;AAKA;AACA;AAFA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AACA;AAGA;AACA;AAAA;AACA;AACA;AAAA;AANA;AAQA;;;AA7KA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;;;;;;AAqKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1OA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;;;;;AACA;AAAA;AACA;AADA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AA1BA;AA2BA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAJA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AAEA;AACA;AALA;AAAA;AASA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AADA;AAGA;AACA;;;;AAzKA;AACA;AA2KA;;;;;;;;;;;AClMA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;;;;;;;;;;;ACNA;AACA;AAAA;AAEA;;;;;;;;;;;ACHA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;A","sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"scratch-storage.js","sources":["webpack://ScratchStorage/webpack/bootstrap","webpack://ScratchStorage/./src/builtins/defaultBitmap.png","webpack://ScratchStorage/./src/builtins/defaultSound.wav","webpack://ScratchStorage/./src/builtins/defaultVector.svg","webpack://ScratchStorage/./node_modules/arraybuffer-loader/lib/to-array-buffer.js","webpack://ScratchStorage/./node_modules/fastestsmallesttextencoderdecoder/NodeJS/EncoderAndDecoderNodeJS.min.mjs","webpack://ScratchStorage/./node_modules/microee/index.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/filter.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/common/transform.js","webpack://ScratchStorage/./node_modules/minilog/lib/index.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/console.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/clean.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/color.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/learnboost.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/npm.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/time.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/util.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/formatters/withstack.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/redis.js","webpack://ScratchStorage/./node_modules/minilog/lib/node/stringify.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/console.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/color.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/minilog.js","webpack://ScratchStorage/./node_modules/minilog/lib/web/formatters/util.js","webpack://ScratchStorage/./node_modules/node-fetch/lib/index.mjs","webpack://ScratchStorage/./src/FetchWorkerTool.worker.js","webpack://ScratchStorage/./node_modules/worker-loader/dist/workers/InlineWorker.js","webpack://ScratchStorage/./src/Asset.js","webpack://ScratchStorage/./src/AssetType.js","webpack://ScratchStorage/./src/BuiltinHelper.js","webpack://ScratchStorage/./src/DataFormat.js","webpack://ScratchStorage/./src/FetchTool.js","webpack://ScratchStorage/./src/FetchWorkerTool.js","webpack://ScratchStorage/./src/Helper.js","webpack://ScratchStorage/./src/ProxyTool.js","webpack://ScratchStorage/./src/ScratchStorage.js","webpack://ScratchStorage/./src/WebHelper.js","webpack://ScratchStorage/./src/index.js","webpack://ScratchStorage/./src/log.js","webpack://ScratchStorage/external \"base64-js\"","webpack://ScratchStorage/external \"http\"","webpack://ScratchStorage/external \"https\"","webpack://ScratchStorage/external \"js-md5\"","webpack://ScratchStorage/external \"stream\"","webpack://ScratchStorage/external \"url\"","webpack://ScratchStorage/external \"util\"","webpack://ScratchStorage/external \"zlib\""],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAAAAADmVT4XAAADZElEQVR42u3a70vbQBgH8O/7vOibvsmbFUEEWUGGUhQ25nDuhSKIUFDxlYi0SAd94atRmFiHCH2x4W8iiNtwowXRgd1QipJYY3N/1F4kTQ6XLKS9yyHcvWyO8MnT5y53Tw5EcIMESIAESIAESIAESIAEPFVAq/6l8G4oAQCp4aniwbUVJ6BVzafwqKXy1VZMgNb+CHzbyK4ZB+Bi0nnk0VyhsDiSoAmvvnMHmGUVAF6UG+0ffsxRhsRHky/AyCsAUpumX0wAAIs6T4CxDADDtcdZsal6gjmdH8AsAEC6+s8Fa48SFExeAKusAEju+V367AmUCi9ANQ0AU3pwcOw2cMEH0FwAAKz5X228pRLR5AI4TgIAtIDL24oLUE94AB6W7LsH/cONN14Ilh44AOqD9s2LQR1KHiB9zgGgOSGeuA3ocPrME1Q4ANaceyePAzrcjHmAZYs9IBeW4/fzHiAwTCwAgTle9ACZK44ALDT9e6x7gL4aT0BQCHb4AqgA5/1TTOMLoJ7vZSMM0H/GHnCeDnu+CrU8vGYPcN5FADBYD0vCaYPDy+i0p337GSMsS1Z4vA3t9QgAZTt0IuIxFRPSKicAQHlvhk3FXF5GhBByMa8qo/sBO6BarwuYbYrYnFKDYEvE7phKgcxvEQBqnvhgiQCUOgoAO4C3JOS3L/hv23UXxVldBECfcueAqpAa0WGy/QeULREAY6aTXRFDgBuA13+ElOncAERMAGaA9hBQD4gQQHsIRE1AZoD2xrgQS5nOZyHgFKmWDSIG4GRAVidiAE4GRB6AzAB2AKIPQFaA5myHA5AV4ESNugZhC7BLR50lIBPAebrzBGQCKAFQNSIMcDvRTQIwAHxNApM3RBygGK0uyhxwOwGsPAgEnPWj5ycRCNiJtBHlAChGKQVwANzPY+CXSMDNWISiLA9AfRA5IhJQ68UnoQAt+AtOPIBKhJosF8B6UM0yLkAxQk2WCyDX9SiUh1gkQAIkoCuAvjGuquMbuijAtwG7MPL8yBICOHSPk3W8Ne8KcEUdmBi6FADYos+QleIH0N/ogOxd7AD6uAS6WRU8WcBdlgZMG/EnYUlwEpLLoQ4PjzGbiA5UsRMRsbQ+5ziDJmYqJuR6NaMomdXuFuZyPSABEiABEiABEiABEiAc8Bd6VyvCEKGqcQAAAABJRU5ErkJggg==\")","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"UklGRiYAAABXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YQIAAAAAAA==\")","module.exports = require(\"../../node_modules/arraybuffer-loader/lib/to-array-buffer.js\")(\"PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8Zz4KICA8cmVjdCBmaWxsPSIjQ0NDIiBoZWlnaHQ9IjEyOCIgd2lkdGg9IjEyOCIvPgogIDx0ZXh0IGZpbGw9ImJsYWNrIiB5PSIxMDciIHg9IjM1LjUiIGZvbnQtc2l6ZT0iMTI4Ij4/PC90ZXh0PgogPC9nPgo8L3N2Zz4K\")","'use strict'\n\nmodule.exports = function (base64Data) {\n var isBrowser = typeof window !== 'undefined' && typeof window.atob === 'function'\n var binary = isBrowser ? window.atob(base64Data) : Buffer.from(base64Data, 'base64').toString('binary')\n var bytes = new Uint8Array(binary.length)\n\n for (var i = 0; i < binary.length; ++i) {\n bytes[i] = binary.charCodeAt(i)\n }\n\n return bytes.buffer\n}\n","'use strict';var a=\"undefined\"==typeof global?\"undefined\"===typeof self?{}:self:global,p=String.fromCharCode,q={}.toString,r=a.SharedArrayBuffer,v=r?q.call(r):\"\",w=a.Uint8Array,x=w?q.call(ArrayBuffer.prototype):\"\",y=a.Buffer;try{!y&&a.require&&(y=a.require(\"Buffer\"));var z=y.prototype,A=q.call(z)}catch(g){}var B=y.allocUnsafe,C=!!w&&!y,D=new Uint16Array(32),E=!y||!!w&&w.prototype.isPrototypeOf(z),G=F.prototype;function H(){}\nfunction I(g){var h=g&&g.buffer||g,c=q.call(h);if(c!==x&&c!==A&&c!==v&&\"[object ArrayBuffer]\"!==c&&void 0!==g)throw TypeError(\"Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'\");g=E?new w(h):h||[];c=h=\"\";for(var b=0,d=g.length|0,u=d-32|0,f,e,k=0,t=0,m,l=0,n=-1;b<d;){for(f=b<=u?32:d-b|0;l<f;b=b+1|0,l=l+1|0){e=g[b]&255;switch(e>>4){case 15:m=g[b=b+1|0]&255;if(2!==m>>6||247<e){b=b-1|0;break}k=(e&7)<<6|m&63;t=5;e=256;case 14:m=g[b=b+1|0]&\n255,k<<=6,k|=(e&15)<<6|m&63,t=2===m>>6?t+4|0:24,e=e+256&768;case 13:case 12:m=g[b=b+1|0]&255,k<<=6,k|=(e&31)<<6|m&63,t=t+7|0,b<d&&2===m>>6&&k>>t&&1114112>k?(e=k,k=k-65536|0,0<=k&&(n=(k>>10)+55296|0,e=(k&1023)+56320|0,31>l?(D[l]=n,l=l+1|0,n=-1):(m=n,n=e,e=m))):(e>>=8,b=b-e-1|0,e=65533),k=t=0,f=b<=u?32:d-b|0;default:D[l]=e;continue;case 11:case 10:case 9:case 8:}D[l]=65533}c+=p(D[0],D[1],D[2],D[3],D[4],D[5],D[6],D[7],D[8],D[9],D[10],D[11],D[12],D[13],D[14],D[15],D[16],D[17],D[18],D[19],D[20],D[21],\nD[22],D[23],D[24],D[25],D[26],D[27],D[28],D[29],D[30],D[31]);32>l&&(c=c.slice(0,l-32|0));if(b<d){if(D[0]=n,l=~n>>>31,n=-1,c.length<h.length)continue}else-1!==n&&(c+=p(n));h+=c;c=\"\"}return h}H.prototype.decode=I;function F(){}\nfunction J(g){g=void 0===g?\"\":\"\"+g;var h=g.length|0,c=C?new w((h<<1)+8|0):B?B((h<<1)+8|0):new y((h<<1)+8|0),b,d=0,u=!1;for(b=0;b<h;b=b+1|0,d=d+1|0){var f=g.charCodeAt(b)|0;if(127>=f)c[d]=f;else{if(2047>=f)c[d]=192|f>>6;else{a:{if(55296<=f)if(56320>f){var e=g.charCodeAt(b=b+1|0)|0;if(56320<=e&&57343>=e){f=(f<<10)+e-56613888|0;if(65535<f){c[d]=240|f>>18;c[d=d+1|0]=128|f>>12&63;c[d=d+1|0]=128|f>>6&63;c[d=d+1|0]=128|f&63;continue}break a}f=65533}else 57343>=f&&(f=65533);!u&&b<<1<d&&b<<1<(d-7|0)&&(u=!0,\ne=C?new w(3*h):B?B(3*h):new y(3*h),e.set(c),c=e)}c[d]=224|f>>12;c[d=d+1|0]=128|f>>6&63}c[d=d+1|0]=128|f&63}}return c.subarray(0,d)}G.encode=J;function K(g,h){var c=g[h];return function(){return c.apply(g,arguments)}}var L=a.TextDecoder,M=a.TextEncoder;var TextDecoder=L||H,TextEncoder=M||F,decode=L?K(new L,\"decode\"):I,encode=M?K(new M,\"encode\"):J;export{TextDecoder,TextEncoder,decode,encode};//AnonyCo\n//# sourceMappingURL=https://cdn.jsdelivr.net/gh/AnonyCo/FastestSmallestTextEncoderDecoder/NodeJS/EncoderAndDecoderNodeJS.min.mjs.map\n","function M() { this._events = {}; }\nM.prototype = {\n on: function(ev, cb) {\n this._events || (this._events = {});\n var e = this._events;\n (e[ev] || (e[ev] = [])).push(cb);\n return this;\n },\n removeListener: function(ev, cb) {\n var e = this._events[ev] || [], i;\n for(i = e.length-1; i >= 0 && e[i]; i--){\n if(e[i] === cb || e[i].cb === cb) { e.splice(i, 1); }\n }\n },\n removeAllListeners: function(ev) {\n if(!ev) { this._events = {}; }\n else { this._events[ev] && (this._events[ev] = []); }\n },\n listeners: function(ev) {\n return (this._events ? this._events[ev] || [] : []);\n },\n emit: function(ev) {\n this._events || (this._events = {});\n var args = Array.prototype.slice.call(arguments, 1), i, e = this._events[ev] || [];\n for(i = e.length-1; i >= 0 && e[i]; i--){\n e[i].apply(this, args);\n }\n return this;\n },\n when: function(ev, cb) {\n return this.once(ev, cb, true);\n },\n once: function(ev, cb, when) {\n if(!cb) return this;\n function c() {\n if(!when) this.removeListener(ev, c);\n if(cb.apply(this, arguments) && when) this.removeListener(ev, c);\n }\n c.cb = cb;\n this.on(ev, c);\n return this;\n }\n};\nM.mixin = function(dest) {\n var o = M.prototype, k;\n for (k in o) {\n o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);\n }\n};\nmodule.exports = M;\n","// default filter\nvar Transform = require('./transform.js');\n\nvar levelMap = { debug: 1, info: 2, warn: 3, error: 4 };\n\nfunction Filter() {\n this.enabled = true;\n this.defaultResult = true;\n this.clear();\n}\n\nTransform.mixin(Filter);\n\n// allow all matching, with level >= given level\nFilter.prototype.allow = function(name, level) {\n this._white.push({ n: name, l: levelMap[level] });\n return this;\n};\n\n// deny all matching, with level <= given level\nFilter.prototype.deny = function(name, level) {\n this._black.push({ n: name, l: levelMap[level] });\n return this;\n};\n\nFilter.prototype.clear = function() {\n this._white = [];\n this._black = [];\n return this;\n};\n\nfunction test(rule, name) {\n // use .test for RegExps\n return (rule.n.test ? rule.n.test(name) : rule.n == name);\n};\n\nFilter.prototype.test = function(name, level) {\n var i, len = Math.max(this._white.length, this._black.length);\n for(i = 0; i < len; i++) {\n if(this._white[i] && test(this._white[i], name) && levelMap[level] >= this._white[i].l) {\n return true;\n }\n if(this._black[i] && test(this._black[i], name) && levelMap[level] <= this._black[i].l) {\n return false;\n }\n }\n return this.defaultResult;\n};\n\nFilter.prototype.write = function(name, level, args) {\n if(!this.enabled || this.test(name, level)) {\n return this.emit('item', name, level, args);\n }\n};\n\nmodule.exports = Filter;\n","var Transform = require('./transform.js'),\n Filter = require('./filter.js');\n\nvar log = new Transform(),\n slice = Array.prototype.slice;\n\nexports = module.exports = function create(name) {\n var o = function() { log.write(name, undefined, slice.call(arguments)); return o; };\n o.debug = function() { log.write(name, 'debug', slice.call(arguments)); return o; };\n o.info = function() { log.write(name, 'info', slice.call(arguments)); return o; };\n o.warn = function() { log.write(name, 'warn', slice.call(arguments)); return o; };\n o.error = function() { log.write(name, 'error', slice.call(arguments)); return o; };\n o.log = o.debug; // for interface compliance with Node and browser consoles\n o.suggest = exports.suggest;\n o.format = log.format;\n return o;\n};\n\n// filled in separately\nexports.defaultBackend = exports.defaultFormatter = null;\n\nexports.pipe = function(dest) {\n return log.pipe(dest);\n};\n\nexports.end = exports.unpipe = exports.disable = function(from) {\n return log.unpipe(from);\n};\n\nexports.Transform = Transform;\nexports.Filter = Filter;\n// this is the default filter that's applied when .enable() is called normally\n// you can bypass it completely and set up your own pipes\nexports.suggest = new Filter();\n\nexports.enable = function() {\n if(exports.defaultFormatter) {\n return log.pipe(exports.suggest) // filter\n .pipe(exports.defaultFormatter) // formatter\n .pipe(exports.defaultBackend); // backend\n }\n return log.pipe(exports.suggest) // filter\n .pipe(exports.defaultBackend); // formatter\n};\n\n","var microee = require('microee');\n\n// Implements a subset of Node's stream.Transform - in a cross-platform manner.\nfunction Transform() {}\n\nmicroee.mixin(Transform);\n\n// The write() signature is different from Node's\n// --> makes it much easier to work with objects in logs.\n// One of the lessons from v1 was that it's better to target\n// a good browser rather than the lowest common denominator\n// internally.\n// If you want to use external streams, pipe() to ./stringify.js first.\nTransform.prototype.write = function(name, level, args) {\n this.emit('item', name, level, args);\n};\n\nTransform.prototype.end = function() {\n this.emit('end');\n this.removeAllListeners();\n};\n\nTransform.prototype.pipe = function(dest) {\n var s = this;\n // prevent double piping\n s.emit('unpipe', dest);\n // tell the dest that it's being piped to\n dest.emit('pipe', s);\n\n function onItem() {\n dest.write.apply(dest, Array.prototype.slice.call(arguments));\n }\n function onEnd() { !dest._isStdio && dest.end(); }\n\n s.on('item', onItem);\n s.on('end', onEnd);\n\n s.when('unpipe', function(from) {\n var match = (from === dest) || typeof from == 'undefined';\n if(match) {\n s.removeListener('item', onItem);\n s.removeListener('end', onEnd);\n dest.emit('unpipe');\n }\n return match;\n });\n\n return dest;\n};\n\nTransform.prototype.unpipe = function(from) {\n this.emit('unpipe', from);\n return this;\n};\n\nTransform.prototype.format = function(dest) {\n throw new Error([\n 'Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:',\n 'var Minilog = require(\\'minilog\\');',\n 'Minilog',\n ' .pipe(Minilog.backends.console.formatClean)',\n ' .pipe(Minilog.backends.console);'].join('\\n'));\n};\n\nTransform.mixin = function(dest) {\n var o = Transform.prototype, k;\n for (k in o) {\n o.hasOwnProperty(k) && (dest.prototype[k] = o[k]);\n }\n};\n\nmodule.exports = Transform;\n","module.exports = require('./common/minilog.js');\n\nvar consoleLogger = require('./node/console.js');\n\n// if we are running inside Electron then use the web version of console.js\nvar isElectron = (typeof window !== 'undefined' && window.process && window.process.type === 'renderer');\nif (isElectron) {\n consoleLogger = require('./web/console.js').minilog;\n}\n\n// intercept the pipe method and transparently wrap the stringifier, if the\n// destination is a Node core stream\n\nmodule.exports.Stringifier = require('./node/stringify.js');\n\nvar oldPipe = module.exports.pipe;\nmodule.exports.pipe = function(dest) {\n if(dest instanceof require('stream')) {\n return oldPipe.call(module.exports, new (module.exports.Stringifier)).pipe(dest);\n } else {\n return oldPipe.call(module.exports, dest);\n }\n};\n\nmodule.exports.defaultBackend = consoleLogger;\nmodule.exports.defaultFormatter = consoleLogger.formatMinilog;\n\nmodule.exports.backends = {\n redis: require('./node/redis.js'),\n nodeConsole: consoleLogger,\n console: consoleLogger\n};\n","var Transform = require('../common/transform.js');\n\nfunction ConsoleBackend() { }\n\nTransform.mixin(ConsoleBackend);\n\nConsoleBackend.prototype.write = function() {\n console.log.apply(console, arguments);\n};\n\nvar e = new ConsoleBackend();\n\nvar levelMap = require('./formatters/util.js').levelMap;\n\ne.filterEnv = function() {\n console.error('Minilog.backends.console.filterEnv is deprecated in Minilog v2.');\n // return the instance of Minilog\n return require('../common/minilog.js');\n};\n\ne.formatters = [\n 'formatClean', 'formatColor', 'formatNpm',\n 'formatLearnboost', 'formatMinilog', 'formatWithStack', 'formatTime'\n];\n\ne.formatClean = new (require('./formatters/clean.js'));\ne.formatColor = new (require('./formatters/color.js'));\ne.formatNpm = new (require('./formatters/npm.js'));\ne.formatLearnboost = new (require('./formatters/learnboost.js'));\ne.formatMinilog = new (require('./formatters/minilog.js'));\ne.formatWithStack = new (require('./formatters/withstack.js'));\ne.formatTime = new (require('./formatters/time.js'));\n\nmodule.exports = e;\n","var Transform = require('../../common/transform.js');\n\nfunction FormatClean() {}\n\nTransform.mixin(FormatClean);\n\nFormatClean.prototype.write = function(name, level, args) {\n function pad(s) { return (s.toString().length == 1? '0'+s : s); }\n this.emit('item', (name ? name + ' ' : '') + (level ? level + ' ' : '') + args.join(' '));\n};\n\nmodule.exports = FormatClean;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatColor() {}\n\nTransform.mixin(FormatColor);\n\nFormatColor.prototype.write = function(name, level, args) {\n var colors = { debug: 'magenta', info: 'cyan', warn: 'yellow', error: 'red' };\n function pad(s) { return (s.toString().length == 4? ' '+s : s); }\n this.emit('item', (name ? name + ' ' : '')\n + (level ? style('- ' + pad(level.toUpperCase()) + ' -', colors[level]) + ' ' : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatColor;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatLearnboost() {}\n\nTransform.mixin(FormatLearnboost);\n\nFormatLearnboost.prototype.write = function(name, level, args) {\n var colors = { debug: 'grey', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatLearnboost;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style,\n util = require('util');\n\nfunction FormatMinilog() {}\n\nTransform.mixin(FormatMinilog);\n\nFormatMinilog.prototype.write = function(name, level, args) {\n var colors = { debug: 'blue', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.map(function(item) {\n return (typeof item == 'string' ? item : util.inspect(item, null, 3, true));\n }).join(' '));\n};\n\nmodule.exports = FormatMinilog;\n","var Transform = require('../../common/transform.js');\n\nfunction FormatNpm() {}\n\nTransform.mixin(FormatNpm);\n\nFormatNpm.prototype.write = function(name, level, args) {\n var out = {\n debug: '\\033[34;40m' + 'debug' + '\\033[39m ',\n info: '\\033[32m' + 'info' + '\\033[39m ',\n warn: '\\033[30;41m' + 'WARN' + '\\033[0m ',\n error: '\\033[31;40m' + 'ERR!' + '\\033[0m '\n };\n this.emit('item', (name ? '\\033[37;40m'+ name +'\\033[0m ' : '')\n + (level && out[level]? out[level] : '')\n + args.join(' '));\n};\n\nmodule.exports = FormatNpm;\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style,\n util = require('util');\n\nfunction FormatTime() {}\n\nfunction timestamp() {\n var d = new Date();\n return ('0' + d.getDate()).slice(-2) + '-' +\n ('0' + (d.getMonth() + 1)).slice(-2) + '-' +\n d.getFullYear() + ' ' +\n ('0' + d.getHours()).slice(-2) + ':' +\n ('0' + d.getMinutes()).slice(-2) + ':' +\n ('0' + d.getSeconds()).slice(-2) + '.' +\n ('00' + d.getMilliseconds()).slice(-3);\n}\n\nTransform.mixin(FormatTime);\n\nFormatTime.prototype.write = function(name, level, args) {\n var colors = { debug: 'blue', info: 'cyan', warn: 'yellow', error: 'red' };\n this.emit('item', style(timestamp() +' ', 'grey')\n + (name ? style(name +' ', 'grey') : '')\n + (level ? style(level, colors[level]) + ' ' : '')\n + args.map(function(item) {\n return (typeof item == 'string' ? item : util.inspect(item, null, 3, true));\n }).join(' '));\n};\n\nmodule.exports = FormatTime;\n","var styles = {\n //styles\n 'bold' : ['\\033[1m', '\\033[22m'],\n 'italic' : ['\\033[3m', '\\033[23m'],\n 'underline' : ['\\033[4m', '\\033[24m'],\n 'inverse' : ['\\033[7m', '\\033[27m'],\n //grayscale\n 'white' : ['\\033[37m', '\\033[39m'],\n 'grey' : ['\\033[90m', '\\033[39m'],\n 'black' : ['\\033[30m', '\\033[39m'],\n //colors\n 'blue' : ['\\033[34m', '\\033[39m'],\n 'cyan' : ['\\033[36m', '\\033[39m'],\n 'green' : ['\\033[32m', '\\033[39m'],\n 'magenta' : ['\\033[35m', '\\033[39m'],\n 'red' : ['\\033[31m', '\\033[39m'],\n 'yellow' : ['\\033[33m', '\\033[39m']\n };\n\nexports.levelMap = { debug: 1, info: 2, warn: 3, error: 4 };\n\nexports.style = function(str, style) {\n return styles[style][0] + str + styles[style][1];\n}\n\n","var Transform = require('../../common/transform.js'),\n style = require('./util.js').style;\n\nfunction FormatNpm() {}\n\nTransform.mixin(FormatNpm);\n\nfunction noop(a){\n return a;\n}\n\nvar types = {\n string: noop,\n number: noop,\n default: JSON.stringify.bind(JSON)\n};\n\nfunction stringify(args) {\n return args.map(function(arg) {\n return (types[typeof arg] || types.default)(arg);\n });\n}\n\nFormatNpm.prototype.write = function(name, level, args) {\n var colors = { debug: 'magenta', info: 'cyan', warn: 'yellow', error: 'red' };\n function pad(s) { return (s.toString().length == 4? ' '+s : s); }\n function getStack() {\n var orig = Error.prepareStackTrace;\n Error.prepareStackTrace = function (err, stack) {\n return stack;\n };\n var err = new Error;\n Error.captureStackTrace(err, arguments.callee);\n var stack = err.stack;\n Error.prepareStackTrace = orig;\n return stack;\n }\n\n var frame = getStack()[5],\n fileName = FormatNpm.fullPath ? frame.getFileName() : frame.getFileName().replace(/^.*\\/(.+)$/, '/$1');\n\n this.emit('item', (name ? name + ' ' : '')\n + (level ? style(pad(level), colors[level]) + ' ' : '')\n + style(fileName + \":\" + frame.getLineNumber(), 'grey')\n + ' '\n + stringify(args).join(' '));\n};\n\nFormatNpm.fullPath = true;\n\nmodule.exports = FormatNpm;\n\n","function RedisBackend(options) {\n this.client = options.client;\n this.key = options.key;\n}\n\nRedisBackend.prototype.write = function(str) {\n this.client.rpush(this.key, str);\n};\n\nRedisBackend.prototype.end = function() {};\n\nRedisBackend.prototype.clear = function(cb) {\n this.client.del(this.key, cb);\n};\n\nmodule.exports = RedisBackend;\n","var Transform = require('../common/transform.js');\n\nfunction Stringify() {}\n\nTransform.mixin(Stringify);\n\nStringify.prototype.write = function(name, level, args) {\n var result = [];\n if(name) result.push(name);\n if(level) result.push(level);\n result = result.concat(args);\n for(var i = 0; i < result.length; i++) {\n if(result[i] && typeof result[i] == 'object') {\n // Buffers in Node.js look bad when stringified\n if(result[i].constructor && result[i].constructor.isBuffer) {\n result[i] = result[i].toString();\n } else {\n try {\n result[i] = JSON.stringify(result[i]);\n } catch(stringifyError) {\n // happens when an object has a circular structure\n // do not throw an error, when printing, the toString() method of the object will be used\n }\n }\n } else {\n result[i] = result[i];\n }\n }\n this.emit('item', result.join(' ') + '\\n');\n};\n\nmodule.exports = Stringify;\n","var Transform = require('../common/transform.js');\n\nvar newlines = /\\n+$/,\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var i = args.length-1;\n if (typeof console === 'undefined' || !console.log) {\n return;\n }\n if(console.log.apply) {\n return console.log.apply(console, [name, level].concat(args));\n } else if(JSON && JSON.stringify) {\n // console.log.apply is undefined in IE8 and IE9\n // for IE8/9: make console.log at least a bit less awful\n if(args[i] && typeof args[i] == 'string') {\n args[i] = args[i].replace(newlines, '');\n }\n try {\n for(i = 0; i < args.length; i++) {\n args[i] = JSON.stringify(args[i]);\n }\n } catch(e) {}\n console.log(args.join(' '));\n }\n};\n\nlogger.formatters = ['color', 'minilog'];\nlogger.color = require('./formatters/color.js');\nlogger.minilog = require('./formatters/minilog.js');\n\nmodule.exports = logger;\n","var Transform = require('../../common/transform.js'),\n color = require('./util.js');\n\nvar colors = { debug: ['cyan'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var fn = console.log;\n if(console[level] && console[level].apply) {\n fn = console[level];\n fn.apply(console, [ '%c'+name+' %c'+level, color('gray'), color.apply(color, colors[level])].concat(args));\n }\n};\n\n// NOP, because piping the formatted logs can only cause trouble.\nlogger.pipe = function() { };\n\nmodule.exports = logger;\n","var Transform = require('../../common/transform.js'),\n color = require('./util.js'),\n colors = { debug: ['gray'], info: ['purple' ], warn: [ 'yellow', true ], error: [ 'red', true ] },\n logger = new Transform();\n\nlogger.write = function(name, level, args) {\n var fn = console.log;\n if(level != 'debug' && console[level]) {\n fn = console[level];\n }\n\n var subset = [], i = 0;\n if(level != 'info') {\n for(; i < args.length; i++) {\n if(typeof args[i] != 'string') break;\n }\n fn.apply(console, [ '%c'+name +' '+ args.slice(0, i).join(' '), color.apply(color, colors[level]) ].concat(args.slice(i)));\n } else {\n fn.apply(console, [ '%c'+name, color.apply(color, colors[level]) ].concat(args));\n }\n};\n\n// NOP, because piping the formatted logs can only cause trouble.\nlogger.pipe = function() { };\n\nmodule.exports = logger;\n","var hex = {\n black: '#000',\n red: '#c23621',\n green: '#25bc26',\n yellow: '#bbbb00',\n blue: '#492ee1',\n magenta: '#d338d3',\n cyan: '#33bbc8',\n gray: '#808080',\n purple: '#708'\n};\nfunction color(fg, isInverse) {\n if(isInverse) {\n return 'color: #fff; background: '+hex[fg]+';';\n } else {\n return 'color: '+hex[fg]+';';\n }\n}\n\nmodule.exports = color;\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = /<meta.+?charset=(['\"])(.+?)\\1/i.exec(str);\n\t}\n\n\t// html4\n\tif (!res && str) {\n\t\tres = /<meta[\\s]+?http-equiv=(['\"])content-type\\1[\\s]+?content=(['\"])(.+?)\\2/i.exec(str);\n\t\tif (!res) {\n\t\t\tres = /<meta[\\s]+?content=(['\"])(.+?)\\1[\\s]+?http-equiv=(['\"])content-type\\3/i.exec(str);\n\t\t\tif (res) {\n\t\t\t\tres.pop(); // drop last quote\n\t\t\t}\n\t\t}\n\n\t\tif (res) {\n\t\t\tres = /charset=(.*)/i.exec(res.pop());\n\t\t}\n\t}\n\n\t// xml\n\tif (!res && str) {\n\t\tres = /<\\?xml.+?encoding=(['\"])(.+?)\\1/i.exec(str);\n\t}\n\n\t// found charset\n\tif (res) {\n\t\tcharset = res.pop();\n\n\t\t// prevent decode issues when sites use incorrect encoding\n\t\t// ref: https://hsivonen.fi/encoding-menu/\n\t\tif (charset === 'gb2312' || charset === 'gbk') {\n\t\t\tcharset = 'gb18030';\n\t\t}\n\t}\n\n\t// turn raw buffers into a single utf-8 buffer\n\treturn convert(buffer, 'UTF-8', charset).toString();\n}\n\n/**\n * Detect a URLSearchParams object\n * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143\n *\n * @param Object obj Object to detect by type or brand\n * @return String\n */\nfunction isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}\n\n/**\n * Check if `obj` is a W3C `Blob` object (which `File` inherits from)\n * @param {*} obj\n * @return {boolean}\n */\nfunction isBlob(obj) {\n\treturn typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param Mixed instance Response or Request instance\n * @return Mixed\n */\nfunction clone(instance) {\n\tlet p1, p2;\n\tlet body = instance.body;\n\n\t// don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// check that body is a stream and not form-data object\n\t// note: we can't clone the form-data object without having it as a dependency\n\tif (body instanceof Stream && typeof body.getBoundary !== 'function') {\n\t\t// tee instance body\n\t\tp1 = new PassThrough();\n\t\tp2 = new PassThrough();\n\t\tbody.pipe(p1);\n\t\tbody.pipe(p2);\n\t\t// set instance body to teed body and return the other teed body\n\t\tinstance[INTERNALS].body = p1;\n\t\tbody = p2;\n\t}\n\n\treturn body;\n}\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param Mixed instance Any options.body input\n */\nfunction extractContentType(body) {\n\tif (body === null) {\n\t\t// body is null\n\t\treturn null;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn 'text/plain;charset=UTF-8';\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\n\t} else if (isBlob(body)) {\n\t\t// body is blob\n\t\treturn body.type || null;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn null;\n\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\treturn null;\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\treturn null;\n\t} else if (typeof body.getBoundary === 'function') {\n\t\t// detect form data input from form-data module\n\t\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\n\t} else if (body instanceof Stream) {\n\t\t// body is stream\n\t\t// can't really do much about this\n\t\treturn null;\n\t} else {\n\t\t// Body constructor defaults other things to string\n\t\treturn 'text/plain;charset=UTF-8';\n\t}\n}\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param Body instance Instance of Body\n * @return Number? Number of bytes, or null if not possible\n */\nfunction getTotalBytes(instance) {\n\tconst body = instance.body;\n\n\n\tif (body === null) {\n\t\t// body is null\n\t\treturn 0;\n\t} else if (isBlob(body)) {\n\t\treturn body.size;\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\treturn body.length;\n\t} else if (body && typeof body.getLengthSync === 'function') {\n\t\t// detect form data input from form-data module\n\t\tif (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x\n\t\tbody.hasKnownLength && body.hasKnownLength()) {\n\t\t\t// 2.x\n\t\t\treturn body.getLengthSync();\n\t\t}\n\t\treturn null;\n\t} else {\n\t\t// body is stream\n\t\treturn null;\n\t}\n}\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param Body instance Instance of Body\n * @return Void\n */\nfunction writeToStream(dest, instance) {\n\tconst body = instance.body;\n\n\n\tif (body === null) {\n\t\t// body is null\n\t\tdest.end();\n\t} else if (isBlob(body)) {\n\t\tbody.stream().pipe(dest);\n\t} else if (Buffer.isBuffer(body)) {\n\t\t// body is buffer\n\t\tdest.write(body);\n\t\tdest.end();\n\t} else {\n\t\t// body is stream\n\t\tbody.pipe(dest);\n\t}\n}\n\n// expose Promise\nBody.Promise = global.Promise;\n\n/**\n * headers.js\n *\n * Headers class offers convenient helpers\n */\n\nconst invalidTokenRegex = /[^\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]/;\nconst invalidHeaderCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/;\n\nfunction validateName(name) {\n\tname = `${name}`;\n\tif (invalidTokenRegex.test(name) || name === '') {\n\t\tthrow new TypeError(`${name} is not a legal HTTP header name`);\n\t}\n}\n\nfunction validateValue(value) {\n\tvalue = `${value}`;\n\tif (invalidHeaderCharRegex.test(value)) {\n\t\tthrow new TypeError(`${value} is not a legal HTTP header value`);\n\t}\n}\n\n/**\n * Find the key in the map object given a header name.\n *\n * Returns undefined if not found.\n *\n * @param String name Header name\n * @return String|Undefined\n */\nfunction find(map, name) {\n\tname = name.toLowerCase();\n\tfor (const key in map) {\n\t\tif (key.toLowerCase() === name) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst MAP = Symbol('map');\nclass Headers {\n\t/**\n * Headers class\n *\n * @param Object headers Response headers\n * @return Void\n */\n\tconstructor() {\n\t\tlet init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence<sequence<ByteString>>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record<ByteString, ByteString>\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","module.exports = function() {\n return require(\"!!/home/travis/build/LLK/scratch-storage/node_modules/worker-loader/dist/workers/InlineWorker.js\")(\"/******/ (function(modules) { // webpackBootstrap\\n/******/ \\t// The module cache\\n/******/ \\tvar installedModules = {};\\n/******/\\n/******/ \\t// The require function\\n/******/ \\tfunction __webpack_require__(moduleId) {\\n/******/\\n/******/ \\t\\t// Check if module is in cache\\n/******/ \\t\\tif(installedModules[moduleId]) {\\n/******/ \\t\\t\\treturn installedModules[moduleId].exports;\\n/******/ \\t\\t}\\n/******/ \\t\\t// Create a new module (and put it into the cache)\\n/******/ \\t\\tvar module = installedModules[moduleId] = {\\n/******/ \\t\\t\\ti: moduleId,\\n/******/ \\t\\t\\tl: false,\\n/******/ \\t\\t\\texports: {}\\n/******/ \\t\\t};\\n/******/\\n/******/ \\t\\t// Execute the module function\\n/******/ \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n/******/\\n/******/ \\t\\t// Flag the module as loaded\\n/******/ \\t\\tmodule.l = true;\\n/******/\\n/******/ \\t\\t// Return the exports of the module\\n/******/ \\t\\treturn module.exports;\\n/******/ \\t}\\n/******/\\n/******/\\n/******/ \\t// expose the modules object (__webpack_modules__)\\n/******/ \\t__webpack_require__.m = modules;\\n/******/\\n/******/ \\t// expose the module cache\\n/******/ \\t__webpack_require__.c = installedModules;\\n/******/\\n/******/ \\t// define getter function for harmony exports\\n/******/ \\t__webpack_require__.d = function(exports, name, getter) {\\n/******/ \\t\\tif(!__webpack_require__.o(exports, name)) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\n/******/ \\t\\t}\\n/******/ \\t};\\n/******/\\n/******/ \\t// define __esModule on exports\\n/******/ \\t__webpack_require__.r = function(exports) {\\n/******/ \\t\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\n/******/ \\t\\t}\\n/******/ \\t\\tObject.defineProperty(exports, '__esModule', { value: true });\\n/******/ \\t};\\n/******/\\n/******/ \\t// create a fake namespace object\\n/******/ \\t// mode & 1: value is a module id, require it\\n/******/ \\t// mode & 2: merge all properties of value into the ns\\n/******/ \\t// mode & 4: return value when already ns object\\n/******/ \\t// mode & 8|1: behave like require\\n/******/ \\t__webpack_require__.t = function(value, mode) {\\n/******/ \\t\\tif(mode & 1) value = __webpack_require__(value);\\n/******/ \\t\\tif(mode & 8) return value;\\n/******/ \\t\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\n/******/ \\t\\tvar ns = Object.create(null);\\n/******/ \\t\\t__webpack_require__.r(ns);\\n/******/ \\t\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\n/******/ \\t\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\n/******/ \\t\\treturn ns;\\n/******/ \\t};\\n/******/\\n/******/ \\t// getDefaultExport function for compatibility with non-harmony modules\\n/******/ \\t__webpack_require__.n = function(module) {\\n/******/ \\t\\tvar getter = module && module.__esModule ?\\n/******/ \\t\\t\\tfunction getDefault() { return module['default']; } :\\n/******/ \\t\\t\\tfunction getModuleExports() { return module; };\\n/******/ \\t\\t__webpack_require__.d(getter, 'a', getter);\\n/******/ \\t\\treturn getter;\\n/******/ \\t};\\n/******/\\n/******/ \\t// Object.prototype.hasOwnProperty.call\\n/******/ \\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\n/******/\\n/******/ \\t// __webpack_public_path__\\n/******/ \\t__webpack_require__.p = \\\"\\\";\\n/******/\\n/******/\\n/******/ \\t// Load entry module and return exports\\n/******/ \\treturn __webpack_require__(__webpack_require__.s = \\\"./node_modules/babel-loader/lib/index.js?!./src/FetchWorkerTool.worker.js\\\");\\n/******/ })\\n/************************************************************************/\\n/******/ ({\\n\\n/***/ \\\"./node_modules/babel-loader/lib/index.js?!./src/FetchWorkerTool.worker.js\\\":\\n/*!*******************************************************************************!*\\\\\\n !*** ./node_modules/babel-loader/lib??ref--4!./src/FetchWorkerTool.worker.js ***!\\n \\\\*******************************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* WEBPACK VAR INJECTION */(function(fetch) {/* eslint-env worker */\\nvar jobsActive = 0;\\nvar complete = [];\\nvar intervalId = null;\\n/**\\n * Register a step function.\\n *\\n * Step checks if there are completed jobs and if there are sends them to the\\n * parent. Then it checks the jobs count. If there are no further jobs, clear\\n * the step.\\n */\\n\\nvar registerStep = function registerStep() {\\n intervalId = setInterval(function () {\\n if (complete.length) {\\n // Send our chunk of completed requests and instruct postMessage to\\n // transfer the buffers instead of copying them.\\n postMessage(complete.slice(), // Instruct postMessage that these buffers in the sent message\\n // should use their Transferable trait. After the postMessage\\n // call the \\\"buffers\\\" will still be in complete if you looked,\\n // but they will all be length 0 as the data they reference has\\n // been sent to the window. This lets us send a lot of data\\n // without the normal postMessage behaviour of making a copy of\\n // all of the data for the window.\\n complete.map(function (response) {\\n return response.buffer;\\n }).filter(Boolean));\\n complete.length = 0;\\n }\\n\\n if (jobsActive === 0) {\\n clearInterval(intervalId);\\n intervalId = null;\\n }\\n }, 1);\\n};\\n/**\\n * Receive a job from the parent and fetch the requested data.\\n * @param {object} options.job A job id, url, and options descriptor to perform.\\n */\\n\\n\\nvar onMessage = function onMessage(_ref) {\\n var job = _ref.data;\\n\\n if (jobsActive === 0 && !intervalId) {\\n registerStep();\\n }\\n\\n jobsActive++;\\n fetch(job.url, job.options).then(function (result) {\\n if (result.ok) return result.arrayBuffer();\\n if (result.status === 404) return null;\\n return Promise.reject(result.status);\\n }).then(function (buffer) {\\n return complete.push({\\n id: job.id,\\n buffer: buffer\\n });\\n }).catch(function (error) {\\n return complete.push({\\n id: job.id,\\n error: error\\n });\\n }).then(function () {\\n return jobsActive--;\\n });\\n};\\n\\nif (self.fetch) {\\n postMessage({\\n support: {\\n fetch: true\\n }\\n });\\n self.addEventListener('message', onMessage);\\n} else {\\n postMessage({\\n support: {\\n fetch: false\\n }\\n });\\n self.addEventListener('message', function (_ref2) {\\n var job = _ref2.data;\\n postMessage([{\\n id: job.id,\\n error: new Error('fetch is unavailable')\\n }]);\\n });\\n}\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! node-fetch */ \\\"./node_modules/node-fetch/lib/index.mjs\\\")[\\\"default\\\"]))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/node-fetch/lib/index.mjs\\\":\\n/*!***********************************************!*\\\\\\n !*** ./node_modules/node-fetch/lib/index.mjs ***!\\n \\\\***********************************************/\\n/*! exports provided: default, Headers, Request, Response, FetchError */\\n/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n__webpack_require__.r(__webpack_exports__);\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Headers\\\", function() { return Headers; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Request\\\", function() { return Request; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"Response\\\", function() { return Response; });\\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \\\"FetchError\\\", function() { return FetchError; });\\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stream */ \\\"stream\\\");\\n/* harmony import */ var http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! http */ \\\"http\\\");\\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! url */ \\\"url\\\");\\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! https */ \\\"https\\\");\\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! zlib */ \\\"zlib\\\");\\n\\n\\n\\n\\n\\n\\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\\n\\n// fix for \\\"Readable\\\" isn't a named export issue\\nconst Readable = stream__WEBPACK_IMPORTED_MODULE_0__.Readable;\\n\\nconst BUFFER = Symbol('buffer');\\nconst TYPE = Symbol('type');\\n\\nclass Blob {\\n\\tconstructor() {\\n\\t\\tthis[TYPE] = '';\\n\\n\\t\\tconst blobParts = arguments[0];\\n\\t\\tconst options = arguments[1];\\n\\n\\t\\tconst buffers = [];\\n\\t\\tlet size = 0;\\n\\n\\t\\tif (blobParts) {\\n\\t\\t\\tconst a = blobParts;\\n\\t\\t\\tconst length = Number(a.length);\\n\\t\\t\\tfor (let i = 0; i < length; i++) {\\n\\t\\t\\t\\tconst element = a[i];\\n\\t\\t\\t\\tlet buffer;\\n\\t\\t\\t\\tif (element instanceof Buffer) {\\n\\t\\t\\t\\t\\tbuffer = element;\\n\\t\\t\\t\\t} else if (ArrayBuffer.isView(element)) {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\\n\\t\\t\\t\\t} else if (element instanceof ArrayBuffer) {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(element);\\n\\t\\t\\t\\t} else if (element instanceof Blob) {\\n\\t\\t\\t\\t\\tbuffer = element[BUFFER];\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tsize += buffer.length;\\n\\t\\t\\t\\tbuffers.push(buffer);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tthis[BUFFER] = Buffer.concat(buffers);\\n\\n\\t\\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\\n\\t\\tif (type && !/[^\\\\u0020-\\\\u007E]/.test(type)) {\\n\\t\\t\\tthis[TYPE] = type;\\n\\t\\t}\\n\\t}\\n\\tget size() {\\n\\t\\treturn this[BUFFER].length;\\n\\t}\\n\\tget type() {\\n\\t\\treturn this[TYPE];\\n\\t}\\n\\ttext() {\\n\\t\\treturn Promise.resolve(this[BUFFER].toString());\\n\\t}\\n\\tarrayBuffer() {\\n\\t\\tconst buf = this[BUFFER];\\n\\t\\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\\n\\t\\treturn Promise.resolve(ab);\\n\\t}\\n\\tstream() {\\n\\t\\tconst readable = new Readable();\\n\\t\\treadable._read = function () {};\\n\\t\\treadable.push(this[BUFFER]);\\n\\t\\treadable.push(null);\\n\\t\\treturn readable;\\n\\t}\\n\\ttoString() {\\n\\t\\treturn '[object Blob]';\\n\\t}\\n\\tslice() {\\n\\t\\tconst size = this.size;\\n\\n\\t\\tconst start = arguments[0];\\n\\t\\tconst end = arguments[1];\\n\\t\\tlet relativeStart, relativeEnd;\\n\\t\\tif (start === undefined) {\\n\\t\\t\\trelativeStart = 0;\\n\\t\\t} else if (start < 0) {\\n\\t\\t\\trelativeStart = Math.max(size + start, 0);\\n\\t\\t} else {\\n\\t\\t\\trelativeStart = Math.min(start, size);\\n\\t\\t}\\n\\t\\tif (end === undefined) {\\n\\t\\t\\trelativeEnd = size;\\n\\t\\t} else if (end < 0) {\\n\\t\\t\\trelativeEnd = Math.max(size + end, 0);\\n\\t\\t} else {\\n\\t\\t\\trelativeEnd = Math.min(end, size);\\n\\t\\t}\\n\\t\\tconst span = Math.max(relativeEnd - relativeStart, 0);\\n\\n\\t\\tconst buffer = this[BUFFER];\\n\\t\\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\\n\\t\\tconst blob = new Blob([], { type: arguments[2] });\\n\\t\\tblob[BUFFER] = slicedBuffer;\\n\\t\\treturn blob;\\n\\t}\\n}\\n\\nObject.defineProperties(Blob.prototype, {\\n\\tsize: { enumerable: true },\\n\\ttype: { enumerable: true },\\n\\tslice: { enumerable: true }\\n});\\n\\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Blob',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\n/**\\n * fetch-error.js\\n *\\n * FetchError interface for operational errors\\n */\\n\\n/**\\n * Create FetchError instance\\n *\\n * @param String message Error message for human\\n * @param String type Error type for machine\\n * @param String systemError For Node.js system error\\n * @return FetchError\\n */\\nfunction FetchError(message, type, systemError) {\\n Error.call(this, message);\\n\\n this.message = message;\\n this.type = type;\\n\\n // when err.type is `system`, err.code contains system error code\\n if (systemError) {\\n this.code = this.errno = systemError.code;\\n }\\n\\n // hide custom error implementation details from end-users\\n Error.captureStackTrace(this, this.constructor);\\n}\\n\\nFetchError.prototype = Object.create(Error.prototype);\\nFetchError.prototype.constructor = FetchError;\\nFetchError.prototype.name = 'FetchError';\\n\\nlet convert;\\ntry {\\n\\tconvert = require('encoding').convert;\\n} catch (e) {}\\n\\nconst INTERNALS = Symbol('Body internals');\\n\\n// fix an issue where \\\"PassThrough\\\" isn't a named export for node <10\\nconst PassThrough = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough;\\n\\n/**\\n * Body mixin\\n *\\n * Ref: https://fetch.spec.whatwg.org/#body\\n *\\n * @param Stream body Readable stream\\n * @param Object opts Response options\\n * @return Void\\n */\\nfunction Body(body) {\\n\\tvar _this = this;\\n\\n\\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\\n\\t _ref$size = _ref.size;\\n\\n\\tlet size = _ref$size === undefined ? 0 : _ref$size;\\n\\tvar _ref$timeout = _ref.timeout;\\n\\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\\n\\n\\tif (body == null) {\\n\\t\\t// body is undefined or null\\n\\t\\tbody = null;\\n\\t} else if (isURLSearchParams(body)) {\\n\\t\\t// body is a URLSearchParams\\n\\t\\tbody = Buffer.from(body.toString());\\n\\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\\n\\t\\t// body is ArrayBuffer\\n\\t\\tbody = Buffer.from(body);\\n\\t} else if (ArrayBuffer.isView(body)) {\\n\\t\\t// body is ArrayBufferView\\n\\t\\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\\n\\t} else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) ; else {\\n\\t\\t// none of the above\\n\\t\\t// coerce to string then buffer\\n\\t\\tbody = Buffer.from(String(body));\\n\\t}\\n\\tthis[INTERNALS] = {\\n\\t\\tbody,\\n\\t\\tdisturbed: false,\\n\\t\\terror: null\\n\\t};\\n\\tthis.size = size;\\n\\tthis.timeout = timeout;\\n\\n\\tif (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) {\\n\\t\\tbody.on('error', function (err) {\\n\\t\\t\\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\\n\\t\\t\\t_this[INTERNALS].error = error;\\n\\t\\t});\\n\\t}\\n}\\n\\nBody.prototype = {\\n\\tget body() {\\n\\t\\treturn this[INTERNALS].body;\\n\\t},\\n\\n\\tget bodyUsed() {\\n\\t\\treturn this[INTERNALS].disturbed;\\n\\t},\\n\\n\\t/**\\n * Decode response as ArrayBuffer\\n *\\n * @return Promise\\n */\\n\\tarrayBuffer() {\\n\\t\\treturn consumeBody.call(this).then(function (buf) {\\n\\t\\t\\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Return raw response as Blob\\n *\\n * @return Promise\\n */\\n\\tblob() {\\n\\t\\tlet ct = this.headers && this.headers.get('content-type') || '';\\n\\t\\treturn consumeBody.call(this).then(function (buf) {\\n\\t\\t\\treturn Object.assign(\\n\\t\\t\\t// Prevent copying\\n\\t\\t\\tnew Blob([], {\\n\\t\\t\\t\\ttype: ct.toLowerCase()\\n\\t\\t\\t}), {\\n\\t\\t\\t\\t[BUFFER]: buf\\n\\t\\t\\t});\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as json\\n *\\n * @return Promise\\n */\\n\\tjson() {\\n\\t\\tvar _this2 = this;\\n\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\treturn JSON.parse(buffer.toString());\\n\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\\n\\t\\t\\t}\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as text\\n *\\n * @return Promise\\n */\\n\\ttext() {\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\treturn buffer.toString();\\n\\t\\t});\\n\\t},\\n\\n\\t/**\\n * Decode response as buffer (non-spec api)\\n *\\n * @return Promise\\n */\\n\\tbuffer() {\\n\\t\\treturn consumeBody.call(this);\\n\\t},\\n\\n\\t/**\\n * Decode response as text, while automatically detecting the encoding and\\n * trying to decode to UTF-8 (non-spec api)\\n *\\n * @return Promise\\n */\\n\\ttextConverted() {\\n\\t\\tvar _this3 = this;\\n\\n\\t\\treturn consumeBody.call(this).then(function (buffer) {\\n\\t\\t\\treturn convertBody(buffer, _this3.headers);\\n\\t\\t});\\n\\t}\\n};\\n\\n// In browsers, all properties are enumerable.\\nObject.defineProperties(Body.prototype, {\\n\\tbody: { enumerable: true },\\n\\tbodyUsed: { enumerable: true },\\n\\tarrayBuffer: { enumerable: true },\\n\\tblob: { enumerable: true },\\n\\tjson: { enumerable: true },\\n\\ttext: { enumerable: true }\\n});\\n\\nBody.mixIn = function (proto) {\\n\\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\\n\\t\\t// istanbul ignore else: future proof\\n\\t\\tif (!(name in proto)) {\\n\\t\\t\\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\\n\\t\\t\\tObject.defineProperty(proto, name, desc);\\n\\t\\t}\\n\\t}\\n};\\n\\n/**\\n * Consume and convert an entire Body to a Buffer.\\n *\\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\\n *\\n * @return Promise\\n */\\nfunction consumeBody() {\\n\\tvar _this4 = this;\\n\\n\\tif (this[INTERNALS].disturbed) {\\n\\t\\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\\n\\t}\\n\\n\\tthis[INTERNALS].disturbed = true;\\n\\n\\tif (this[INTERNALS].error) {\\n\\t\\treturn Body.Promise.reject(this[INTERNALS].error);\\n\\t}\\n\\n\\tlet body = this.body;\\n\\n\\t// body is null\\n\\tif (body === null) {\\n\\t\\treturn Body.Promise.resolve(Buffer.alloc(0));\\n\\t}\\n\\n\\t// body is blob\\n\\tif (isBlob(body)) {\\n\\t\\tbody = body.stream();\\n\\t}\\n\\n\\t// body is buffer\\n\\tif (Buffer.isBuffer(body)) {\\n\\t\\treturn Body.Promise.resolve(body);\\n\\t}\\n\\n\\t// istanbul ignore if: should never happen\\n\\tif (!(body instanceof stream__WEBPACK_IMPORTED_MODULE_0__)) {\\n\\t\\treturn Body.Promise.resolve(Buffer.alloc(0));\\n\\t}\\n\\n\\t// body is stream\\n\\t// get ready to actually consume the body\\n\\tlet accum = [];\\n\\tlet accumBytes = 0;\\n\\tlet abort = false;\\n\\n\\treturn new Body.Promise(function (resolve, reject) {\\n\\t\\tlet resTimeout;\\n\\n\\t\\t// allow timeout on slow response body\\n\\t\\tif (_this4.timeout) {\\n\\t\\t\\tresTimeout = setTimeout(function () {\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\\n\\t\\t\\t}, _this4.timeout);\\n\\t\\t}\\n\\n\\t\\t// handle stream errors\\n\\t\\tbody.on('error', function (err) {\\n\\t\\t\\tif (err.name === 'AbortError') {\\n\\t\\t\\t\\t// if the request was aborted, reject with this Error\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(err);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// other errors, such as incorrect content-encoding\\n\\t\\t\\t\\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\\n\\t\\t\\t}\\n\\t\\t});\\n\\n\\t\\tbody.on('data', function (chunk) {\\n\\t\\t\\tif (abort || chunk === null) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\\n\\t\\t\\t\\tabort = true;\\n\\t\\t\\t\\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\taccumBytes += chunk.length;\\n\\t\\t\\taccum.push(chunk);\\n\\t\\t});\\n\\n\\t\\tbody.on('end', function () {\\n\\t\\t\\tif (abort) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tclearTimeout(resTimeout);\\n\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tresolve(Buffer.concat(accum, accumBytes));\\n\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\t// handle streams that have accumulated too much data (issue #414)\\n\\t\\t\\t\\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\\n\\t\\t\\t}\\n\\t\\t});\\n\\t});\\n}\\n\\n/**\\n * Detect buffer encoding and convert to target encoding\\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\\n *\\n * @param Buffer buffer Incoming buffer\\n * @param String encoding Target encoding\\n * @return String\\n */\\nfunction convertBody(buffer, headers) {\\n\\tif (typeof convert !== 'function') {\\n\\t\\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\\n\\t}\\n\\n\\tconst ct = headers.get('content-type');\\n\\tlet charset = 'utf-8';\\n\\tlet res, str;\\n\\n\\t// header\\n\\tif (ct) {\\n\\t\\tres = /charset=([^;]*)/i.exec(ct);\\n\\t}\\n\\n\\t// no charset in content type, peek at response body for at most 1024 bytes\\n\\tstr = buffer.slice(0, 1024).toString();\\n\\n\\t// html5\\n\\tif (!res && str) {\\n\\t\\tres = /<meta.+?charset=(['\\\"])(.+?)\\\\1/i.exec(str);\\n\\t}\\n\\n\\t// html4\\n\\tif (!res && str) {\\n\\t\\tres = /<meta[\\\\s]+?http-equiv=(['\\\"])content-type\\\\1[\\\\s]+?content=(['\\\"])(.+?)\\\\2/i.exec(str);\\n\\t\\tif (!res) {\\n\\t\\t\\tres = /<meta[\\\\s]+?content=(['\\\"])(.+?)\\\\1[\\\\s]+?http-equiv=(['\\\"])content-type\\\\3/i.exec(str);\\n\\t\\t\\tif (res) {\\n\\t\\t\\t\\tres.pop(); // drop last quote\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif (res) {\\n\\t\\t\\tres = /charset=(.*)/i.exec(res.pop());\\n\\t\\t}\\n\\t}\\n\\n\\t// xml\\n\\tif (!res && str) {\\n\\t\\tres = /<\\\\?xml.+?encoding=(['\\\"])(.+?)\\\\1/i.exec(str);\\n\\t}\\n\\n\\t// found charset\\n\\tif (res) {\\n\\t\\tcharset = res.pop();\\n\\n\\t\\t// prevent decode issues when sites use incorrect encoding\\n\\t\\t// ref: https://hsivonen.fi/encoding-menu/\\n\\t\\tif (charset === 'gb2312' || charset === 'gbk') {\\n\\t\\t\\tcharset = 'gb18030';\\n\\t\\t}\\n\\t}\\n\\n\\t// turn raw buffers into a single utf-8 buffer\\n\\treturn convert(buffer, 'UTF-8', charset).toString();\\n}\\n\\n/**\\n * Detect a URLSearchParams object\\n * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143\\n *\\n * @param Object obj Object to detect by type or brand\\n * @return String\\n */\\nfunction isURLSearchParams(obj) {\\n\\t// Duck-typing as a necessary condition.\\n\\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\\n\\t\\treturn false;\\n\\t}\\n\\n\\t// Brand-checking and more duck-typing as optional condition.\\n\\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\\n}\\n\\n/**\\n * Check if `obj` is a W3C `Blob` object (which `File` inherits from)\\n * @param {*} obj\\n * @return {boolean}\\n */\\nfunction isBlob(obj) {\\n\\treturn typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);\\n}\\n\\n/**\\n * Clone body given Res/Req instance\\n *\\n * @param Mixed instance Response or Request instance\\n * @return Mixed\\n */\\nfunction clone(instance) {\\n\\tlet p1, p2;\\n\\tlet body = instance.body;\\n\\n\\t// don't allow cloning a used body\\n\\tif (instance.bodyUsed) {\\n\\t\\tthrow new Error('cannot clone body after it is used');\\n\\t}\\n\\n\\t// check that body is a stream and not form-data object\\n\\t// note: we can't clone the form-data object without having it as a dependency\\n\\tif (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__ && typeof body.getBoundary !== 'function') {\\n\\t\\t// tee instance body\\n\\t\\tp1 = new PassThrough();\\n\\t\\tp2 = new PassThrough();\\n\\t\\tbody.pipe(p1);\\n\\t\\tbody.pipe(p2);\\n\\t\\t// set instance body to teed body and return the other teed body\\n\\t\\tinstance[INTERNALS].body = p1;\\n\\t\\tbody = p2;\\n\\t}\\n\\n\\treturn body;\\n}\\n\\n/**\\n * Performs the operation \\\"extract a `Content-Type` value from |object|\\\" as\\n * specified in the specification:\\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\\n *\\n * This function assumes that instance.body is present.\\n *\\n * @param Mixed instance Any options.body input\\n */\\nfunction extractContentType(body) {\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\treturn null;\\n\\t} else if (typeof body === 'string') {\\n\\t\\t// body is string\\n\\t\\treturn 'text/plain;charset=UTF-8';\\n\\t} else if (isURLSearchParams(body)) {\\n\\t\\t// body is a URLSearchParams\\n\\t\\treturn 'application/x-www-form-urlencoded;charset=UTF-8';\\n\\t} else if (isBlob(body)) {\\n\\t\\t// body is blob\\n\\t\\treturn body.type || null;\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\treturn null;\\n\\t} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\\n\\t\\t// body is ArrayBuffer\\n\\t\\treturn null;\\n\\t} else if (ArrayBuffer.isView(body)) {\\n\\t\\t// body is ArrayBufferView\\n\\t\\treturn null;\\n\\t} else if (typeof body.getBoundary === 'function') {\\n\\t\\t// detect form data input from form-data module\\n\\t\\treturn `multipart/form-data;boundary=${body.getBoundary()}`;\\n\\t} else if (body instanceof stream__WEBPACK_IMPORTED_MODULE_0__) {\\n\\t\\t// body is stream\\n\\t\\t// can't really do much about this\\n\\t\\treturn null;\\n\\t} else {\\n\\t\\t// Body constructor defaults other things to string\\n\\t\\treturn 'text/plain;charset=UTF-8';\\n\\t}\\n}\\n\\n/**\\n * The Fetch Standard treats this as if \\\"total bytes\\\" is a property on the body.\\n * For us, we have to explicitly get it with a function.\\n *\\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\\n *\\n * @param Body instance Instance of Body\\n * @return Number? Number of bytes, or null if not possible\\n */\\nfunction getTotalBytes(instance) {\\n\\tconst body = instance.body;\\n\\n\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\treturn 0;\\n\\t} else if (isBlob(body)) {\\n\\t\\treturn body.size;\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\treturn body.length;\\n\\t} else if (body && typeof body.getLengthSync === 'function') {\\n\\t\\t// detect form data input from form-data module\\n\\t\\tif (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x\\n\\t\\tbody.hasKnownLength && body.hasKnownLength()) {\\n\\t\\t\\t// 2.x\\n\\t\\t\\treturn body.getLengthSync();\\n\\t\\t}\\n\\t\\treturn null;\\n\\t} else {\\n\\t\\t// body is stream\\n\\t\\treturn null;\\n\\t}\\n}\\n\\n/**\\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\\n *\\n * @param Body instance Instance of Body\\n * @return Void\\n */\\nfunction writeToStream(dest, instance) {\\n\\tconst body = instance.body;\\n\\n\\n\\tif (body === null) {\\n\\t\\t// body is null\\n\\t\\tdest.end();\\n\\t} else if (isBlob(body)) {\\n\\t\\tbody.stream().pipe(dest);\\n\\t} else if (Buffer.isBuffer(body)) {\\n\\t\\t// body is buffer\\n\\t\\tdest.write(body);\\n\\t\\tdest.end();\\n\\t} else {\\n\\t\\t// body is stream\\n\\t\\tbody.pipe(dest);\\n\\t}\\n}\\n\\n// expose Promise\\nBody.Promise = global.Promise;\\n\\n/**\\n * headers.js\\n *\\n * Headers class offers convenient helpers\\n */\\n\\nconst invalidTokenRegex = /[^\\\\^_`a-zA-Z\\\\-0-9!#$%&'*+.|~]/;\\nconst invalidHeaderCharRegex = /[^\\\\t\\\\x20-\\\\x7e\\\\x80-\\\\xff]/;\\n\\nfunction validateName(name) {\\n\\tname = `${name}`;\\n\\tif (invalidTokenRegex.test(name) || name === '') {\\n\\t\\tthrow new TypeError(`${name} is not a legal HTTP header name`);\\n\\t}\\n}\\n\\nfunction validateValue(value) {\\n\\tvalue = `${value}`;\\n\\tif (invalidHeaderCharRegex.test(value)) {\\n\\t\\tthrow new TypeError(`${value} is not a legal HTTP header value`);\\n\\t}\\n}\\n\\n/**\\n * Find the key in the map object given a header name.\\n *\\n * Returns undefined if not found.\\n *\\n * @param String name Header name\\n * @return String|Undefined\\n */\\nfunction find(map, name) {\\n\\tname = name.toLowerCase();\\n\\tfor (const key in map) {\\n\\t\\tif (key.toLowerCase() === name) {\\n\\t\\t\\treturn key;\\n\\t\\t}\\n\\t}\\n\\treturn undefined;\\n}\\n\\nconst MAP = Symbol('map');\\nclass Headers {\\n\\t/**\\n * Headers class\\n *\\n * @param Object headers Response headers\\n * @return Void\\n */\\n\\tconstructor() {\\n\\t\\tlet init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\\n\\n\\t\\tthis[MAP] = Object.create(null);\\n\\n\\t\\tif (init instanceof Headers) {\\n\\t\\t\\tconst rawHeaders = init.raw();\\n\\t\\t\\tconst headerNames = Object.keys(rawHeaders);\\n\\n\\t\\t\\tfor (const headerName of headerNames) {\\n\\t\\t\\t\\tfor (const value of rawHeaders[headerName]) {\\n\\t\\t\\t\\t\\tthis.append(headerName, value);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\t// We don't worry about converting prop to ByteString here as append()\\n\\t\\t// will handle it.\\n\\t\\tif (init == null) ; else if (typeof init === 'object') {\\n\\t\\t\\tconst method = init[Symbol.iterator];\\n\\t\\t\\tif (method != null) {\\n\\t\\t\\t\\tif (typeof method !== 'function') {\\n\\t\\t\\t\\t\\tthrow new TypeError('Header pairs must be iterable');\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t// sequence<sequence<ByteString>>\\n\\t\\t\\t\\t// Note: per spec we have to first exhaust the lists then process them\\n\\t\\t\\t\\tconst pairs = [];\\n\\t\\t\\t\\tfor (const pair of init) {\\n\\t\\t\\t\\t\\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\\n\\t\\t\\t\\t\\t\\tthrow new TypeError('Each header pair must be iterable');\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tpairs.push(Array.from(pair));\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tfor (const pair of pairs) {\\n\\t\\t\\t\\t\\tif (pair.length !== 2) {\\n\\t\\t\\t\\t\\t\\tthrow new TypeError('Each header pair must be a name/value tuple');\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tthis.append(pair[0], pair[1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// record<ByteString, ByteString>\\n\\t\\t\\t\\tfor (const key of Object.keys(init)) {\\n\\t\\t\\t\\t\\tconst value = init[key];\\n\\t\\t\\t\\t\\tthis.append(key, value);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tthrow new TypeError('Provided initializer must be an object');\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Return combined header value given name\\n *\\n * @param String name Header name\\n * @return Mixed\\n */\\n\\tget(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key === undefined) {\\n\\t\\t\\treturn null;\\n\\t\\t}\\n\\n\\t\\treturn this[MAP][key].join(', ');\\n\\t}\\n\\n\\t/**\\n * Iterate over all headers\\n *\\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\\n * @param Boolean thisArg `this` context for callback function\\n * @return Void\\n */\\n\\tforEach(callback) {\\n\\t\\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\\n\\n\\t\\tlet pairs = getHeaders(this);\\n\\t\\tlet i = 0;\\n\\t\\twhile (i < pairs.length) {\\n\\t\\t\\tvar _pairs$i = pairs[i];\\n\\t\\t\\tconst name = _pairs$i[0],\\n\\t\\t\\t value = _pairs$i[1];\\n\\n\\t\\t\\tcallback.call(thisArg, value, name, this);\\n\\t\\t\\tpairs = getHeaders(this);\\n\\t\\t\\ti++;\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Overwrite header values given name\\n *\\n * @param String name Header name\\n * @param String value Header value\\n * @return Void\\n */\\n\\tset(name, value) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalue = `${value}`;\\n\\t\\tvalidateName(name);\\n\\t\\tvalidateValue(value);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tthis[MAP][key !== undefined ? key : name] = [value];\\n\\t}\\n\\n\\t/**\\n * Append a value onto existing header\\n *\\n * @param String name Header name\\n * @param String value Header value\\n * @return Void\\n */\\n\\tappend(name, value) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalue = `${value}`;\\n\\t\\tvalidateName(name);\\n\\t\\tvalidateValue(value);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key !== undefined) {\\n\\t\\t\\tthis[MAP][key].push(value);\\n\\t\\t} else {\\n\\t\\t\\tthis[MAP][name] = [value];\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Check for header name existence\\n *\\n * @param String name Header name\\n * @return Boolean\\n */\\n\\thas(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\treturn find(this[MAP], name) !== undefined;\\n\\t}\\n\\n\\t/**\\n * Delete all header values given name\\n *\\n * @param String name Header name\\n * @return Void\\n */\\n\\tdelete(name) {\\n\\t\\tname = `${name}`;\\n\\t\\tvalidateName(name);\\n\\t\\tconst key = find(this[MAP], name);\\n\\t\\tif (key !== undefined) {\\n\\t\\t\\tdelete this[MAP][key];\\n\\t\\t}\\n\\t}\\n\\n\\t/**\\n * Return raw headers (non-spec api)\\n *\\n * @return Object\\n */\\n\\traw() {\\n\\t\\treturn this[MAP];\\n\\t}\\n\\n\\t/**\\n * Get an iterator on keys.\\n *\\n * @return Iterator\\n */\\n\\tkeys() {\\n\\t\\treturn createHeadersIterator(this, 'key');\\n\\t}\\n\\n\\t/**\\n * Get an iterator on values.\\n *\\n * @return Iterator\\n */\\n\\tvalues() {\\n\\t\\treturn createHeadersIterator(this, 'value');\\n\\t}\\n\\n\\t/**\\n * Get an iterator on entries.\\n *\\n * This is the default iterator of the Headers object.\\n *\\n * @return Iterator\\n */\\n\\t[Symbol.iterator]() {\\n\\t\\treturn createHeadersIterator(this, 'key+value');\\n\\t}\\n}\\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\\n\\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Headers',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nObject.defineProperties(Headers.prototype, {\\n\\tget: { enumerable: true },\\n\\tforEach: { enumerable: true },\\n\\tset: { enumerable: true },\\n\\tappend: { enumerable: true },\\n\\thas: { enumerable: true },\\n\\tdelete: { enumerable: true },\\n\\tkeys: { enumerable: true },\\n\\tvalues: { enumerable: true },\\n\\tentries: { enumerable: true }\\n});\\n\\nfunction getHeaders(headers) {\\n\\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\\n\\n\\tconst keys = Object.keys(headers[MAP]).sort();\\n\\treturn keys.map(kind === 'key' ? function (k) {\\n\\t\\treturn k.toLowerCase();\\n\\t} : kind === 'value' ? function (k) {\\n\\t\\treturn headers[MAP][k].join(', ');\\n\\t} : function (k) {\\n\\t\\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\\n\\t});\\n}\\n\\nconst INTERNAL = Symbol('internal');\\n\\nfunction createHeadersIterator(target, kind) {\\n\\tconst iterator = Object.create(HeadersIteratorPrototype);\\n\\titerator[INTERNAL] = {\\n\\t\\ttarget,\\n\\t\\tkind,\\n\\t\\tindex: 0\\n\\t};\\n\\treturn iterator;\\n}\\n\\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\\n\\tnext() {\\n\\t\\t// istanbul ignore if\\n\\t\\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\\n\\t\\t\\tthrow new TypeError('Value of `this` is not a HeadersIterator');\\n\\t\\t}\\n\\n\\t\\tvar _INTERNAL = this[INTERNAL];\\n\\t\\tconst target = _INTERNAL.target,\\n\\t\\t kind = _INTERNAL.kind,\\n\\t\\t index = _INTERNAL.index;\\n\\n\\t\\tconst values = getHeaders(target, kind);\\n\\t\\tconst len = values.length;\\n\\t\\tif (index >= len) {\\n\\t\\t\\treturn {\\n\\t\\t\\t\\tvalue: undefined,\\n\\t\\t\\t\\tdone: true\\n\\t\\t\\t};\\n\\t\\t}\\n\\n\\t\\tthis[INTERNAL].index = index + 1;\\n\\n\\t\\treturn {\\n\\t\\t\\tvalue: values[index],\\n\\t\\t\\tdone: false\\n\\t\\t};\\n\\t}\\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\\n\\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\\n\\tvalue: 'HeadersIterator',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\n/**\\n * Export the Headers object in a form that Node.js can consume.\\n *\\n * @param Headers headers\\n * @return Object\\n */\\nfunction exportNodeCompatibleHeaders(headers) {\\n\\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\\n\\n\\t// http.request() only supports string as Host header. This hack makes\\n\\t// specifying custom Host header possible.\\n\\tconst hostHeaderKey = find(headers[MAP], 'Host');\\n\\tif (hostHeaderKey !== undefined) {\\n\\t\\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\\n\\t}\\n\\n\\treturn obj;\\n}\\n\\n/**\\n * Create a Headers object from an object of headers, ignoring those that do\\n * not conform to HTTP grammar productions.\\n *\\n * @param Object obj Object of headers\\n * @return Headers\\n */\\nfunction createHeadersLenient(obj) {\\n\\tconst headers = new Headers();\\n\\tfor (const name of Object.keys(obj)) {\\n\\t\\tif (invalidTokenRegex.test(name)) {\\n\\t\\t\\tcontinue;\\n\\t\\t}\\n\\t\\tif (Array.isArray(obj[name])) {\\n\\t\\t\\tfor (const val of obj[name]) {\\n\\t\\t\\t\\tif (invalidHeaderCharRegex.test(val)) {\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (headers[MAP][name] === undefined) {\\n\\t\\t\\t\\t\\theaders[MAP][name] = [val];\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\theaders[MAP][name].push(val);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\\n\\t\\t\\theaders[MAP][name] = [obj[name]];\\n\\t\\t}\\n\\t}\\n\\treturn headers;\\n}\\n\\nconst INTERNALS$1 = Symbol('Response internals');\\n\\n// fix an issue where \\\"STATUS_CODES\\\" aren't a named export for node <10\\nconst STATUS_CODES = http__WEBPACK_IMPORTED_MODULE_1__.STATUS_CODES;\\n\\n/**\\n * Response class\\n *\\n * @param Stream body Readable stream\\n * @param Object opts Response options\\n * @return Void\\n */\\nclass Response {\\n\\tconstructor() {\\n\\t\\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\\n\\t\\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\\n\\n\\t\\tBody.call(this, body, opts);\\n\\n\\t\\tconst status = opts.status || 200;\\n\\t\\tconst headers = new Headers(opts.headers);\\n\\n\\t\\tif (body != null && !headers.has('Content-Type')) {\\n\\t\\t\\tconst contentType = extractContentType(body);\\n\\t\\t\\tif (contentType) {\\n\\t\\t\\t\\theaders.append('Content-Type', contentType);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tthis[INTERNALS$1] = {\\n\\t\\t\\turl: opts.url,\\n\\t\\t\\tstatus,\\n\\t\\t\\tstatusText: opts.statusText || STATUS_CODES[status],\\n\\t\\t\\theaders,\\n\\t\\t\\tcounter: opts.counter\\n\\t\\t};\\n\\t}\\n\\n\\tget url() {\\n\\t\\treturn this[INTERNALS$1].url || '';\\n\\t}\\n\\n\\tget status() {\\n\\t\\treturn this[INTERNALS$1].status;\\n\\t}\\n\\n\\t/**\\n * Convenience property representing if the request ended normally\\n */\\n\\tget ok() {\\n\\t\\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\\n\\t}\\n\\n\\tget redirected() {\\n\\t\\treturn this[INTERNALS$1].counter > 0;\\n\\t}\\n\\n\\tget statusText() {\\n\\t\\treturn this[INTERNALS$1].statusText;\\n\\t}\\n\\n\\tget headers() {\\n\\t\\treturn this[INTERNALS$1].headers;\\n\\t}\\n\\n\\t/**\\n * Clone this response\\n *\\n * @return Response\\n */\\n\\tclone() {\\n\\t\\treturn new Response(clone(this), {\\n\\t\\t\\turl: this.url,\\n\\t\\t\\tstatus: this.status,\\n\\t\\t\\tstatusText: this.statusText,\\n\\t\\t\\theaders: this.headers,\\n\\t\\t\\tok: this.ok,\\n\\t\\t\\tredirected: this.redirected\\n\\t\\t});\\n\\t}\\n}\\n\\nBody.mixIn(Response.prototype);\\n\\nObject.defineProperties(Response.prototype, {\\n\\turl: { enumerable: true },\\n\\tstatus: { enumerable: true },\\n\\tok: { enumerable: true },\\n\\tredirected: { enumerable: true },\\n\\tstatusText: { enumerable: true },\\n\\theaders: { enumerable: true },\\n\\tclone: { enumerable: true }\\n});\\n\\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Response',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nconst INTERNALS$2 = Symbol('Request internals');\\n\\n// fix an issue where \\\"format\\\", \\\"parse\\\" aren't a named export for node <10\\nconst parse_url = url__WEBPACK_IMPORTED_MODULE_2__.parse;\\nconst format_url = url__WEBPACK_IMPORTED_MODULE_2__.format;\\n\\nconst streamDestructionSupported = 'destroy' in stream__WEBPACK_IMPORTED_MODULE_0__.Readable.prototype;\\n\\n/**\\n * Check if a value is an instance of Request.\\n *\\n * @param Mixed input\\n * @return Boolean\\n */\\nfunction isRequest(input) {\\n\\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\\n}\\n\\nfunction isAbortSignal(signal) {\\n\\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\\n\\treturn !!(proto && proto.constructor.name === 'AbortSignal');\\n}\\n\\n/**\\n * Request class\\n *\\n * @param Mixed input Url or Request instance\\n * @param Object init Custom options\\n * @return Void\\n */\\nclass Request {\\n\\tconstructor(input) {\\n\\t\\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\\n\\n\\t\\tlet parsedURL;\\n\\n\\t\\t// normalize input\\n\\t\\tif (!isRequest(input)) {\\n\\t\\t\\tif (input && input.href) {\\n\\t\\t\\t\\t// in order to support Node.js' Url objects; though WHATWG's URL objects\\n\\t\\t\\t\\t// will fall into this branch also (since their `toString()` will return\\n\\t\\t\\t\\t// `href` property anyway)\\n\\t\\t\\t\\tparsedURL = parse_url(input.href);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t// coerce input to a string before attempting to parse\\n\\t\\t\\t\\tparsedURL = parse_url(`${input}`);\\n\\t\\t\\t}\\n\\t\\t\\tinput = {};\\n\\t\\t} else {\\n\\t\\t\\tparsedURL = parse_url(input.url);\\n\\t\\t}\\n\\n\\t\\tlet method = init.method || input.method || 'GET';\\n\\t\\tmethod = method.toUpperCase();\\n\\n\\t\\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\\n\\t\\t\\tthrow new TypeError('Request with GET/HEAD method cannot have body');\\n\\t\\t}\\n\\n\\t\\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\\n\\n\\t\\tBody.call(this, inputBody, {\\n\\t\\t\\ttimeout: init.timeout || input.timeout || 0,\\n\\t\\t\\tsize: init.size || input.size || 0\\n\\t\\t});\\n\\n\\t\\tconst headers = new Headers(init.headers || input.headers || {});\\n\\n\\t\\tif (inputBody != null && !headers.has('Content-Type')) {\\n\\t\\t\\tconst contentType = extractContentType(inputBody);\\n\\t\\t\\tif (contentType) {\\n\\t\\t\\t\\theaders.append('Content-Type', contentType);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tlet signal = isRequest(input) ? input.signal : null;\\n\\t\\tif ('signal' in init) signal = init.signal;\\n\\n\\t\\tif (signal != null && !isAbortSignal(signal)) {\\n\\t\\t\\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\\n\\t\\t}\\n\\n\\t\\tthis[INTERNALS$2] = {\\n\\t\\t\\tmethod,\\n\\t\\t\\tredirect: init.redirect || input.redirect || 'follow',\\n\\t\\t\\theaders,\\n\\t\\t\\tparsedURL,\\n\\t\\t\\tsignal\\n\\t\\t};\\n\\n\\t\\t// node-fetch-only options\\n\\t\\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\\n\\t\\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\\n\\t\\tthis.counter = init.counter || input.counter || 0;\\n\\t\\tthis.agent = init.agent || input.agent;\\n\\t}\\n\\n\\tget method() {\\n\\t\\treturn this[INTERNALS$2].method;\\n\\t}\\n\\n\\tget url() {\\n\\t\\treturn format_url(this[INTERNALS$2].parsedURL);\\n\\t}\\n\\n\\tget headers() {\\n\\t\\treturn this[INTERNALS$2].headers;\\n\\t}\\n\\n\\tget redirect() {\\n\\t\\treturn this[INTERNALS$2].redirect;\\n\\t}\\n\\n\\tget signal() {\\n\\t\\treturn this[INTERNALS$2].signal;\\n\\t}\\n\\n\\t/**\\n * Clone this request\\n *\\n * @return Request\\n */\\n\\tclone() {\\n\\t\\treturn new Request(this);\\n\\t}\\n}\\n\\nBody.mixIn(Request.prototype);\\n\\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\\n\\tvalue: 'Request',\\n\\twritable: false,\\n\\tenumerable: false,\\n\\tconfigurable: true\\n});\\n\\nObject.defineProperties(Request.prototype, {\\n\\tmethod: { enumerable: true },\\n\\turl: { enumerable: true },\\n\\theaders: { enumerable: true },\\n\\tredirect: { enumerable: true },\\n\\tclone: { enumerable: true },\\n\\tsignal: { enumerable: true }\\n});\\n\\n/**\\n * Convert a Request to Node.js http request options.\\n *\\n * @param Request A Request instance\\n * @return Object The options object to be passed to http.request\\n */\\nfunction getNodeRequestOptions(request) {\\n\\tconst parsedURL = request[INTERNALS$2].parsedURL;\\n\\tconst headers = new Headers(request[INTERNALS$2].headers);\\n\\n\\t// fetch step 1.3\\n\\tif (!headers.has('Accept')) {\\n\\t\\theaders.set('Accept', '*/*');\\n\\t}\\n\\n\\t// Basic fetch\\n\\tif (!parsedURL.protocol || !parsedURL.hostname) {\\n\\t\\tthrow new TypeError('Only absolute URLs are supported');\\n\\t}\\n\\n\\tif (!/^https?:$/.test(parsedURL.protocol)) {\\n\\t\\tthrow new TypeError('Only HTTP(S) protocols are supported');\\n\\t}\\n\\n\\tif (request.signal && request.body instanceof stream__WEBPACK_IMPORTED_MODULE_0__.Readable && !streamDestructionSupported) {\\n\\t\\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch steps 2.4-2.7\\n\\tlet contentLengthValue = null;\\n\\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\\n\\t\\tcontentLengthValue = '0';\\n\\t}\\n\\tif (request.body != null) {\\n\\t\\tconst totalBytes = getTotalBytes(request);\\n\\t\\tif (typeof totalBytes === 'number') {\\n\\t\\t\\tcontentLengthValue = String(totalBytes);\\n\\t\\t}\\n\\t}\\n\\tif (contentLengthValue) {\\n\\t\\theaders.set('Content-Length', contentLengthValue);\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch step 2.11\\n\\tif (!headers.has('User-Agent')) {\\n\\t\\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\\n\\t}\\n\\n\\t// HTTP-network-or-cache fetch step 2.15\\n\\tif (request.compress && !headers.has('Accept-Encoding')) {\\n\\t\\theaders.set('Accept-Encoding', 'gzip,deflate');\\n\\t}\\n\\n\\tlet agent = request.agent;\\n\\tif (typeof agent === 'function') {\\n\\t\\tagent = agent(parsedURL);\\n\\t}\\n\\n\\tif (!headers.has('Connection') && !agent) {\\n\\t\\theaders.set('Connection', 'close');\\n\\t}\\n\\n\\t// HTTP-network fetch step 4.2\\n\\t// chunked encoding is handled by Node.js\\n\\n\\treturn Object.assign({}, parsedURL, {\\n\\t\\tmethod: request.method,\\n\\t\\theaders: exportNodeCompatibleHeaders(headers),\\n\\t\\tagent\\n\\t});\\n}\\n\\n/**\\n * abort-error.js\\n *\\n * AbortError interface for cancelled requests\\n */\\n\\n/**\\n * Create AbortError instance\\n *\\n * @param String message Error message for human\\n * @return AbortError\\n */\\nfunction AbortError(message) {\\n Error.call(this, message);\\n\\n this.type = 'aborted';\\n this.message = message;\\n\\n // hide custom error implementation details from end-users\\n Error.captureStackTrace(this, this.constructor);\\n}\\n\\nAbortError.prototype = Object.create(Error.prototype);\\nAbortError.prototype.constructor = AbortError;\\nAbortError.prototype.name = 'AbortError';\\n\\n// fix an issue where \\\"PassThrough\\\", \\\"resolve\\\" aren't a named export for node <10\\nconst PassThrough$1 = stream__WEBPACK_IMPORTED_MODULE_0__.PassThrough;\\nconst resolve_url = url__WEBPACK_IMPORTED_MODULE_2__.resolve;\\n\\n/**\\n * Fetch function\\n *\\n * @param Mixed url Absolute url or Request instance\\n * @param Object opts Fetch options\\n * @return Promise\\n */\\nfunction fetch(url, opts) {\\n\\n\\t// allow custom promise\\n\\tif (!fetch.Promise) {\\n\\t\\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\\n\\t}\\n\\n\\tBody.Promise = fetch.Promise;\\n\\n\\t// wrap http.request into fetch\\n\\treturn new fetch.Promise(function (resolve, reject) {\\n\\t\\t// build request object\\n\\t\\tconst request = new Request(url, opts);\\n\\t\\tconst options = getNodeRequestOptions(request);\\n\\n\\t\\tconst send = (options.protocol === 'https:' ? https__WEBPACK_IMPORTED_MODULE_3__ : http__WEBPACK_IMPORTED_MODULE_1__).request;\\n\\t\\tconst signal = request.signal;\\n\\n\\t\\tlet response = null;\\n\\n\\t\\tconst abort = function abort() {\\n\\t\\t\\tlet error = new AbortError('The user aborted a request.');\\n\\t\\t\\treject(error);\\n\\t\\t\\tif (request.body && request.body instanceof stream__WEBPACK_IMPORTED_MODULE_0__.Readable) {\\n\\t\\t\\t\\trequest.body.destroy(error);\\n\\t\\t\\t}\\n\\t\\t\\tif (!response || !response.body) return;\\n\\t\\t\\tresponse.body.emit('error', error);\\n\\t\\t};\\n\\n\\t\\tif (signal && signal.aborted) {\\n\\t\\t\\tabort();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tconst abortAndFinalize = function abortAndFinalize() {\\n\\t\\t\\tabort();\\n\\t\\t\\tfinalize();\\n\\t\\t};\\n\\n\\t\\t// send request\\n\\t\\tconst req = send(options);\\n\\t\\tlet reqTimeout;\\n\\n\\t\\tif (signal) {\\n\\t\\t\\tsignal.addEventListener('abort', abortAndFinalize);\\n\\t\\t}\\n\\n\\t\\tfunction finalize() {\\n\\t\\t\\treq.abort();\\n\\t\\t\\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\\n\\t\\t\\tclearTimeout(reqTimeout);\\n\\t\\t}\\n\\n\\t\\tif (request.timeout) {\\n\\t\\t\\treq.once('socket', function (socket) {\\n\\t\\t\\t\\treqTimeout = setTimeout(function () {\\n\\t\\t\\t\\t\\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\\n\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t}, request.timeout);\\n\\t\\t\\t});\\n\\t\\t}\\n\\n\\t\\treq.on('error', function (err) {\\n\\t\\t\\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\\n\\t\\t\\tfinalize();\\n\\t\\t});\\n\\n\\t\\treq.on('response', function (res) {\\n\\t\\t\\tclearTimeout(reqTimeout);\\n\\n\\t\\t\\tconst headers = createHeadersLenient(res.headers);\\n\\n\\t\\t\\t// HTTP fetch step 5\\n\\t\\t\\tif (fetch.isRedirect(res.statusCode)) {\\n\\t\\t\\t\\t// HTTP fetch step 5.2\\n\\t\\t\\t\\tconst location = headers.get('Location');\\n\\n\\t\\t\\t\\t// HTTP fetch step 5.3\\n\\t\\t\\t\\tconst locationURL = location === null ? null : resolve_url(request.url, location);\\n\\n\\t\\t\\t\\t// HTTP fetch step 5.5\\n\\t\\t\\t\\tswitch (request.redirect) {\\n\\t\\t\\t\\t\\tcase 'error':\\n\\t\\t\\t\\t\\t\\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\\n\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\tcase 'manual':\\n\\t\\t\\t\\t\\t\\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\\n\\t\\t\\t\\t\\t\\tif (locationURL !== null) {\\n\\t\\t\\t\\t\\t\\t\\t// handle corrupted header\\n\\t\\t\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\t\\t\\theaders.set('Location', locationURL);\\n\\t\\t\\t\\t\\t\\t\\t} catch (err) {\\n\\t\\t\\t\\t\\t\\t\\t\\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\\n\\t\\t\\t\\t\\t\\t\\t\\treject(err);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\tcase 'follow':\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 2\\n\\t\\t\\t\\t\\t\\tif (locationURL === null) {\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 5\\n\\t\\t\\t\\t\\t\\tif (request.counter >= request.follow) {\\n\\t\\t\\t\\t\\t\\t\\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\\n\\t\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 6 (counter increment)\\n\\t\\t\\t\\t\\t\\t// Create a new Request object.\\n\\t\\t\\t\\t\\t\\tconst requestOpts = {\\n\\t\\t\\t\\t\\t\\t\\theaders: new Headers(request.headers),\\n\\t\\t\\t\\t\\t\\t\\tfollow: request.follow,\\n\\t\\t\\t\\t\\t\\t\\tcounter: request.counter + 1,\\n\\t\\t\\t\\t\\t\\t\\tagent: request.agent,\\n\\t\\t\\t\\t\\t\\t\\tcompress: request.compress,\\n\\t\\t\\t\\t\\t\\t\\tmethod: request.method,\\n\\t\\t\\t\\t\\t\\t\\tbody: request.body,\\n\\t\\t\\t\\t\\t\\t\\tsignal: request.signal,\\n\\t\\t\\t\\t\\t\\t\\ttimeout: request.timeout,\\n\\t\\t\\t\\t\\t\\t\\tsize: request.size\\n\\t\\t\\t\\t\\t\\t};\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 9\\n\\t\\t\\t\\t\\t\\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\\n\\t\\t\\t\\t\\t\\t\\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\\n\\t\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 11\\n\\t\\t\\t\\t\\t\\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.method = 'GET';\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.body = undefined;\\n\\t\\t\\t\\t\\t\\t\\trequestOpts.headers.delete('content-length');\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t// HTTP-redirect fetch step 15\\n\\t\\t\\t\\t\\t\\tresolve(fetch(new Request(locationURL, requestOpts)));\\n\\t\\t\\t\\t\\t\\tfinalize();\\n\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t// prepare response\\n\\t\\t\\tres.once('end', function () {\\n\\t\\t\\t\\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\\n\\t\\t\\t});\\n\\t\\t\\tlet body = res.pipe(new PassThrough$1());\\n\\n\\t\\t\\tconst response_options = {\\n\\t\\t\\t\\turl: request.url,\\n\\t\\t\\t\\tstatus: res.statusCode,\\n\\t\\t\\t\\tstatusText: res.statusMessage,\\n\\t\\t\\t\\theaders: headers,\\n\\t\\t\\t\\tsize: request.size,\\n\\t\\t\\t\\ttimeout: request.timeout,\\n\\t\\t\\t\\tcounter: request.counter\\n\\t\\t\\t};\\n\\n\\t\\t\\t// HTTP-network fetch step 12.1.1.3\\n\\t\\t\\tconst codings = headers.get('Content-Encoding');\\n\\n\\t\\t\\t// HTTP-network fetch step 12.1.1.4: handle content codings\\n\\n\\t\\t\\t// in following scenarios we ignore compression support\\n\\t\\t\\t// 1. compression support is disabled\\n\\t\\t\\t// 2. HEAD request\\n\\t\\t\\t// 3. no Content-Encoding header\\n\\t\\t\\t// 4. no content response (204)\\n\\t\\t\\t// 5. content not modified response (304)\\n\\t\\t\\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// For Node v6+\\n\\t\\t\\t// Be less strict when decoding compressed responses, since sometimes\\n\\t\\t\\t// servers send slightly invalid responses that are still accepted\\n\\t\\t\\t// by common browsers.\\n\\t\\t\\t// Always using Z_SYNC_FLUSH is what cURL does.\\n\\t\\t\\tconst zlibOptions = {\\n\\t\\t\\t\\tflush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH,\\n\\t\\t\\t\\tfinishFlush: zlib__WEBPACK_IMPORTED_MODULE_4__.Z_SYNC_FLUSH\\n\\t\\t\\t};\\n\\n\\t\\t\\t// for gzip\\n\\t\\t\\tif (codings == 'gzip' || codings == 'x-gzip') {\\n\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createGunzip(zlibOptions));\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// for deflate\\n\\t\\t\\tif (codings == 'deflate' || codings == 'x-deflate') {\\n\\t\\t\\t\\t// handle the infamous raw deflate response from old servers\\n\\t\\t\\t\\t// a hack for old IIS and Apache servers\\n\\t\\t\\t\\tconst raw = res.pipe(new PassThrough$1());\\n\\t\\t\\t\\traw.once('data', function (chunk) {\\n\\t\\t\\t\\t\\t// see http://stackoverflow.com/questions/37519828\\n\\t\\t\\t\\t\\tif ((chunk[0] & 0x0F) === 0x08) {\\n\\t\\t\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflate());\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createInflateRaw());\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// for br\\n\\t\\t\\tif (codings == 'br' && typeof zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress === 'function') {\\n\\t\\t\\t\\tbody = body.pipe(zlib__WEBPACK_IMPORTED_MODULE_4__.createBrotliDecompress());\\n\\t\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\t\\tresolve(response);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\t// otherwise, use response as-is\\n\\t\\t\\tresponse = new Response(body, response_options);\\n\\t\\t\\tresolve(response);\\n\\t\\t});\\n\\n\\t\\twriteToStream(req, request);\\n\\t});\\n}\\n/**\\n * Redirect code matching\\n *\\n * @param Number code Status code\\n * @return Boolean\\n */\\nfetch.isRedirect = function (code) {\\n\\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\\n};\\n\\n// expose Promise\\nfetch.Promise = global.Promise;\\n\\n/* harmony default export */ __webpack_exports__[\\\"default\\\"] = (fetch);\\n\\n\\n\\n/***/ }),\\n\\n/***/ \\\"http\\\":\\n/*!***********************!*\\\\\\n !*** external \\\"http\\\" ***!\\n \\\\***********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"http\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"https\\\":\\n/*!************************!*\\\\\\n !*** external \\\"https\\\" ***!\\n \\\\************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"https\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"stream\\\":\\n/*!*************************!*\\\\\\n !*** external \\\"stream\\\" ***!\\n \\\\*************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"stream\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"url\\\":\\n/*!**********************!*\\\\\\n !*** external \\\"url\\\" ***!\\n \\\\**********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"url\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"zlib\\\":\\n/*!***********************!*\\\\\\n !*** external \\\"zlib\\\" ***!\\n \\\\***********************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nmodule.exports = require(\\\"zlib\\\");\\n\\n/***/ })\\n\\n/******/ });\\n//# sourceMappingURL=50604be620465cc30dd8.worker.js.map\", __webpack_public_path__ + \"50604be620465cc30dd8.worker.js\");\n};","'use strict';\n\n// http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string\n\nvar URL = window.URL || window.webkitURL;\n\nmodule.exports = function (content, url) {\n try {\n try {\n var blob;\n\n try {\n // BlobBuilder = Deprecated, but widely implemented\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n\n blob = new BlobBuilder();\n\n blob.append(content);\n\n blob = blob.getBlob();\n } catch (e) {\n // The proposed API\n blob = new Blob([content]);\n }\n\n return new Worker(URL.createObjectURL(blob));\n } catch (e) {\n return new Worker('data:application/javascript,' + encodeURIComponent(content));\n }\n } catch (e) {\n if (!url) {\n throw Error('Inline worker is not supported');\n }\n\n return new Worker(url);\n }\n};","// Use JS implemented TextDecoder and TextEncoder if it is not provided by the\n// browser.\nlet _TextDecoder;\nlet _TextEncoder;\nif (typeof TextDecoder === 'undefined' || typeof TextEncoder === 'undefined') {\n // Wait to require the text encoding polyfill until we know it's needed.\n // eslint-disable-next-line global-require\n const encoding = require('fastestsmallesttextencoderdecoder');\n _TextDecoder = encoding.TextDecoder;\n _TextEncoder = encoding.TextEncoder;\n} else {\n _TextDecoder = TextDecoder;\n _TextEncoder = TextEncoder;\n}\n\nconst md5 = require('js-md5');\n\nconst memoizedToString = (function () {\n /**\n * The maximum length of a chunk before encoding it into base64.\n *\n * 32766 is a multiple of 3 so btoa does not need to use padding characters\n * except for the final chunk where that is fine. 32766 is also close to\n * 32768 so it is close to a size an memory allocator would prefer.\n * @const {number}\n */\n const BTOA_CHUNK_MAX_LENGTH = 32766;\n\n /**\n * An array cache of bytes to characters.\n * @const {?Array.<string>}\n */\n let fromCharCode = null;\n\n const strings = {};\n return (assetId, data) => {\n if (!Object.prototype.hasOwnProperty.call(strings, assetId)) {\n if (typeof btoa === 'undefined') {\n // Use a library that does not need btoa to run.\n /* eslint-disable-next-line global-require */\n const base64js = require('base64-js');\n strings[assetId] = base64js.fromByteArray(data);\n } else {\n // Native btoa is faster than javascript translation. Use js to\n // create a \"binary\" string and btoa to encode it.\n if (fromCharCode === null) {\n // Cache the first 256 characters for input byte values.\n fromCharCode = new Array(256);\n for (let i = 0; i < 256; i++) {\n fromCharCode[i] = String.fromCharCode(i);\n }\n }\n\n const {length} = data;\n let s = '';\n // Iterate over chunks of the binary data.\n for (let i = 0, e = 0; i < length; i = e) {\n // Create small chunks to cause more small allocations and\n // less large allocations.\n e = Math.min(e + BTOA_CHUNK_MAX_LENGTH, length);\n let s_ = '';\n for (let j = i; j < e; j += 1) {\n s_ += fromCharCode[data[j]];\n }\n // Encode the latest chunk so the we create one big output\n // string instead of creating a big input string and then\n // one big output string.\n /* global btoa */\n s += btoa(s_);\n }\n strings[assetId] = s;\n }\n }\n return strings[assetId];\n };\n}());\n\nclass Asset {\n /**\n * Construct an Asset.\n * @param {AssetType} assetType - The type of this asset (sound, image, etc.)\n * @param {string} assetId - The ID of this asset.\n * @param {DataFormat} [dataFormat] - The format of the data (WAV, PNG, etc.); required iff `data` is present.\n * @param {Buffer} [data] - The in-memory data for this asset; optional.\n * @param {bool} [generateId] - Whether to create id from an md5 hash of data\n */\n constructor (assetType, assetId, dataFormat, data, generateId) {\n /** @type {AssetType} */\n this.assetType = assetType;\n\n /** @type {string} */\n this.assetId = assetId;\n\n this.setData(data, dataFormat || assetType.runtimeFormat, generateId);\n\n /** @type {Asset[]} */\n this.dependencies = [];\n }\n\n setData (data, dataFormat, generateId) {\n if (data && !dataFormat) {\n throw new Error('Data provided without specifying its format');\n }\n\n /** @type {DataFormat} */\n this.dataFormat = dataFormat;\n\n /** @type {Buffer} */\n this.data = data;\n\n if (generateId) this.assetId = md5(data);\n\n // Mark as clean only if set is being called without generateId\n // If a new id is being generated, mark this asset as not clean\n this.clean = !generateId;\n }\n\n /**\n * @returns {string} - This asset's data, decoded as text.\n */\n decodeText () {\n const decoder = new _TextDecoder();\n return decoder.decode(this.data);\n }\n\n /**\n * Same as `setData` but encodes text first.\n * @param {string} data - the text data to encode and store.\n * @param {DataFormat} dataFormat - the format of the data (DataFormat.SVG for example).\n * @param {bool} generateId - after setting data, set the id to an md5 of the data?\n */\n encodeTextData (data, dataFormat, generateId) {\n const encoder = new _TextEncoder();\n this.setData(encoder.encode(data), dataFormat, generateId);\n }\n\n /**\n * @param {string} [contentType] - Optionally override the content type to be included in the data URI.\n * @returns {string} - A data URI representing the asset's data.\n */\n encodeDataURI (contentType) {\n contentType = contentType || this.assetType.contentType;\n return `data:${contentType};base64,${memoizedToString(this.assetId, this.data)}`;\n }\n}\n\nmodule.exports = Asset;\n","const DataFormat = require('./DataFormat');\n\n/**\n * Enumeration of the supported asset types.\n * @type {Object.<String,AssetType>}\n * @typedef {Object} AssetType - Information about a supported asset type.\n * @property {string} contentType - the MIME type associated with this kind of data. Useful for data URIs, etc.\n * @property {string} name - The human-readable name of this asset type.\n * @property {DataFormat} runtimeFormat - The default format used for runtime, in-memory storage of this asset. For\n * example, a project stored in SB2 format on disk will be returned as JSON when loaded into memory.\n * @property {boolean} immutable - Indicates if the asset id is determined by the asset content.\n */\nconst AssetType = {\n ImageBitmap: {\n contentType: 'image/png',\n name: 'ImageBitmap',\n runtimeFormat: DataFormat.PNG,\n immutable: true\n },\n ImageVector: {\n contentType: 'image/svg+xml',\n name: 'ImageVector',\n runtimeFormat: DataFormat.SVG,\n immutable: true\n },\n Project: {\n contentType: 'application/json',\n name: 'Project',\n runtimeFormat: DataFormat.JSON,\n immutable: false\n },\n Sound: {\n contentType: 'audio/x-wav',\n name: 'Sound',\n runtimeFormat: DataFormat.WAV,\n immutable: true\n },\n Sprite: {\n contentType: 'application/json',\n name: 'Sprite',\n runtimeFormat: DataFormat.JSON,\n immutable: true\n }\n};\n\nmodule.exports = AssetType;\n","const md5 = require('js-md5');\n\nconst log = require('./log');\n\nconst Asset = require('./Asset');\nconst AssetType = require('./AssetType');\nconst DataFormat = require('./DataFormat');\nconst Helper = require('./Helper');\n\n/**\n * @typedef {object} BuiltinAssetRecord\n * @property {AssetType} type - The type of the asset.\n * @property {DataFormat} format - The format of the asset's data.\n * @property {?string} id - The asset's unique ID.\n * @property {Buffer} data - The asset's data.\n */\n\n/**\n * @type {BuiltinAssetRecord[]}\n */\nconst DefaultAssets = [\n {\n type: AssetType.ImageBitmap,\n format: DataFormat.PNG,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultBitmap.png') // eslint-disable-line global-require\n )\n },\n {\n type: AssetType.Sound,\n format: DataFormat.WAV,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultSound.wav') // eslint-disable-line global-require\n )\n },\n {\n type: AssetType.ImageVector,\n format: DataFormat.SVG,\n id: null,\n data: Buffer.from(\n require('!arraybuffer-loader!./builtins/defaultVector.svg') // eslint-disable-line global-require\n )\n }\n];\n\n/**\n * @type {BuiltinAssetRecord[]}\n */\nconst BuiltinAssets = DefaultAssets.concat([\n]);\n\nclass BuiltinHelper extends Helper {\n constructor (parent) {\n super(parent);\n\n /**\n * In-memory storage for all built-in assets.\n * @type {Object.<AssetType, AssetIdMap>} Maps asset type to a map of asset ID to actual assets.\n * @typedef {Object.<string, BuiltinAssetRecord>} AssetIdMap - Maps asset ID to asset.\n */\n this.assets = {};\n\n BuiltinAssets.forEach(assetRecord => {\n assetRecord.id = this._store(assetRecord.type, assetRecord.format, assetRecord.data, assetRecord.id);\n });\n }\n\n /**\n * Call `setDefaultAssetId` on the parent `ScratchStorage` instance to register all built-in default assets.\n */\n registerDefaultAssets () {\n const numAssets = DefaultAssets.length;\n for (let assetIndex = 0; assetIndex < numAssets; ++assetIndex) {\n const assetRecord = DefaultAssets[assetIndex];\n this.parent.setDefaultAssetId(assetRecord.type, assetRecord.id);\n }\n }\n\n\n /**\n * Synchronously fetch a cached asset for a given asset id. Returns null if not found.\n * @param {string} assetId - The id for the asset to fetch.\n * @returns {?Asset} The asset for assetId, if it exists.\n */\n get (assetId) {\n let asset = null;\n if (Object.prototype.hasOwnProperty.call(this.assets, assetId)) {\n /** @type{BuiltinAssetRecord} */\n const assetRecord = this.assets[assetId];\n asset = new Asset(assetRecord.type, assetRecord.id, assetRecord.format, assetRecord.data);\n }\n return asset;\n }\n\n /**\n * Alias for store (old name of store)\n * @deprecated Use BuiltinHelper.store\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n cache (assetType, dataFormat, data, id) {\n log.warn('Deprecation: BuiltinHelper.cache has been replaced with BuiltinHelper.store.');\n return this.store(assetType, dataFormat, data, id);\n }\n\n /**\n * Deprecated external API for _store\n * @deprecated Not for external use. Create assets and keep track of them outside of the storage instance.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {(string|number)} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n store (assetType, dataFormat, data, id) {\n log.warn('Deprecation: use Storage.createAsset. BuiltinHelper is for internal use only.');\n return this._store(assetType, dataFormat, data, id);\n }\n\n /**\n * Cache an asset for future lookups by ID.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {(string|number)} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n _store (assetType, dataFormat, data, id) {\n if (!dataFormat) throw new Error('Data cached without specifying its format');\n if (id !== '' && id !== null && typeof id !== 'undefined') {\n if (Object.prototype.hasOwnProperty.call(this.assets, id) && assetType.immutable) return id;\n } else if (assetType.immutable) {\n id = md5(data);\n } else {\n throw new Error('Tried to cache data without an id');\n }\n this.assets[id] = {\n type: assetType,\n format: dataFormat,\n id: id,\n data: data\n };\n return id;\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {?Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId) {\n if (!this.get(assetId)) {\n // Return null immediately so Storage can quickly move to trying the\n // next helper.\n return null;\n }\n return Promise.resolve(this.get(assetId));\n }\n}\n\nmodule.exports = BuiltinHelper;\n","/**\n * Enumeration of the supported data formats.\n * @enum {string}\n */\nconst DataFormat = {\n JPG: 'jpg',\n JSON: 'json',\n MP3: 'mp3',\n PNG: 'png',\n SB2: 'sb2',\n SB3: 'sb3',\n SVG: 'svg',\n WAV: 'wav'\n};\n\nmodule.exports = DataFormat;\n","/* eslint-env browser */\n\n/**\n * Get and send assets with the fetch standard web api.\n */\nclass FetchTool {\n /**\n * Is get supported? false if the environment does not support fetch.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return typeof fetch !== 'undefined';\n }\n\n /**\n * Request data from a server with fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @param {{method:string}} options - Additional options to configure fetch.\n * @returns {Promise.<Uint8Array>} Resolve to Buffer of data from server.\n */\n get ({url, ...options}) {\n return fetch(url, Object.assign({method: 'GET'}, options))\n .then(result => {\n if (result.ok) return result.arrayBuffer().then(b => new Uint8Array(b));\n if (result.status === 404) return null;\n return Promise.reject(result.status);\n });\n }\n\n /**\n * Is sending supported? false if the environment does not support sending\n * with fetch.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return typeof fetch !== 'undefined';\n }\n\n /**\n * Send data to a server with fetch.\n * @param {Request} reqConfig - Request configuration for data to send.\n * @returns {Promise.<string>} Server returned metadata.\n */\n send ({url, withCredentials = false, ...options}) {\n return fetch(url, Object.assign({\n credentials: withCredentials ? 'include' : 'omit'\n }, options))\n .then(response => {\n if (response.ok) return response.text();\n return Promise.reject(response.status);\n });\n }\n}\n\nmodule.exports = FetchTool;\n","/**\n * Get and send assets with a worker that uses fetch.\n */\nclass PrivateFetchWorkerTool {\n constructor () {\n /**\n * What does the worker support of the APIs we need?\n * @type {{fetch:boolean}}\n */\n this._workerSupport = {\n fetch: typeof fetch !== 'undefined'\n };\n\n /**\n * A possible error occurred standing up the worker.\n * @type {!Error}\n */\n this._supportError = null;\n\n /**\n * The worker that runs fetch and returns data for us.\n * @type {!Worker}\n */\n this.worker = null;\n\n /**\n * A map of ids to fetch job objects.\n * @type {object}\n */\n this.jobs = {};\n\n try {\n if (this.isGetSupported) {\n // eslint-disable-next-line global-require\n const FetchWorker = require('worker-loader?{\"inline\":true,\"fallback\":true}!./FetchWorkerTool.worker');\n\n this.worker = new FetchWorker();\n\n this.worker.addEventListener('message', ({data}) => {\n if (data.support) {\n this._workerSupport = data.support;\n return;\n }\n for (const message of data) {\n if (this.jobs[message.id]) {\n if (message.error) {\n this.jobs[message.id].reject(message.error);\n } else {\n this.jobs[message.id].resolve(message.buffer);\n }\n delete this.jobs[message.id];\n }\n }\n });\n }\n } catch (error) {\n this._supportError = error;\n }\n }\n\n /**\n * Is get supported?\n *\n * false if the environment does not workers, fetch, or fetch from inside a\n * worker. Finding out the worker supports fetch is asynchronous and will\n * guess that it does if the window does until the worker can inform us.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return (\n typeof Worker !== 'undefined' &&\n this._workerSupport.fetch &&\n !this._supportError\n );\n }\n\n /**\n * Request data from a server with a worker using fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @param {{method:string}} options - Additional options to configure fetch.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get ({url, ...options}) {\n return new Promise((resolve, reject) => {\n // TODO: Use a Scratch standard ID generator ...\n const id = Math.random().toString(16)\n .substring(2);\n this.worker.postMessage({\n id,\n url,\n options: Object.assign({method: 'GET'}, options)\n });\n this.jobs[id] = {\n id,\n resolve,\n reject\n };\n })\n /* eslint no-confusing-arrow: [\"error\", {\"allowParens\": true}] */\n .then(body => (body ? new Uint8Array(body) : null));\n }\n\n /**\n * Is sending supported? always false for FetchWorkerTool.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return false;\n }\n\n /**\n * Send data to a server.\n * @throws {Error} A not implemented error.\n */\n send () {\n throw new Error('Not implemented.');\n }\n\n /**\n * Return a static PrivateFetchWorkerTool instance on demand.\n * @returns {PrivateFetchWorkerTool} A static PrivateFetchWorkerTool\n * instance\n */\n static get instance () {\n if (!this._instance) {\n this._instance = new PrivateFetchWorkerTool();\n }\n return this._instance;\n }\n}\n\n/**\n * Get and send assets with a worker that uses fetch.\n */\nclass PublicFetchWorkerTool {\n constructor () {\n /**\n * Shared instance of an internal worker. PublicFetchWorkerTool proxies\n * it.\n * @type {PrivateFetchWorkerTool}\n */\n this.inner = PrivateFetchWorkerTool.instance;\n }\n\n /**\n * Is get supported?\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return this.inner.isGetSupported;\n }\n\n /**\n * Request data from a server with a worker that uses fetch.\n * @param {{url:string}} reqConfig - Request configuration for data to get.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get (reqConfig) {\n return this.inner.get(reqConfig);\n }\n\n /**\n * Is sending supported?\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return false;\n }\n\n /**\n * Send data to a server with a worker that uses fetch.\n * @throws {Error} A not implemented error.\n */\n send () {\n throw new Error('Not implemented.');\n }\n}\n\nmodule.exports = PublicFetchWorkerTool;\n","/**\n * Base class for asset load/save helpers.\n * @abstract\n */\nclass Helper {\n constructor (parent) {\n this.parent = parent;\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} dataFormat - The file format / file extension of the asset to fetch: PNG, JPG, etc.\n * @return {Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId, dataFormat) {\n return Promise.reject(new Error(`No asset of type ${assetType} for ID ${assetId} with format ${dataFormat}`));\n }\n}\n\nmodule.exports = Helper;\n","const FetchWorkerTool = require('./FetchWorkerTool');\nconst FetchTool = require('./FetchTool');\n\n/**\n * @typedef {object} Request\n * @property {string} url\n * @property {*} body\n * @property {string} method\n * @property {boolean} withCredentials\n */\n\n/**\n * Get and send assets with other tools in sequence.\n */\nclass ProxyTool {\n constructor (filter = ProxyTool.TOOL_FILTER.ALL) {\n let tools;\n if (filter === ProxyTool.TOOL_FILTER.READY) {\n tools = [new FetchTool()];\n } else {\n tools = [new FetchWorkerTool(), new FetchTool()];\n }\n\n /**\n * Sequence of tools to proxy.\n * @type {Array.<Tool>}\n */\n this.tools = tools;\n }\n\n /**\n * Is get supported? false if all proxied tool return false.\n * @returns {boolean} Is get supported?\n */\n get isGetSupported () {\n return this.tools.some(tool => tool.isGetSupported);\n }\n\n /**\n * Request data from with one of the proxied tools.\n * @param {Request} reqConfig - Request configuration for data to get.\n * @returns {Promise.<Buffer>} Resolve to Buffer of data from server.\n */\n get (reqConfig) {\n let toolIndex = 0;\n const nextTool = err => {\n const tool = this.tools[toolIndex++];\n if (!tool) {\n throw err;\n }\n if (!tool.isGetSupported) {\n return nextTool(err);\n }\n return tool.get(reqConfig).catch(nextTool);\n };\n return nextTool();\n }\n\n /**\n * Is sending supported? false if all proxied tool return false.\n * @returns {boolean} Is sending supported?\n */\n get isSendSupported () {\n return this.tools.some(tool => tool.isSendSupported);\n }\n\n /**\n * Send data to a server with one of the proxied tools.\n * @param {Request} reqConfig - Request configuration for data to send.\n * @returns {Promise.<Buffer|string|object>} Server returned metadata.\n */\n send (reqConfig) {\n let toolIndex = 0;\n const nextTool = err => {\n const tool = this.tools[toolIndex++];\n if (!tool) {\n throw err;\n }\n if (!tool.isSendSupported) {\n return nextTool(err);\n }\n return tool.send(reqConfig).catch(nextTool);\n };\n return nextTool();\n }\n}\n\n/**\n * Constant values that filter the set of tools in a ProxyTool instance.\n * @enum {string}\n */\nProxyTool.TOOL_FILTER = {\n /**\n * Use all tools.\n */\n ALL: 'all',\n\n /**\n * Use tools that are ready right now.\n */\n READY: 'ready'\n};\n\nmodule.exports = ProxyTool;\n","const log = require('./log');\n\nconst BuiltinHelper = require('./BuiltinHelper');\nconst WebHelper = require('./WebHelper');\n\nconst _Asset = require('./Asset');\nconst _AssetType = require('./AssetType');\nconst _DataFormat = require('./DataFormat');\n\nclass ScratchStorage {\n constructor () {\n this.defaultAssetId = {};\n\n this.builtinHelper = new BuiltinHelper(this);\n this.webHelper = new WebHelper(this);\n this.builtinHelper.registerDefaultAssets(this);\n\n this._helpers = [\n {\n helper: this.builtinHelper,\n priority: 100\n },\n {\n helper: this.webHelper,\n priority: -100\n }\n ];\n }\n\n /**\n * @return {Asset} - the `Asset` class constructor.\n * @constructor\n */\n get Asset () {\n return _Asset;\n }\n\n /**\n * @return {AssetType} - the list of supported asset types.\n * @constructor\n */\n get AssetType () {\n return _AssetType;\n }\n\n /**\n * @return {DataFormat} - the list of supported data formats.\n * @constructor\n */\n get DataFormat () {\n return _DataFormat;\n }\n\n /**\n * @deprecated Please use the `Asset` member of a storage instance instead.\n * @return {Asset} - the `Asset` class constructor.\n * @constructor\n */\n static get Asset () {\n return _Asset;\n }\n\n /**\n * @deprecated Please use the `AssetType` member of a storage instance instead.\n * @return {AssetType} - the list of supported asset types.\n * @constructor\n */\n static get AssetType () {\n return _AssetType;\n }\n\n /**\n * Add a storage helper to this manager. Helpers with a higher priority number will be checked first when loading\n * or storing assets. For comparison, the helper for built-in assets has `priority=100` and the default web helper\n * has `priority=-100`. The relative order of helpers with equal priorities is undefined.\n * @param {Helper} helper - the helper to be added.\n * @param {number} [priority] - the priority for this new helper (default: 0).\n */\n addHelper (helper, priority = 0) {\n this._helpers.push({helper, priority});\n this._helpers.sort((a, b) => b.priority - a.priority);\n }\n\n /**\n * Synchronously fetch a cached asset from built-in storage. Assets are cached when they are loaded.\n * @param {string} assetId - The id of the asset to fetch.\n * @returns {?Asset} The asset, if it exists.\n */\n get (assetId) {\n return this.builtinHelper.get(assetId);\n }\n\n /**\n * Deprecated API for caching built-in assets. Use createAsset.\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} id - The id for the cached asset.\n * @returns {string} The calculated id of the cached asset, or the supplied id if the asset is mutable.\n */\n cache (assetType, dataFormat, data, id) {\n log.warn('Deprecation: Storage.cache is deprecated. Use Storage.createAsset, and store assets externally.');\n return this.builtinHelper._store(assetType, dataFormat, data, id);\n }\n\n /**\n * Construct an Asset, and optionally generate an md5 hash of its data to create an id\n * @param {AssetType} assetType - The type of the asset to cache.\n * @param {DataFormat} dataFormat - The dataFormat of the data for the cached asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {string} [id] - The id for the cached asset.\n * @param {bool} [generateId] - flag to set id to an md5 hash of data if `id` isn't supplied\n * @returns {Asset} generated Asset with `id` attribute set if not supplied\n */\n createAsset (assetType, dataFormat, data, id, generateId) {\n if (!dataFormat) throw new Error('Tried to create asset without a dataFormat');\n return new _Asset(assetType, id, dataFormat, data, generateId);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} getFunction - A function which computes a GET URL from an Asset.\n * @param {UrlFunction} createFunction - A function which computes a POST URL for asset data.\n * @param {UrlFunction} updateFunction - A function which computes a PUT URL for asset data.\n */\n addWebStore (types, getFunction, createFunction, updateFunction) {\n this.webHelper.addStore(types, getFunction, createFunction, updateFunction);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @deprecated Please use addWebStore\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} urlFunction - A function which computes a GET URL from an Asset.\n */\n addWebSource (types, urlFunction) {\n log.warn('Deprecation: Storage.addWebSource has been replaced by addWebStore.');\n this.addWebStore(types, urlFunction);\n }\n\n /**\n * TODO: Should this be removed in favor of requesting an asset with `null` as the ID?\n * @param {AssetType} type - Get the default ID for assets of this type.\n * @return {?string} The ID of the default asset of the given type, if any.\n */\n getDefaultAssetId (type) {\n if (Object.prototype.hasOwnProperty.call(this.defaultAssetId, type.name)) {\n return this.defaultAssetId[type.name];\n }\n }\n\n /**\n * Set the default ID for a particular type of asset. This default asset will be used if a requested asset cannot\n * be found and automatic fallback is enabled. Ideally this should be an asset that is available locally or even\n * one built into this module.\n * TODO: Should this be removed in favor of requesting an asset with `null` as the ID?\n * @param {AssetType} type - The type of asset for which the default will be set.\n * @param {string} id - The default ID to use for this type of asset.\n */\n setDefaultAssetId (type, id) {\n this.defaultAssetId[type.name] = id;\n }\n\n /**\n * Fetch an asset by type & ID.\n * @param {AssetType} assetType - The type of asset to fetch. This also determines which asset store to use.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} [dataFormat] - Optional: load this format instead of the AssetType's default.\n * @return {Promise.<Asset>} A promise for the requested Asset.\n * If the promise is resolved with non-null, the value is the requested asset.\n * If the promise is resolved with null, the desired asset could not be found with the current asset sources.\n * If the promise is rejected, there was an error on at least one asset source. HTTP 404 does not count as an\n * error here, but (for example) HTTP 403 does.\n */\n load (assetType, assetId, dataFormat) {\n /** @type {Helper[]} */\n const helpers = this._helpers.map(x => x.helper);\n const errors = [];\n dataFormat = dataFormat || assetType.runtimeFormat;\n\n let helperIndex = 0;\n let helper;\n const tryNextHelper = err => {\n if (err) { // Track the error, but continue looking\n errors.push(err);\n }\n\n helper = helpers[helperIndex++];\n\n if (helper) {\n const loading = helper.load(assetType, assetId, dataFormat);\n if (loading === null) {\n return tryNextHelper();\n }\n // Note that other attempts may have logged errors; if this succeeds they will be suppressed.\n return loading\n // TODO: maybe some types of error should prevent trying the next helper?\n .catch(tryNextHelper);\n } else if (errors.length > 0) {\n // We looked through all the helpers and couldn't find the asset, AND\n // at least one thing went wrong while we were looking.\n return Promise.reject(errors);\n }\n\n // Nothing went wrong but we couldn't find the asset.\n return Promise.resolve(null);\n };\n\n return tryNextHelper();\n }\n\n /**\n * Store an asset by type & ID.\n * @param {AssetType} assetType - The type of asset to fetch. This also determines which asset store to use.\n * @param {?DataFormat} [dataFormat] - Optional: load this format instead of the AssetType's default.\n * @param {Buffer} data - Data to store for the asset\n * @param {?string} [assetId] - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {Promise.<object>} A promise for asset metadata\n */\n store (assetType, dataFormat, data, assetId) {\n dataFormat = dataFormat || assetType.runtimeFormat;\n return new Promise(\n (resolve, reject) =>\n this.webHelper.store(assetType, dataFormat, data, assetId)\n .then(body => {\n this.builtinHelper._store(assetType, dataFormat, data, body.id);\n return resolve(body);\n })\n .catch(error => reject(error))\n );\n }\n}\n\nmodule.exports = ScratchStorage;\n","const log = require('./log');\n\nconst Asset = require('./Asset');\nconst Helper = require('./Helper');\nconst ProxyTool = require('./ProxyTool');\n\nconst ensureRequestConfig = reqConfig => {\n if (typeof reqConfig === 'string') {\n return {\n url: reqConfig\n };\n }\n return reqConfig;\n};\n\n/**\n * @typedef {function} UrlFunction - A function which computes a URL from asset information.\n * @param {Asset} - The asset for which the URL should be computed.\n * @returns {(string|object)} - A string representing the URL for the asset request OR an object with configuration for\n * the underlying fetch call (necessary for configuring e.g. authentication)\n */\n\nclass WebHelper extends Helper {\n constructor (parent) {\n super(parent);\n\n /**\n * @type {Array.<StoreRecord>}\n * @typedef {object} StoreRecord\n * @property {Array.<string>} types - The types of asset provided by this store, from AssetType's name field.\n * @property {UrlFunction} getFunction - A function which computes a URL from an Asset.\n * @property {UrlFunction} createFunction - A function which computes a URL from an Asset.\n * @property {UrlFunction} updateFunction - A function which computes a URL from an Asset.\n */\n this.stores = [];\n\n /**\n * Set of tools to best load many assets in parallel. If one tool\n * cannot be used, it will use the next.\n * @type {ProxyTool}\n */\n this.assetTool = new ProxyTool();\n\n /**\n * Set of tools to best load project data in parallel with assets. This\n * tool set prefers tools that are immediately ready. Some tools have\n * to initialize before they can load files.\n * @type {ProxyTool}\n */\n this.projectTool = new ProxyTool(ProxyTool.TOOL_FILTER.READY);\n }\n\n /**\n * Register a web-based source for assets. Sources will be checked in order of registration.\n * @deprecated Please use addStore\n * @param {Array.<AssetType>} types - The types of asset provided by this source.\n * @param {UrlFunction} urlFunction - A function which computes a URL from an Asset.\n */\n addSource (types, urlFunction) {\n log.warn('Deprecation: WebHelper.addSource has been replaced with WebHelper.addStore.');\n this.addStore(types, urlFunction);\n }\n\n /**\n * Register a web-based store for assets. Sources will be checked in order of registration.\n * @param {Array.<AssetType>} types - The types of asset provided by this store.\n * @param {UrlFunction} getFunction - A function which computes a GET URL for an Asset\n * @param {UrlFunction} createFunction - A function which computes a POST URL for an Asset\n * @param {UrlFunction} updateFunction - A function which computes a PUT URL for an Asset\n */\n addStore (types, getFunction, createFunction, updateFunction) {\n this.stores.push({\n types: types.map(assetType => assetType.name),\n get: getFunction,\n create: createFunction,\n update: updateFunction\n });\n }\n\n /**\n * Fetch an asset but don't process dependencies.\n * @param {AssetType} assetType - The type of asset to fetch.\n * @param {string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @param {DataFormat} dataFormat - The file format / file extension of the asset to fetch: PNG, JPG, etc.\n * @return {Promise.<Asset>} A promise for the contents of the asset.\n */\n load (assetType, assetId, dataFormat) {\n\n /** @type {Array.<{url:string, result:*}>} List of URLs attempted & errors encountered. */\n const errors = [];\n const stores = this.stores.slice()\n .filter(store => store.types.indexOf(assetType.name) >= 0);\n \n // New empty asset but it doesn't have data yet\n const asset = new Asset(assetType, assetId, dataFormat);\n\n let tool = this.assetTool;\n if (assetType.name === 'Project') {\n tool = this.projectTool;\n }\n\n let storeIndex = 0;\n const tryNextSource = err => {\n if (err) {\n errors.push(err);\n }\n const store = stores[storeIndex++];\n\n /** @type {UrlFunction} */\n const reqConfigFunction = store && store.get;\n\n if (reqConfigFunction) {\n const reqConfig = ensureRequestConfig(reqConfigFunction(asset));\n if (reqConfig === false) {\n return tryNextSource();\n }\n\n return tool.get(reqConfig)\n .then(body => {\n if (body) {\n asset.setData(body, dataFormat);\n return asset;\n }\n return tryNextSource();\n })\n .catch(tryNextSource);\n } else if (errors.length > 0) {\n return Promise.reject(errors);\n }\n\n // no stores matching asset\n return Promise.resolve(null);\n };\n\n return tryNextSource();\n }\n\n /**\n * Create or update an asset with provided data. The create function is called if no asset id is provided\n * @param {AssetType} assetType - The type of asset to create or update.\n * @param {?DataFormat} dataFormat - DataFormat of the data for the stored asset.\n * @param {Buffer} data - The data for the cached asset.\n * @param {?string} assetId - The ID of the asset to fetch: a project ID, MD5, etc.\n * @return {Promise.<object>} A promise for the response from the create or update request\n */\n store (assetType, dataFormat, data, assetId) {\n const asset = new Asset(assetType, assetId, dataFormat);\n // If we have an asset id, we should update, otherwise create to get an id\n const create = assetId === '' || assetId === null || typeof assetId === 'undefined';\n\n // Use the first store with the appropriate asset type and url function\n const store = this.stores.filter(s =>\n // Only use stores for the incoming asset type\n s.types.indexOf(assetType.name) !== -1 && (\n // Only use stores that have a create function if this is a create request\n // or an update function if this is an update request\n (create && s.create) || s.update\n )\n )[0];\n\n const method = create ? 'post' : 'put';\n\n if (!store) return Promise.reject(new Error('No appropriate stores'));\n\n let tool = this.assetTool;\n if (assetType.name === 'Project') {\n tool = this.projectTool;\n }\n\n const reqConfig = ensureRequestConfig(\n create ? store.create(asset) : store.update(asset)\n );\n const reqBodyConfig = Object.assign({body: data, method}, reqConfig);\n return tool.send(reqBodyConfig)\n .then(body => {\n // xhr makes it difficult to both send FormData and\n // automatically parse a JSON response. So try to parse\n // everything as JSON.\n if (typeof body === 'string') {\n try {\n body = JSON.parse(body);\n } catch (parseError) {\n // If it's not parseable, then we can't add the id even\n // if we want to, so stop here\n return body;\n }\n }\n return Object.assign({\n id: body['content-name'] || assetId\n }, body);\n });\n }\n}\n\nmodule.exports = WebHelper;\n","const ScratchStorage = require('./ScratchStorage');\n\n/**\n * Export for use with NPM & Node.js.\n * @type {ScratchStorage}\n */\nmodule.exports = ScratchStorage;\n","const minilog = require('minilog');\nminilog.enable();\n\nmodule.exports = minilog('storage');\n","module.exports = require(\"base64-js\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"js-md5\");","module.exports = require(\"stream\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClFA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrmDA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AADA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AAEA;AAEA;AACA;AAAA;AACA;AACA;;;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AADA;AAEA;AACA;AAAA;AAEA;AAGA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;AClJA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AACA;AACA;AAJA;AAzBA;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AAEA;AACA;AACA;AACA;AAAA;AAJA;AASA;AACA;AACA;AACA;AAAA;AAJA;AASA;AACA;AACA;AACA;AAAA;AAJA;AAUA;AACA;AACA;AACA;AAAA;AACA;AAEA;;;;;AACA;AAAA;AACA;AADA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAZA;AAaA;AAEA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;AA9GA;AACA;AAgHA;;;;;;;;;;;ACtKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA;AAWA;;;;;;;;;;;;;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AADA;AAIA;AACA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AAAA;AACA;AADA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AADA;AAIA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AALA;AAAA;AACA;AADA;AAKA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAdA;AAAA;AAAA;AAAA;AAAA;AAeA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AADA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAHA;AACA;AAIA;AACA;AACA;AACA;AAHA;AAKA;AACA;AAfA;AAgBA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;AAGA;AACA;AACA;AACA;AACA;AADA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;;;;;;AAGA;;;;;;;;;;;;;;;;;ACrBA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAAA;AACA;AADA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA;AAYA;;;;;;;;;;;;;;;;;ACvGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAFA;AAKA;AACA;AAFA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAAA;AACA;AAAA;AACA;AACA;AAGA;AACA;AAAA;AACA;AACA;AAAA;AANA;AAQA;;;AA7KA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;;;;;;AAqKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1OA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;;;;;AACA;AAAA;AACA;AADA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AA1BA;AA2BA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AADA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAJA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AAEA;AACA;AALA;AAAA;AASA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AADA;AAGA;AACA;;;;AAzKA;AACA;AA2KA;;;;;;;;;;;AClMA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;;;;;;;;;;;ACNA;AACA;AAAA;AAEA;;;;;;;;;;;ACHA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;A","sourceRoot":""}
|